Component: TCPIP (Raspberry Pi) (Comms: Networking)

From Flowcode Help
Jump to navigationJump to search


Author Matrix Ltd.
Version 1.8 (Release)
Category Comms: Networking


Image 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.

FC6 Icon.png 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.

FC6 Icon.png Example RPI HTML Webserver

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

BYTE


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

UINT


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

UINT


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

UINT


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

BYTE


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

BYTE


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

BYTE


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