Component: TCPIP (Raspberry Pi) (Comms: Networking)
Author | Matrix Ltd. |
Version | 1.8 (Release) |
Category | Comms: Networking |
Contents
TCPIP (Raspberry Pi) component
TCP/IP sockets component for use with Raspberry Pi. Raspberry Pi Only
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.
Downloadable macro reference
Connect
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.
Parameters
- <- STRING Address
- Remote destination address
- This parameter may be returned back to the caller
- UINT Port
- Remote destination port
Return value
Receive
Receive data into the data buffer.
Returns the number of bytes received
Parameters
- <- STRING Data
- Data byte buffer to receive the data
- This parameter may be returned back to the caller
- UINT Count
- Maximum number of bytes to read
Return value
SendTo
Send data to a destination host.
Returns the number of bytes sent.
Parameters
- <- STRING Data
- Data byte buffer to send
- This parameter may be returned back to the caller
- UINT Count
- Number of bytes to send
- <- STRING Address
- This parameter may be returned back to the caller
- UINT Port
Return value
Send
Send data
Parameters
- <- STRING Data
- Data byte buffer to send
- This parameter may be returned back to the caller
- UINT Count
- Number of bytes to send
Return value
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.
Parameters
- UINT Port
Return value
SocketOpen
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.
Parameters
- BYTE Type
- Type of socket to create
Return value
SocketClose
Close the socket
Parameters
- This macro has no parameters
Return value
- This call does not return a value
AcceptOpen
No additional information
Parameters
- This macro has no parameters
Return value
AcceptClose
Close the accept socket
Parameters
- This macro has no parameters
Return value
- This call does not return a value
Simulation macro reference
This component does not contain any simulation macros
Property reference
Label
This property is of type Line of text and can be referenced with the variable name label.
No additional information