dwm_backhaul_xfer
Writes downlink data and reads uplink data chunks. The DWM module must be configured as a bridge.
The uplink and the downlink data are encoded into TLV frames and transferred by the SPI interface as described in .
The SPI master tells the slave how many downlink bytes it wants to transfer by downlink_byte_cnt. The downlink_byte_cnt is read by the slave in the first SPI transfer. The slave has some uplink data ready to transfer to the master as it reads the downlink. To transfer both the downlink from the master to the slave and the uplink from the slave to the master, the slave has to calculate how many bytes and SPI transfers are needed. The master reads the number of the bytes and the number of the transfers in the second SPI transfer as it is explained in . Finally, the transfers are executed and both uplink and downlink are transferred. The maximum number of transfers currently supported is 5 with a maximum payload of 253 bytes, which is 255 - size of(TLV header). At most, 5 uplink frames and 2 downlink frames are supported in one call to dwm_backhaul_xfer.
-
void dwm_backhaul_xfer(uint16_t, uint8_t*)
- Parameters
input – downlink_byte_cnt, 2 * [downlink_chunk]
downlink_byte_cnt – ? 16 bit unsigned integer ? (number of downlink data bytes without TLV header, 506 bytes max)
downlink_chunk – ? max 253 bytes ? (opaque data send as downlink to the slave)
output – 5 * [uplink_chunk]
uplink_chunk – ? max 253 bytes ? (opaque data send as uplink to the master)
C code example
Not available for the user application.
UART example
Not available on the UART interface.
SPI example other than Bridge
TLV Request |
||
---|---|---|
Type |
Length |
Value |
0x37 |
0x02 |
downlink_byte_cnt = size of downlink data (244 bytes) |
0xF4 0x00 |
Type 0x37 means command dwm_backhaul_xfer
TLV Response |
||
---|---|---|
Type |
Length |
Value (see error codes) |
0x40 |
0x01 |
0x02 |
SPI example Bridge
TLV Request |
||
---|---|---|
Type |
Length |
Value |
0x37 |
0x02 |
|
0xF4 0x00 |
This call has a variable number of consecutive transfers that follow the TLV Request. See API over SPI interface description..
TLV downlink nr.1,2,3,4,5 |
||
---|---|---|
Type |
Length (244 bytes) |
Value |
0x64 |
0xF4 (244) |
downlink data chunk nr.1 |
0x65 |
0x00 |
empty |
0x66 |
0x00 |
empty |
0x67 |
0x00 |
empty |
0x68 |
0x00 |
empty |
TLV uplink nr.1,2,3,4,5 |
||
---|---|---|
Type |
Length (980 bytes) |
Value |
0x6E |
0xFD (253) |
uplink data chunk nr.1 |
0x6F |
0xFD |
uplink data chunk nr.2 |
0x70 |
0xFD |
uplink data chunk nr.3 |
0x71 |
0xDD (22#. |
uplink data chunk nr.4 |
0x72 |
0x00 |
empty |