
-60-
v4.9
TCP and UDP connections
For receive data Waspmote must execute the function
manageIncomingData()
. This function executes the proper functions
and returns a number with the type of data. For IP data this function returns ‘3’. The IP address of the sender is stored in
IP_dir
and the data in
buffer_3G
. For more information about the function
manageIncomingData()
, see the description of the
function at this guide.
11.7.5. Disconnecting a client
The function
closeClient()
closes an active client.
Example of use:
{
// Opens the client number 2:
_3G.closeClient(2);
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with IP error code available
11.7.6. Closing the server
To close the TCP server the function
closeSocket()
must be used. This function doesn’t need parameters.
Example of use:
{
// Closes the TCP server:
_3G.closeSocket();
}
This function returns:
•
‘1’ on success
•
‘0’ if error
•
‘-2’ if error with IP error code available