Difference between revisions of "Component: TCPIP (Raspberry Pi) (Comms: Networking)"

From Flowcode Help
Jump to: navigation, search
(XML import - Pre 8.0 release)
 
(Examples)
 
Line 20: Line 20:
  
 
==Examples==
 
==Examples==
''<span style="color:red;">No additional examples</span>''
 
  
 +
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.
 +
 +
{{Fcfile|NetworkComms-RPI-Client.fcfx|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.
 +
 +
{{Fcfile|NetworkComms-RPI-Server.fcfx|Example RPI HTML Webserver}}
  
 
==Downloadable macro reference==
 
==Downloadable macro reference==

Latest revision as of 15:28, 18 September 2019


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


Contents

[edit] Image TCPIP (Raspberry Pi) component

TCP/IP sockets component for use with Raspberry Pi. Raspberry Pi Only

[edit] 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

[edit] Downloadable macro reference

[edit] 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


[edit] 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


[edit] 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


[edit] 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


[edit] 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


[edit] 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


[edit] SocketClose

Close the socket

Parameters

This macro has no parameters


Return value

This call does not return a value


[edit] AcceptOpen

No additional information


Parameters

This macro has no parameters


Return value

BYTE


[edit] AcceptClose

Close the accept socket

Parameters

This macro has no parameters


Return value

This call does not return a value


[edit] Simulation macro reference

This component does not contain any simulation macros


[edit] Property reference

Label

This property is of type Line of text and can be referenced with the variable name label.

No additional information

Personal tools