Tdma_client#

group drv_tdma_client

Driver for Time-Division-Multiple-Access fot the DotBot radio.

Author

Said Alvarado-Marin said-alexander.alvarado-marin@inria.fr

Copyright

Inria, 2024-now

Typedefs

typedef void (*tdma_client_cb_t)(uint8_t *packet, uint8_t length)#

Function pointer to the callback function called on packet receive.

Enums

enum db_tdma_registration_state_t#

TDMA internal registrarion state.

Values:

enumerator DB_TDMA_CLIENT_UNREGISTERED#

the DotBot is not registered with the gateway

enumerator DB_TDMA_CLIENT_REGISTERED#

the DotBot registered with the gateway

enum db_tdma_rx_state_t#

TDMA internal RX state.

Values:

enumerator DB_TDMA_CLIENT_RX_WAIT#

the DotBot receiver is OFF

enumerator DB_TDMA_CLIENT_RX_ON#

the DotBot is receiving radio packets

Functions

void db_tdma_client_init(tdma_client_cb_t callback, db_radio_mode_t radio_mode, uint8_t radio_freq, application_type_t default_radio_app)#

Initializes the TDMA scheme.

Starts advertising registration packets, set a default tdma table and inits the radio

Parameters:
  • callback[in] pointer to a function that will be called each time a packet is received.

  • radio_mode[in] BLE mode used by the radio (1MBit, 2MBit, LR125KBit, LR500Kbit)

  • radio_freq[in] Frequency of the radio [0, 100]

  • default_radio_app[in] Which application to use for registration and sync messages

void db_tdma_client_set_table(const tdma_client_table_t *table)#

Updates the RX and TX timings for the TDMA table.

Parameters:
  • table[in] New table of TDMA timings

void db_tdma_client_get_table(tdma_client_table_t *table)#

Get the current RX and TX timings of the TDMA table.

Parameters:
  • table[in] Copy of the current table of TDMA timings

void db_tdma_client_tx(const uint8_t *packet, uint8_t length)#

Queues a single packet to send through the Radio.

Parameters:
  • packet[in] pointer to the array of data to send over the radio

  • length[in] Number of bytes to send

void db_tdma_client_flush(void)#

Ignore TDMA table and send all pending packets immediately.

void db_tdma_client_empty(void)#

Erase all pending packets in the TDMA queue.

db_tdma_registration_state_t db_tdma_client_get_status(void)#

Return the status of the TDMA client. [Registered, Unregistered].

struct tdma_client_table_t#

Data type to store the TDMA table.

Public Members

uint32_t frame_duration#

Duration of the entire TDMA frame [microseconds].

uint32_t rx_start#

Time between the start of the frame and when the gateway starts transmitting.

uint32_t rx_duration#

Duration the gateway will transmit messages.

uint32_t tx_start#

Time between the start of the frame and the start of the DotBot’s alloted frame.

uint32_t tx_duration#

Duration of the DotBot’s alloted frame.