Difference between revisions of "Component: TCP Template (Comms: Networking)"
From Flowcode Help
Jump to navigationJump to searchLine 15: | Line 15: | ||
Base TCP/IP component with simulation only interface to allow TCP/IP style network communications in simulation. Suitable for inheriting | Base TCP/IP component with simulation only interface to allow TCP/IP style network communications in simulation. Suitable for inheriting | ||
− | ==Component | + | ==Component Source Code== |
− | + | Please click here for the component source code: [https://www.flowcode.co.uk/wikicopy/componentsource/FC_Comp_Source_TCPIP_Base.fcfx FC_Comp_Source_TCPIP_Base.fcfx] | |
==Detailed description== | ==Detailed description== | ||
+ | |||
+ | |||
Line 32: | Line 34: | ||
==Examples== | ==Examples== | ||
+ | |||
+ | |||
Line 682: | Line 686: | ||
|- | |- | ||
| colspan="2" | Specifies the communications channel 0-3 | | colspan="2" | Specifies the communications channel 0-3 | ||
+ | |- | ||
+ | | 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;" | '''SetChannel''' | ||
+ | |- | ||
+ | | colspan="2" | Dictates the TCP IP channel used for socket communications allowing for multiple parrallel communication streams to co-exist, Used by the network comms component to drive the TCP IP runtime comms | ||
+ | |- | ||
+ | |- | ||
+ | | width="10%" align="center" | [[File:Fc9-u8-icon.png]] - BYTE | ||
+ | | width="90%" | Channel | ||
+ | |- | ||
+ | | colspan="2" | Range: 0 to 3 | ||
|- | |- | ||
| width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | | width="10%" align="center" style="border-top: 2px solid #000;" | [[File:Fc9-void-icon.png]] - VOID | ||
Line 1,120: | Line 1,142: | ||
|- | |- | ||
| colspan="2" | List of network interfaces connected to the PC. Sets which interface we are communicating via. | | colspan="2" | List of network interfaces connected to the PC. Sets which interface we are communicating via. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Gateway IP | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
Line 1,140: | Line 1,166: | ||
|- | |- | ||
| colspan="2" | Gateway IP address to the Internet, auto populated from the selected interface. | | colspan="2" | Gateway IP address to the Internet, auto populated from the selected interface. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Subnet Mask | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
Line 1,160: | Line 1,190: | ||
|- | |- | ||
| colspan="2" | Network IP subnet mask, auto populated from the selected interface. | | colspan="2" | Network IP subnet mask, auto populated from the selected interface. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | IP Address | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
Line 1,180: | Line 1,214: | ||
|- | |- | ||
| colspan="2" | Network IP address, auto populated from the selected interface. | | colspan="2" | Network IP address, auto populated from the selected interface. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | MAC Address | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-14-icon.png]] | ||
Line 1,210: | Line 1,248: | ||
|- | |- | ||
| colspan="2" | Network MAC address, auto populated from the selected interface. | | colspan="2" | Network MAC address, auto populated from the selected interface. | ||
+ | |- | ||
+ | | width="10%" align="center" style="background-color:#EAE1EA;" | [[File:Fc9-conn-icon.png]] | ||
+ | | width="90%" style="background-color:#EAE1EA; color:#4B008D;" | Notify | ||
+ | |- | ||
|- | |- | ||
| width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | | width="10%" align="center" | [[File:Fc9-type-7-icon.png]] | ||
Line 1,220: | Line 1,262: | ||
|- | |- | ||
| colspan="2" | Sets a target object, to which User.Notify events will be sent when data is sent and received. Events are send with Message ID = this component's handle, Data: 1=Send, 2=Receive. | | colspan="2" | Sets a target object, to which User.Notify events will be sent when data is sent and received. Events are send with Message ID = this component's handle, Data: 1=Send, 2=Receive. | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
|} | |} |
Revision as of 17:51, 9 November 2022
Author | Matrix Ltd. |
Version | 2.2 |
Category | Comms: Networking |
Contents
TCP Template component
Base TCP/IP component with simulation only interface to allow TCP/IP style network communications in simulation. Suitable for inheriting
Component Source Code
Please click here for the component source code: FC_Comp_Source_TCPIP_Base.fcfx
Detailed description
No detailed description exists yet for this component
Examples
Additional examples can be found in the “Apps and Bundles” section of this Wiki:
Wireless LAN Application Guide
Downloadable macro reference
![]() |
SetPropertyVal |
![]() |
Property |
![]() |
Value |
![]() |
Return |
![]() |
SecureWrite |
Attempts to write max number of bytes to the secure socket from the buffer. Returns actual number of bytes written. | |
![]() |
buffer |
![]() |
max |
![]() |
Return |
![]() |
ForcePropEvent |
Allows the property event to be fired, doing things like fetching the correct IP for the network interface. | |
![]() |
Return |
![]() |
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 |
![]() |
SendTo |
Send data to a destination host. Returns the number of bytes sent. | |
![]() |
Data |
Data byte buffer to send | |
![]() |
Count |
Number of bytes to send | |
![]() |
Address |
![]() |
Port |
![]() |
Return |
![]() |
SecureConnect |
Connect securely to host and port. e.g. “www.bbc.co.uk:443” Returns 1 if successful, 0 if not | |
![]() |
host |
Host:Port as string | |
![]() |
Return |
![]() |
GetConsole |
Obtain the console instance for the TCP/IP base. | |
![]() |
Return |
![]() |
Send |
Send data | |
![]() |
Data |
Data byte buffer to send | |
![]() |
Count |
Number of bytes to send | |
![]() |
Return |
![]() |
SecureClose |
Close the secure connection | |
![]() |
Return |
![]() |
TxEnd |
Once the transmit buffer has been filled with data, call this macro to actually send the data. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
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 |
![]() |
GetPropertyVal |
![]() |
Property |
![]() |
Return |
![]() |
SocketClose |
Close the socket | |
![]() |
Return |
![]() |
SecureRead |
Attempts to read max number of bytes from the secure socket into the buffer. Returns actual number of bytes read. | |
![]() |
buffer |
![]() |
max |
![]() |
Return |
![]() |
AcceptOpen |
![]() |
Return |
![]() |
RxDataSize |
This macro is used to detect the size of data collected by the Rx_data_available macro. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Return |
![]() |
AcceptClose |
Close the accept socket | |
![]() |
Return |
![]() |
SecureInit |
Call once to initialise the secure socket funtionality | |
![]() |
Return |
![]() |
GetSocketStatus |
This returns the state of the requested channel's socket. | |
![]() |
Channel |
Specifies the communications channel 0-3 | |
![]() |
Return |