-33-
v7.3
Software
Related variables:
_4G.socketInfo[socketId].id
→
Socket identifier
_4G.socketInfo[socketId].sent
→
Total number of bytes sent since the socket was opened
_4G.socketInfo[socketId].received
→
Total number of bytes received
_4G.socketInfo[socketId].size
→
Total number of pending bytes to read
_4G.socketInfo[socketId].ack
→
Total number of bytes sent and not yet acknowledged
4.10.3. Socket status structure
The
SocketStatus_t
structure stores the status for all sockets. For each one of the connections, the status
structure includes:
•
Socket identifier
•
Current socket status. The API defines several constants to describe it:
-
Wasp4G::STATUS_CLOSED
-
Wasp4G::STATUS_ACTIVE
-
Wasp4G::STATUS_SUSPENDED
-
Wasp4G::STATUS_SUSPENDED_DATA
-
Wasp4G::STATUS_LISTENING
-
Wasp4G::STATUS_INCOMING
-
Wasp4G::STATUS_OPENING
•
Local IP address
•
Local port
•
Remote IP address
•
Remote port
As it is possible to have up to 6 simultaneous connections, the global variable is defined as follows:
SocketStatus_t socketStatus[6];
The definition of the structure is:
struct SocketStatus_t
{
uint8_t
id;
uint8_t
state;
char localIp[16];
uint16_t
localPort;
char remoteIp[16];
uint16_t
remotePort;
};
The
getSocketStatus()
function allows the user to update the socket status structure from the 4G module. It is
mandatory to indicate the identifier of the socket to be updated. It is possible to update all socket status by calling
the
getAllSocketStatus()
function which is faster than iterating through all different identifiers.
Example of use:
{
uint8_t socketId = Wasp4G::CONNECTION_1;
_4G.getSocketStatus(socketId);
}
Related variables:
Содержание LE910
Страница 1: ...Waspmote 4G Networking Guide ...