udpSend (Function) |
Top Previous Next |
This sends data as a connectionless UDP packet.
Input:
ip : DINT IP address of the peer node (receiver of the data).
port : DINT Port number to send the data to on the peer node.
data : PTR Address of the buffer that contains the data to be sent.
size : INT Number of bytes to send from the buffer. Maximum size is 1540 bytes.
iface : SINT (default 0) The network interface to use. 0 = Default network, 1 = Mobile network, 2 = LAN network, etc. (See Network) Note: For backwards compatibility the Mobile network is used as default network.
Returns: INT Number of bytes that were sent on the socket, or:
Declaration: FUNCTION udpSend : INT; iface : SINT; // Interface to send on
Example: INCLUDE rtcu.inc |