Digi International Inc XB3C1 Manuel D’Utilisation

Page de 146
Socket behavior
API mode behavior for outgoing TCP and SSL connections
Digi XBee3 Cellular LTE Cat 1 Smart Modem User Guide
134
1. Set
to Transparent Mode [0].
2. Set
to the value of the TCP port that the device listens on.
3. Click the Write button
.
API mode behavior for outgoing TCP and SSL connections
To initiate an outgoing TCP or SSL connection to a remote host, send a
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
.
The device sends a
frame in reply to the Transmit TX Request indicating
the status of the request. A status of indicates the connection and/or data was successful and a
non-zero value indicates a failure.
Any data received on the connection is sent out the XBee Smart Modem's serial port as a Receive RX
frame.
A connection is closed when:
n
The remote end closes the connection.
n
No data is sent or received for longer than the socket timeout set by
n
A Transmit TX Request is sent with the CLOSE flag set.
API mode behavior for outgoing UDP data
To send a UDP datagram to a remote host, send a
frame to the
XBee Smart Modem's serial port specifying the destination address and destination port of the
remote host. If you use a source port of 0, the device creates a new socket for the purpose of sending
to the remote host. The XBee Smart Modem supports a finite number of sockets, so if you need to
send to many destinations:
1. The socket must be closed after use.
or
2. You must use the socket specified by the
setting.
To use the socket specified by the C0 setting, in the Transmit TX request frame use a source port that
matches the value configured for the C0 setting.
The device sends a
frame in reply to the Transmit TX Request to indicate
the status of the request. A status of indicates the data was successfully sent out of the device and
a non-zero value indicates a failure.
Any data received on the UDP socket is sent out the XBee Smart Modem's serial port as a
frame.
A UDP socket is closed when:
n
No data has been sent or received for longer than the socket timeout set by
n
A transmit TX Request is sent with the CLOSE flag set.