Transmit (TX) Request: IPv4 - 0x20

Description

A TX Request message causes the device to transmit data in IPv4 format. A TX request frame for a new destination creates a network socket. After the network socket is established, data from the network that is received on the socket is sent out the device's serial port in the form of a Receive (RX) Packet frame.

When you specify protocol 4 (TLS), the profile configuration specified by $0 (TLS Profile 0) is used to form the TLS connection.

Note For NB-IoT, TCP support is dependent on the network. Contact your network provider for details.

Format

The following table provides the contents of the frame. For details on frame structure, see API frame format.

Field name Field value Data type Description

Frame type

0x20

Byte

 

Frame ID

 

Byte

Reference identifier used to match status responses. 0 disables the TX Status frame.

Destination address

 

32-bit big endian

 

Destination port

 

16-bit  big endian

 

Source port  

16-bit  big endian

If the source port is 0, the device attempts to send the frame data using an existing open socket with a destination that matches the destination address and destination port fields of this frame. If there is no matching socket, then the device attempts to open a new socket.

If the source port is non-zero, the device attempts to send the frame data using an existing open socket with a source and destination that matches the source port, destination address, and destination port fields of this frame. If there is no matching socket, the TX Status frame returns an error.

Protocol

 

Byte

0 = UDP

1 = TCP

4 = SSL/TLS

Note For NB-IoT, TCP support is dependent on the network. Contact your network provider for details.

Transmit options

 

Byte bitfield

Bit fields are offset 0

Bit field 0 - 7. Bits 0, and 2-7 are reserved, bit 1 is not.

BIT 1 =

1 - Terminate the TCP socket after transmission is complete

0 - Leave the socket open. Closed by timeout, see TM (IP Client Connection Timeout).

Ignore this bit for UDP packets.

All other bits are reserved and should be 0.

Payload

 

Variable

Data to be transferred to the destination, may be up to 1500 bytes.

UDP is limited to 512 bytes.

Field name Field value Data type Description

Frame type

0x20

Byte

 

Frame ID

 

Byte

Reference identifier used to match status responses. 0 disables the TX Status frame.

Destination address

 

32-bit big endian

 

Destination port

 

16-bit  big endian

 

Source port  

16-bit  big endian

If the source port is 0, the device attempts to send the frame data using an existing open socket with a destination that matches the destination address and destination port fields of this frame. If there is no matching socket, then the device attempts to open a new socket.

If the source port is non-zero, the device attempts to send the frame data using an existing open socket with a source and destination that matches the source port, destination address, and destination port fields of this frame. If there is no matching socket, it returns an error.

Protocol

 

Byte

0 = UDP

1 = TCP

Transmit options

 

Byte bitfield

Bit fields are offset 0

Bit field 0 - 7. Bits 0, and 2-7 are reserved, bit 1 is not.

BIT 1 =

1 - Terminate the TCP socket after transmission is complete

0 - Leave the socket open. Closed by timeout, see TM (IP Client Connection Timeout).

Ignore this bit for UDP packets.

All other bits are reserved and should be 0.

Payload

 

Variable

Data to be transferred to the destination, may be up to 1500 bytes.