Uplink packet format. LoRaWAN ports 10, 170. Confirmed or unconfirmed data frame for LoRaWAN:

byte position, length
name
description
0, n
binary
proprietary binary data. Typically n=0 (absent)
n, 4
magic word (header v1)
first byte - {'r', 't', 'l', 's'}; //0x72 0x74 0x6c 0x73
n+4, 1
protocol id (header v1)
should be 1 for header v1 protocol version
n+5, 1
sb_len (header v1)
sensor block data length
n+6, x
sensor block data, x bytes length
CBOR encoded data of rtls sensor block (see "CBOR Sensors encoding")
n+6+x,  ybinary 
proprietary binary data trail. Typically y=0 (absent)





COAP protocol format. LoRaWAN ports 171, 172. Always send as confirmed data frame for LoRaWAN:

byte position, length
name
description
0, n
binary
COAP protocol data. Functionality may be limited compared to other data channels (ethernet, uwb). See specific pages.