#include <uwranging_tdoa.h>
Class that represents a UwRangingTDOA Node
◆ UwRangingTDOA()
| UwRangingTDOA::UwRangingTDOA |
( |
| ) |
|
Constructor of the UwRangingTDOA class
References ber, debug_tdoa, delay_start, dist_num, entries_mat, entries_timestamps, entry_last_tx, last_ids, mac2phy_delay, max_tt, n_nodes, PKTIDMAX, poisson_traffic, range_entries, range_period, soundspeed, time_of_flights, times_mat, and tof_map.
◆ ~UwRangingTDOA()
| virtual UwRangingTDOA::~UwRangingTDOA |
( |
| ) |
|
|
virtualdefault |
◆ calcOptEntries()
| int UwRangingTDOA::calcOptEntries |
( |
std::vector< int > * |
sorted_entries = nullptr | ) |
const |
|
protectedvirtual |
◆ command()
| int UwRangingTDOA::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
overridevirtual |
TCL command interpreter. It implements the following OTcl methods:
- Parameters
-
| argc | Number of arguments in argv. |
| argv | Array of strings which are the command parameters |
- Returns
- TCL_OK or TCL_ERROR
References calcOptEntries(), full_pkt_tx_dur, n_nodes, node_id, phy_id, range_bytes_sent, range_pkts_err, range_pkts_recv, range_pkts_sent, rangeTX(), saved_entries, start(), stop(), time_of_flights, and tof_map.
◆ entryWeight()
| double UwRangingTDOA::entryWeight |
( |
int |
entry, |
|
|
int |
pkt_size, |
|
|
int |
mode |
|
) |
| const |
|
protectedvirtual |
Compute the weight of the entry given the packet size in bits.
- Parameters
-
| int | n-th entries. |
| int | size of the n-th entries in bit |
| int | mode to use to compute the optimal number of entries |
References ber, and entry_last_tx.
Referenced by calcOptEntries().
◆ isValid() [1/2]
| bool UwRangingTDOA::isValid |
( |
const tdoa_entry & |
entry | ) |
const |
|
protectedvirtual |
◆ isValid() [2/2]
| bool UwRangingTDOA::isValid |
( |
double |
value | ) |
const |
|
protectedvirtual |
Check if value is not negative.
- Parameters
-
- Returns
- true if valid, false otherwise
Referenced by rangeRX(), and rangeTX().
◆ rangeRX()
| void UwRangingTDOA::rangeRX |
( |
const Packet * |
p | ) |
|
|
protectedvirtual |
References entries_mat, entries_timestamps, isValid(), last_ids, mac2phy_delay, max_age, max_tt, n_nodes, node_id, hdr_ranging_tdoa::source_node_id, hdr_ranging_tdoa::source_pkt_id, time_of_flights, times_mat, hdr_ranging_tdoa::times_size(), and tof_map.
Referenced by recvSyncClMsg().
◆ rangeTX()
| void UwRangingTDOA::rangeTX |
( |
| ) |
|
|
protectedvirtual |
Send a ranging message down to the MAC layer.
References calcOptEntries(), entries_mat, hdr_ranging_tdoa::getSize(), isValid(), last_ids, n_nodes, node_id, packet_id, PKTIDMAX, PT_UWRANGING_TDOA, queue_size, range_period, saved_entries, hdr_ranging_tdoa::source_node_id, hdr_ranging_tdoa::source_pkt_id, times_mat, hdr_ranging_tdoa::times_size_, and tx_timestamp.
Referenced by command(), and throttleTX().
◆ recv() [1/2]
| void UwRangingTDOA::recv |
( |
Packet * |
p | ) |
|
|
overridevirtual |
Performs the reception of packets from upper and lower layers.
- Parameters
-
| Packet* | Pointer to the packet will be received. |
References PT_UWRANGING_TDOA.
Referenced by recv().
◆ recv() [2/2]
| void UwRangingTDOA::recv |
( |
Packet * |
p, |
|
|
Handler * |
h |
|
) |
| |
|
overridevirtual |
Performs the reception of packets from upper and lower layers.
- Parameters
-
| Packet* | Pointer to the packet will be received. |
| Handler* | Handler. |
References recv().
◆ recvSyncClMsg()
| int UwRangingTDOA::recvSyncClMsg |
( |
ClMessage * |
m | ) |
|
|
overridevirtual |
Retrieve packets from other modules
- Parameters
-
References ber, CLMSG_TAP_PKT, CLMSG_TRIGGER_STATS, ClMsgTapPkt::clmsg_type, END_RX, UwPhysicalStats::last_ber, phy_id, ClMsgTapPkt::pkt, PT_UWRANGING_TDOA, range_entries, range_pkts_err, range_pkts_recv, rangeRX(), hdr_ranging_tdoa::source_node_id, hdr_ranging_tdoa::source_pkt_id, START_TX, StatsEnum::STATS_PHY_LAYER, ClMsgTapPkt::tx_duration, and updateHoldoverTime().
◆ start()
| void UwRangingTDOA::start |
( |
| ) |
|
|
virtual |
◆ stop()
| void UwRangingTDOA::stop |
( |
| ) |
|
|
virtual |
◆ throttleTX()
| void UwRangingTDOA::throttleTX |
( |
| ) |
|
|
protectedvirtual |
◆ updateHoldoverTime()
| void UwRangingTDOA::updateHoldoverTime |
( |
Packet * |
p, |
|
|
double |
tx_duration |
|
) |
| |
|
protectedvirtual |
Update the holdover time with the actual time of transmission.
- Parameters
-
| Packet* | Pointer to the packet received. |
| double | Transmission duration computed by the physical layer. |
References entries_mat, entry_last_tx, full_pkt_tx_dur, hdr_ranging_tdoa::getSize(), mac2phy_delay, n_nodes, node_id, queue_size, range_bytes_sent, range_pkts_sent, hdr_ranging_tdoa::source_pkt_id, times_mat, hdr_ranging_tdoa::times_size(), and tx_timestamp.
Referenced by recvSyncClMsg().
◆ UwRangeTimer
◆ ber
| std::vector<double> UwRangingTDOA::ber |
|
protected |
◆ debug_tdoa
| int UwRangingTDOA::debug_tdoa |
|
protected |
◆ delay_start
| double UwRangingTDOA::delay_start |
|
protected |
◆ dist_num
| int UwRangingTDOA::dist_num |
|
protected |
◆ entries_mat
| std::vector<std::vector<std::vector<tdoa_entry> > > UwRangingTDOA::entries_mat |
|
protected |
◆ entries_timestamps
| std::vector<double> UwRangingTDOA::entries_timestamps |
|
protected |
◆ entry_last_tx
| std::vector<double> UwRangingTDOA::entry_last_tx |
|
protected |
◆ full_pkt_tx_dur
| double UwRangingTDOA::full_pkt_tx_dur |
|
protected |
◆ last_ids
| std::vector<int> UwRangingTDOA::last_ids |
|
protected |
◆ mac2phy_delay
| double UwRangingTDOA::mac2phy_delay |
|
protected |
◆ max_age
| double UwRangingTDOA::max_age |
|
protected |
Max age of a ranging packet in seconds.
Referenced by rangeRX().
◆ max_tt
| double UwRangingTDOA::max_tt |
|
protected |
Floating numbers within this value won't be discarded by NNLS. Max travel time between nodes in seconds.
Referenced by rangeRX(), and UwRangingTDOA().
◆ n_nodes
| int UwRangingTDOA::n_nodes |
|
protected |
◆ node_id
| int UwRangingTDOA::node_id |
|
protected |
◆ packet_id
| int UwRangingTDOA::packet_id |
|
protected |
id of the last ranging packet sent (= node_id + k*n_nodes)
Referenced by rangeTX().
◆ phy_id
| int UwRangingTDOA::phy_id |
|
protected |
◆ PKTIDMAX
| const size_t UwRangingTDOA::PKTIDMAX |
|
protected |
Initial value:= std::numeric_limits<uwrange_pkt_t>::
max()
Max number of ranging packets that can be saved.
Referenced by rangeTX(), and UwRangingTDOA().
◆ poisson_traffic
| int UwRangingTDOA::poisson_traffic |
|
protected |
If true the ranging packets are sent according to a poisson process with rate range_period.
Referenced by throttleTX(), and UwRangingTDOA().
◆ queue_size
| int UwRangingTDOA::queue_size |
|
protected |
◆ range_bytes_sent
| int UwRangingTDOA::range_bytes_sent |
|
protected |
◆ range_entries
| int UwRangingTDOA::range_entries |
|
protected |
◆ range_period
| double UwRangingTDOA::range_period |
|
protected |
◆ range_pkts_err
| int UwRangingTDOA::range_pkts_err |
|
protected |
◆ range_pkts_recv
| int UwRangingTDOA::range_pkts_recv |
|
protected |
◆ range_pkts_sent
| int UwRangingTDOA::range_pkts_sent |
|
protected |
◆ saved_entries
| int UwRangingTDOA::saved_entries |
|
protected |
Total number of entries not sent in the ranging packets.
Referenced by command(), and rangeTX().
◆ scheduler_active
| bool UwRangingTDOA::scheduler_active |
|
protected |
◆ send_timer
◆ soundspeed
| double UwRangingTDOA::soundspeed |
|
protected |
◆ time_of_flights
| std::vector<double> UwRangingTDOA::time_of_flights |
|
protected |
◆ times_mat
| std::vector<std::vector<double> > UwRangingTDOA::times_mat |
|
protected |
◆ tof_map
| std::vector<std::vector<int> > UwRangingTDOA::tof_map |
|
protected |
◆ tx_timestamp
The documentation for this class was generated from the following files: