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

The TofInitiator class represents a Time-of-Flight (TOF) initiator device. More...

#include <tof-initiator.h>

Inheritance diagram for TofInitiator:
TofDevice

Public Member Functions

 TofInitiator (uwb_addr src, uwb_addr *dst, unsigned long wdt_timeout, uint8_t num_of_responders)
 Constructor for the TofInitiator class. More...
 
 ~TofInitiator ()
 Destructor for the TofInitiator class. More...
 
virtual void setup () override
 Initialize and configure the TOF initiator device. More...
 
virtual void loop () override
 Main loop of the TOF initiator 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 send_tof_request (uwb_addr dest)
 Send a TOF request to a specific destination address. More...
 
void process_tof_response ()
 Process the TOF response received from a responder. The calculated distance is stored into temp_distance. More...
 

Private Attributes

uint32_t frame_cnt
 
uint8_t seq_cnt
 
uint8_t nonce [13]
 
uwb_addrdst_address
 
uint8_t total_responders
 
uint8_t current_responder
 
double tof
 
double temp_distance
 

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 TofInitiator class represents a Time-of-Flight (TOF) initiator device.

Constructor & Destructor Documentation

◆ TofInitiator()

TofInitiator ( uwb_addr  src,
uwb_addr dst,
unsigned long  wdt_timeout,
uint8_t  num_of_responders 
)

Constructor for the TofInitiator class.

Parameters
srcThe source address for the TOF initiator.
dstAn array of destination addresses for the responders.
wdt_timeoutTimeout for the Watchdog, wdt triggers reboot.
num_of_respondersThe number of responder devices.

◆ ~TofInitiator()

~TofInitiator ( )
inline

Destructor for the TofInitiator class.

Member Function Documentation

◆ loop()

void loop ( )
overridevirtual

Main loop of the TOF initiator device.

Reimplemented from TofDevice.

◆ process_tof_response()

void process_tof_response ( )
private

Process the TOF response received from a responder. The calculated distance is stored into temp_distance.

◆ send_tof_request()

void send_tof_request ( uwb_addr  dest)
private

Send a TOF request to a specific destination address.

Parameters
destThe destination address of the responder.

◆ setup()

void setup ( )
overridevirtual

Initialize and configure the TOF initiator device.

Reimplemented from TofDevice.

Member Data Documentation

◆ current_responder

uint8_t current_responder
private

◆ dst_address

uwb_addr* dst_address
private

◆ frame_cnt

uint32_t frame_cnt
private

◆ nonce

uint8_t nonce[13]
private

◆ seq_cnt

uint8_t seq_cnt
private

◆ temp_distance

double temp_distance
private

◆ tof

double tof
private

◆ total_responders

uint8_t total_responders
private

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