EasyManua.ls Logo

Digi XBee3 - Socket Behavior; Supported Sockets; Socket Timeouts; Socket Limits in API Mode

Digi XBee3
172 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Socket behavior Supported sockets
Digi XBee3 Cellular LTE-M Global Smart Modem User Guide
95
Supported sockets
The XBee Smart Modem supports the following number of sockets:
n 6 maximum:4 SSL sockets maximum.
1
Socket timeouts
The XBee Smart Modem implicitly opens the socket any time there is data to be sent, and closes it
according to the timeout settings. The TM (IP Client Connection Timeout) command controls the
timeout settings.
Socket limits in API mode
There are a fixed number of sockets that can be created which varies by device variant and protocol.
When a Transmit (TX) Request: IPv4 - 0x20 frame is sent to the XBee Smart Modem for a new
destination, it creates a new socket. The exception to this is when using the UDP protocol with the C0
source port, which allows unlimited destinations on the socket created by C0 (Source Port).
If no more sockets are available, the device sends back a Transmit (TX) Status - 0x89 frame with a
Resource Error.
The Resource Error resolves when an existing socket is closed.
An existing socket may be closed when the socket times out (see TM (IP Client Connection Timeout)
and TS (IP Server Connection Timeout)) or when the socket is closed via a TX request with the CLOSE
flag set.
Enable incoming TCP sockets in API mode
In API mode, you can enable incoming connections to the XBee Smart Modem.
1. To enable listening, set C0 (Source Port) to the value of the listening port.
2. To use TCP for client and server socket connections, set IP (IP Protocol) to 0x01.
The listener allows multiple clients (incoming connections), up to the limit of the maximum number of
sockets on the system.
When the XBee Smart Modem receives RF data on the port defined by C0, you get a Receive (RX)
Packet: IPv4 - 0xB0 with the incoming address and port.
If you want to communicate back to the incoming connection, use the Transmit (TX) Request: IPv4 -
0x20 and enter the received address and port as the destination address and port, along with the
listening (C0) local source port.
API mode behavior for outgoing TCP and SSL connections
To initiate an outgoing TCP or SSL connection to a remote host, send a Transmit (TX) Request: IPv4 -
0x20 frame to the XBee Smart Modem's serial port specifying the destination address and destination
port for the remote host; the data is optional and the source port is 0.
If the connection is disconnected at any time, send a Transmit TX Request frame to trigger a new
connection attempt.
To send data over this connection use the Transmit (TX) Request: IPv4 - 0x20.
1
1 TCP socket is used for Remote Manager, so if you have Remote Manager enabled, subtract 1 socket from the
values above.

Table of Contents

Related product manuals