leaps_bh_xfer

Writes downlink data and reads uplink data chunks. The module must be configured as a bridge node.

Both the uplink and the downlink data are encoded into the tlv frames when transferred by SPI interface as described in multiple TVL over SPI.

SPI master tells slave how many downlink bytes it wants to transfer by downlink_byte_cnt. The downlink_byte_cnt is read by slave in the first SPI transfer. Slave has some uplink data ready that it wants to transfer to the master as it is reading 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 how many SPI transfers are needed. The master reads the number of the bytes and the number of the transfers in the second SPI transfer, as explained in multiple TVL over SPI. Finally, the transfers are executed, and uplink and downlink are transferred. A 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 at most 2 downlink frames are supported in one call to leaps_bh_xfer.


Input
  • downlink_byte_cnt: ? 16 bit unsigned integer ? (number of downlink data bytes without TLV header, 506 bytes max)

Output
  • 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)


UART example

Not available on the UART interface.

SPI example other than Bridge

TLV Request

Type

Length

Value

downlink_byte_cnt = size of downlink data (244 bytes)

0x37

0x02

0xF4 0x00

Type 0x37 means command leaps_bh_xfer

TLV response

Type

Length

Value

0x40

0x01

0x02

SPI example Bridge

Downlink bytes count: 244
Uplink bytes count: 980

TLV request

Type

Length

Value downlink_byte_cnt = size of downlink data (244 bytes)

0x37

0x02

0xF4 0x00

Type 0x37 means command leaps_bh_xfer

This call has a variable number of consecutive transfers, which follows 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)

down link 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 (221)

uplink data chunk nr.4

0x72

0x00

empty

Type 0x64 means downlink data chunk nr.1
Type 0x65 means downlink data chunk nr.2
Type 0x68 means downlink data chunk nr.5
Type 0x6E means uplink data chunk nr.1
Type 0x6F means uplink data chunk nr.2
Type 0x72 means uplink data chunk nr.5

BH Transfer over USB

BH data transfer over USB is different from that over SPI. SPI data transfer is based on interrupt, but the interrupt line would not be available for a USB connection between LEAPS RTLS device and PC, so instead of using the request-response approach with TLV_TYPE_CMD_BH_XFER TLV command, for the USB interface, LEAPS RTLS device would actively send notifications (TLV_TYPE_NOTIF_STATUS, TLV_TYPE_NOTIF_BH_STATUS) and uplink data chunks to bridge master (PC). The notifications and uplink data could be enabled/disabled, similar to interrupts using leaps_int_cfg_set