Component: TCP/IP Dummy (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 to download the component source project: [https://www.flowcode.co.uk/ | Please click here to download the component source project: [https://www.flowcode.co.uk/wiki/componentsource/FC_Comp_Source_TCPIP_RPI_Dummy.fcfx FC_Comp_Source_TCPIP_RPI_Dummy.fcfx] | ||
Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TCPIP_RPI_Dummy.fcfx FC_Comp_Source_TCPIP_RPI_Dummy.fcfx] | Please click here to view the component source code (Beta): [https://www.flowcode.co.uk/FlowchartView/?wfile=componentsource/FC_Comp_Source_TCPIP_RPI_Dummy.fcfx FC_Comp_Source_TCPIP_RPI_Dummy.fcfx] | ||
==Detailed description== | ==Detailed description== | ||
| Line 46: | Line 48: | ||
==Examples== | ==Examples== | ||
| Line 79: | Line 83: | ||
==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" | | |||
|- | |||
|- | |||
| 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''' | |||
|- | |||
|}==Macro reference== | |||
{| class="wikitable" style="width:60%; background-color:#FFFFFF;" | {| class="wikitable" style="width:60%; background-color:#FFFFFF;" | ||
Revision as of 10:00, 27 January 2023
| Author | Matrix Ltd. |
| Version | 1.8 |
| Category | Comms: Networking |
TCP/IP Dummy component
TCP/IP sockets component for use with Raspberry Pi. Raspberry Pi Only
Component Source Code
Please click here to download the component source project: FC_Comp_Source_TCPIP_RPI_Dummy.fcfx
Please click here to view the component source code (Beta): FC_Comp_Source_TCPIP_RPI_Dummy.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Here is an example of using the TCP/IP component as a means to request data from a remote server on the internet or local network.
Example RPI Client Request Data
Here is an example of using the TCP/IP component as a means to serve data to a client via the internet or local network.
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 | |
| Return | |
Property reference
| Properties |
==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 | |
| Return | |
Property reference
| Properties |
==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 | |
| Return | |
Property reference
| Properties |
==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 | |
| Return | |
Property reference
| Properties |