UWB-Tracking
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TofResponder Class Reference

The TofResponder class represents a TOF responder device. More...

#include <tof-responder.h>

Inheritance diagram for TofResponder:
TofDevice

Public Member Functions

 TofResponder (uwb_addr src, uwb_addr dst, unsigned long wdt_timeout, DynamicJsonDocument *rx_diagnostics)
 Constructor for the TofResponder class. More...
 
 ~TofResponder ()
 
virtual void setup () override
 Initialize and configure the TOF responder device. More...
 
virtual void loop () override
 Main loop of the TOF responder device. More...
 
- Public Member Functions inherited from TofDevice
 TofDevice (uwb_addr src, unsigned long wdt_timeout)
 Constructor for the TofDevice class. More...
 
 ~TofDevice ()
 Destructor for the TofDevice class. More...
 
virtual void setup ()
 Initialize and configure the TOF device. More...
 
void start_wdt ()
 Start the WDT to handle failure events. More...
 
void enable_leds ()
 Enable LEDs for debugging purposes. More...
 
virtual void loop ()
 Main loop of the TOF device. More...
 
char * get_type ()
 Get the type of the TOF device. More...
 

Private Member Functions

void update_rx_diagnostics ()
 updates the value of rx_diagnostics. More...
 

Static Private Member Functions

static void rx_ok_cb (const dwt_cb_data_t *cb_data)
 Static interrupt service routine (ISR) for successful frame reception. More...
 

Private Attributes

uwb_addr dst_address
 The destination address of the initiator. More...
 
uint64_t poll_rx_ts
 Timestamp of poll frame reception. More...
 
uint64_t resp_tx_ts
 Timestamp of response frame transmission. More...
 
DynamicJsonDocument * rx_diagnostics_json
 JSON holding the rx diagnostic information with style like uwb_diagnostic.json. More...
 

Static Private Attributes

static SemaphoreHandle_t responseSemaphore = NULL
 FreeRTOS Semaphore to indicate a active response. More...
 

Additional Inherited Members

- Protected Attributes inherited from TofDevice
Watchdog my_watchdog
 
uwb_addr src_address
 
String type
 
mac_frame_802_15_4_format_t mac_frame
 
uint8_t poll_msg [4] = {'P', 'o', 'l', 'l'}
 
uint8_t resp_msg [16] = {0, 0, 0, 0, 0, 0, 0, 0, 'R', 'e', 's', 'p', 'o', 'n', 's', 'e'}
 
uint8_t rx_buffer [RX_BUF_LEN]
 
uint32_t status_reg
 
dwt_aes_job_t aes_job_tx
 
dwt_aes_job_t aes_job_rx
 
int8_t status
 
dwt_aes_config_t aes_config
 
dwt_config_t config
 
dwt_aes_key_t keys_options [NUM_OF_KEY_OPTIONS]
 

Detailed Description

The TofResponder class represents a TOF responder device.

Constructor & Destructor Documentation

◆ TofResponder()

TofResponder ( uwb_addr  src,
uwb_addr  dst,
unsigned long  wdt_timeout,
DynamicJsonDocument *  rx_diagnostics 
)

Constructor for the TofResponder class.

Parameters
srcThe source address of the responder.
dstThe destination address of the initiator.
wdt_timeoutTime for the Watchdog, wdt triggers reboot.
rx_diagnosticsPointer to a JSON where the uwb diagnostics are stored.

◆ ~TofResponder()

~TofResponder ( )
inline

Member Function Documentation

◆ loop()

void loop ( )
overridevirtual

Main loop of the TOF responder device.

Reimplemented from TofDevice.

◆ rx_ok_cb()

void rx_ok_cb ( const dwt_cb_data_t *  cb_data)
staticprivate

Static interrupt service routine (ISR) for successful frame reception.

Parameters
cb_dataCallback data containing information about the received frame.

◆ setup()

void setup ( )
overridevirtual

Initialize and configure the TOF responder device.

Reimplemented from TofDevice.

◆ update_rx_diagnostics()

void update_rx_diagnostics ( )
private

updates the value of rx_diagnostics.

Member Data Documentation

◆ dst_address

uwb_addr dst_address
private

The destination address of the initiator.

◆ poll_rx_ts

uint64_t poll_rx_ts
private

Timestamp of poll frame reception.

◆ resp_tx_ts

uint64_t resp_tx_ts
private

Timestamp of response frame transmission.

◆ responseSemaphore

SemaphoreHandle_t responseSemaphore = NULL
staticprivate

FreeRTOS Semaphore to indicate a active response.

◆ rx_diagnostics_json

DynamicJsonDocument* rx_diagnostics_json
private

JSON holding the rx diagnostic information with style like uwb_diagnostic.json.


The documentation for this class was generated from the following files: