Component: TCP/IP (Raspberry Pi) (Comms: Networking): Difference between revisions
Appearance
No edit summary |
No edit summary |
||
| Line 17: | Line 17: | ||
==Component Source Code== | ==Component Source Code== | ||
Please click here | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TCPIP_RPI.fcfx FC_Comp_Source_TCPIP_RPI.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
| Line 26: | Line 28: | ||
==Examples== | ==Examples== | ||
| Line 32: | Line 36: | ||
==Macro reference== | ==Macro reference== | ||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Connect''' | |||
|- | |||
| colspan="2" | Attempt to connect to the given address and port. First open a socket on the local device using the Socket function and check that it is successful. | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="90%" | Address | |||
|- | |||
| colspan="2" | Remote destination address | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" | Port | |||
|- | |||
| colspan="2" | Remote destination port | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Receive''' | |||
|- | |||
| colspan="2" | Receive data into the data buffer. Returns the number of bytes received | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="90%" | Data | |||
|- | |||
| colspan="2" | Data byte buffer to receive the data | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" | Count | |||
|- | |||
| colspan="2" | Maximum number of bytes to read | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Send''' | |||
|- | |||
| colspan="2" | Send data | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-string-icon.png]] - STRING | |||
| width="90%" | Data | |||
|- | |||
| colspan="2" | Data byte buffer to send | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" | Count | |||
|- | |||
| colspan="2" | Number of bytes to send | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Listen''' | |||
|- | |||
| colspan="2" | Bind the socket to a port on the local host and set to listen mode. First open a socket on the local device using the Socket function and check that it is successful. | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u16-icon.png]] - UINT | |||
| width="90%" | Port | |||
|- | |||
| colspan="2" | | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SocketOpen''' | |||
|- | |||
| colspan="2" | Attempts to create a socket on the local device. Type =0 for TCP, =1 for UDP This must be successfully done before attempting connection with a remote destination. Returns 1 if successful, 0 if not. | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" | Type | |||
|- | |||
| colspan="2" | Type of socket to create | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''SocketClose''' | |||
|- | |||
| colspan="2" | Close the socket | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AcceptOpen''' | |||
|- | |||
| colspan="2" | | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-u8-icon.png]] - BYTE | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''AcceptClose''' | |||
|- | |||
| colspan="2" | Close the accept socket | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" align="center" | [[File:Fc9-comp-macro.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Initialise''' | |||
|- | |||
| colspan="2" | Initialises the TCP/IP component | |||
|- | |||
|- | |||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | |||
| width="90%" style="border-top: 2px solid #000;" | ''Return'' | |||
|} | |||
==Property reference== | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | |||
|- | |||
| width="10%" align="center" style="background-color:#D8C9D8;" | [[File:Fc9-prop-icon.png]] | |||
| width="90%" style="background-color:#D8C9D8; color:#4B008D;" | '''Properties''' | |||
|- | |||
|- | |||
| width="10%" align="center" | [[File:Fc9-type-10-icon.png]] | |||
| width="90%" | Label | |||
|- | |||
| colspan="2" | | |||
|}==Macro reference== | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
Revision as of 15:17, 20 January 2023
| Author | Matrix Ltd. |
| Version | 1.9 |
| Category | Comms: Networking |
TCP/IP (Raspberry Pi) component
TCP/IP sockets component for use with Raspberry Pi. Raspberry Pi Only
Component Source Code
Please click here to view the component source code (Beta): FC_Comp_Source_TCPIP_RPI.fcfx
Detailed description
No detailed description exists yet for this component
Examples
No additional examples
Macro reference
| Receive | |
| Receive data into the data buffer. Returns the number of bytes received | |
| Data | |
| Data byte buffer to receive the data | |
| Count | |
| Maximum number of bytes to read | |
| Return | |
| Send | |
| Send data | |
| Data | |
| Data byte buffer to send | |
| Count | |
| Number of bytes to send | |
| Return | |
| Listen | |
| Bind the socket to a port on the local host and set to listen mode. First open a socket on the local device using the Socket function and check that it is successful. | |
| Port | |
| Return | |
| SocketClose | |
| Close the socket | |
| Return | |
| AcceptOpen | |
| Return | |
| AcceptClose | |
| Close the accept socket | |
| Return | |
| Initialise | |
| Initialises the TCP/IP component | |
| Return | |
Property reference
| Properties | |
| Label | |
==Macro reference==
| Receive | |
| Receive data into the data buffer. Returns the number of bytes received | |
| Data | |
| Data byte buffer to receive the data | |
| Count | |
| Maximum number of bytes to read | |
| Return | |
| Send | |
| Send data | |
| Data | |
| Data byte buffer to send | |
| Count | |
| Number of bytes to send | |
| Return | |
| Listen | |
| Bind the socket to a port on the local host and set to listen mode. First open a socket on the local device using the Socket function and check that it is successful. | |
| Port | |
| Return | |
| SocketClose | |
| Close the socket | |
| Return | |
| AcceptOpen | |
| Return | |
| AcceptClose | |
| Close the accept socket | |
| Return | |
| Initialise | |
| Initialises the TCP/IP component | |
| Return | |
Property reference
| Properties | |
| Label | |