Agora  1.2.0
Agora project
TxRxWorkerClientHw Class Reference

#include <txrx_worker_client_hw.h>

Inheritance diagram for TxRxWorkerClientHw:
Collaboration diagram for TxRxWorkerClientHw:

Public Member Functions

 TxRxWorkerClientHw (size_t core_offset, size_t tid, size_t interface_count, size_t interface_offset, Config *const config, size_t *rx_frame_start, moodycamel::ConcurrentQueue< EventData > *event_notify_q, moodycamel::ConcurrentQueue< EventData > *tx_pending_q, moodycamel::ProducerToken &tx_producer, moodycamel::ProducerToken &notify_producer, std::vector< RxPacket > &rx_memory, std::byte *const tx_memory, std::mutex &sync_mutex, std::condition_variable &sync_cond, std::atomic< bool > &can_proceed, ClientRadioConfig &radio_config)
 
 TxRxWorkerClientHw ()=delete
 
 ~TxRxWorkerClientHw () final
 
void DoTxRx () final
 
- Public Member Functions inherited from TxRxWorker
 TxRxWorker (size_t core_offset, size_t tid, size_t interface_count, size_t interface_offset, size_t channels_per_interface, Config *const config, size_t *rx_frame_start, moodycamel::ConcurrentQueue< EventData > *event_notify_q, moodycamel::ConcurrentQueue< EventData > *tx_pending_q, moodycamel::ProducerToken &tx_producer, moodycamel::ProducerToken &notify_producer, std::vector< RxPacket > &rx_memory, std::byte *const tx_memory, std::mutex &sync_mutex, std::condition_variable &sync_cond, std::atomic< bool > &can_proceed)
 
 TxRxWorker ()=delete
 
virtual ~TxRxWorker ()
 
virtual void Start ()
 
virtual void Stop ()
 
size_t Id () const
 
bool Started () const
 
bool Running () const
 

Private Member Functions

size_t DoTx (const long long time0)
 
std::vector< Packet * > DoRx (size_t interface_id, size_t &global_frame_id, size_t &global_symbol_id, long long &receive_time, ssize_t &sample_offset)
 
ssize_t SyncBeacon (size_t local_interface, size_t sample_window)
 
ssize_t FindSyncBeacon (const std::complex< int16_t > *check_data, size_t sample_window, float corr_scale=1.f)
 
void AdjustRx (size_t local_interface, size_t discard_samples)
 
bool IsRxSymbol (size_t symbol_id)
 
void TxUplinkSymbols (size_t radio_id, size_t frame_id, long long time0)
 
void TxPilot (size_t pilot_ant, size_t frame_id, long long time0)
 
bool IsTxSymbolNext (size_t radio_id, size_t current_symbol)
 
Radio::TxFlags GetTxFlags (size_t radio_id, size_t tx_symbol_id)
 
void WaitDetectBeacon (size_t local_interface)
 
long long EstablishTime0 (size_t local_interface)
 
bool DoResync (const std::vector< Packet * > &check_pkts, ssize_t &adjust_samples)
 
bool ResyncOnBeacon (size_t frame_id, size_t frame_sync_period, const std::vector< Packet * > &beacon_pkts, ssize_t &adjust_samples)
 
void InitRxStatus ()
 
void ResetRxStatus (size_t interface, bool reuse_memory)
 

Private Attributes

ClientRadioConfigradio_
 
size_t program_start_ticks_
 
std::vector< std::vector< std::complex< int16_t > > > frame_zeros_
 
std::vector< std::vector< std::complex< int16_t > > > frame_storage_
 
std::vector< RxPacketrx_frame_pkts_
 
std::vector< RxPacket * > rx_pkts_ptrs_
 
bool attempt_resync_ = false
 
size_t resync_success_cnt_ = 0
 
size_t resync_retry_cnt_ = 0
 
std::vector< TxRxWorkerRx::RxStatusTrackerrx_status_
 

Additional Inherited Members

- Static Public Attributes inherited from TxRxWorker
static constexpr bool kDebugTxMemory = false
 
- Protected Member Functions inherited from TxRxWorker
void WaitSync ()
 Using a latch might be better but adds c++20 requirement. More...
 
ConfigConfiguration ()
 
bool NotifyComplete (const EventData &complete_event)
 
std::vector< EventDataGetPendingTxEvents (size_t max_events=0)
 
RxPacketGetRxPacket ()
 
void ReturnRxPacket (RxPacket &unused_packet)
 
PacketGetTxPacket (size_t frame, size_t symbol, size_t ant)
 
PacketGetUlTxPacket (size_t frame, size_t symbol, size_t ant)
 
- Protected Attributes inherited from TxRxWorker
const size_t tid_
 
const size_t core_offset_
 
const size_t num_interfaces_
 
const size_t interface_offset_
 
const size_t channels_per_interface_
 
size_t *const rx_frame_start_
 
bool running_
 
std::mutex & mutex_
 Owned by the parent TxRx object for sync. More...
 
std::condition_variable & cond_
 
std::atomic< bool > & can_proceed_
 

Constructor & Destructor Documentation

◆ TxRxWorkerClientHw() [1/2]

TxRxWorkerClientHw::TxRxWorkerClientHw ( size_t  core_offset,
size_t  tid,
size_t  interface_count,
size_t  interface_offset,
Config *const  config,
size_t *  rx_frame_start,
moodycamel::ConcurrentQueue< EventData > *  event_notify_q,
moodycamel::ConcurrentQueue< EventData > *  tx_pending_q,
moodycamel::ProducerToken tx_producer,
moodycamel::ProducerToken notify_producer,
std::vector< RxPacket > &  rx_memory,
std::byte *const  tx_memory,
std::mutex &  sync_mutex,
std::condition_variable &  sync_cond,
std::atomic< bool > &  can_proceed,
ClientRadioConfig radio_config 
)
Here is the call graph for this function:

◆ TxRxWorkerClientHw() [2/2]

TxRxWorkerClientHw::TxRxWorkerClientHw ( )
delete

◆ ~TxRxWorkerClientHw()

TxRxWorkerClientHw::~TxRxWorkerClientHw ( )
finaldefault

Member Function Documentation

◆ AdjustRx()

void TxRxWorkerClientHw::AdjustRx ( size_t  local_interface,
size_t  discard_samples 
)
private
Todo:
for the multi radio case should let this return if not enough data is found This function blocks untill all the discard_samples are received for a given local_interface
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoResync()

bool TxRxWorkerClientHw::DoResync ( const std::vector< Packet * > &  check_pkts,
ssize_t &  adjust_samples 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoRx()

std::vector< Packet * > TxRxWorkerClientHw::DoRx ( size_t  interface_id,
size_t &  global_frame_id,
size_t &  global_symbol_id,
long long &  receive_time,
ssize_t &  sample_offset 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTx()

size_t TxRxWorkerClientHw::DoTx ( const long long  time0)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoTxRx()

void TxRxWorkerClientHw::DoTxRx ( )
finalvirtual
Todo:
make sure we are "real time"

Implements TxRxWorker.

Here is the call graph for this function:

◆ EstablishTime0()

long long TxRxWorkerClientHw::EstablishTime0 ( size_t  local_interface)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindSyncBeacon()

ssize_t TxRxWorkerClientHw::FindSyncBeacon ( const std::complex< int16_t > *  check_data,
size_t  sample_window,
float  corr_scale = 1.f 
)
private
Todo:
Remove this float conversion to speed up function
Here is the call graph for this function:
Here is the caller graph for this function:

◆ GetTxFlags()

Radio::TxFlags TxRxWorkerClientHw::GetTxFlags ( size_t  radio_id,
size_t  tx_symbol_id 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ InitRxStatus()

void TxRxWorkerClientHw::InitRxStatus ( )
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsRxSymbol()

bool TxRxWorkerClientHw::IsRxSymbol ( size_t  symbol_id)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsTxSymbolNext()

bool TxRxWorkerClientHw::IsTxSymbolNext ( size_t  radio_id,
size_t  current_symbol 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResetRxStatus()

void TxRxWorkerClientHw::ResetRxStatus ( size_t  interface,
bool  reuse_memory 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ResyncOnBeacon()

bool TxRxWorkerClientHw::ResyncOnBeacon ( size_t  frame_id,
size_t  frame_sync_period,
const std::vector< Packet * > &  beacon_pkts,
ssize_t &  adjust_samples 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ SyncBeacon()

ssize_t TxRxWorkerClientHw::SyncBeacon ( size_t  local_interface,
size_t  sample_window 
)
private
Todo:
for the multi radio case should let this return if not enough data is found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TxPilot()

void TxRxWorkerClientHw::TxPilot ( size_t  pilot_ant,
size_t  frame_id,
long long  time0 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ TxUplinkSymbols()

void TxRxWorkerClientHw::TxUplinkSymbols ( size_t  radio_id,
size_t  frame_id,
long long  time0 
)
private
Here is the call graph for this function:
Here is the caller graph for this function:

◆ WaitDetectBeacon()

void TxRxWorkerClientHw::WaitDetectBeacon ( size_t  local_interface)
private
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ attempt_resync_

bool TxRxWorkerClientHw::attempt_resync_ = false
private

◆ frame_storage_

std::vector<std::vector<std::complex<int16_t> > > TxRxWorkerClientHw::frame_storage_
private

◆ frame_zeros_

std::vector<std::vector<std::complex<int16_t> > > TxRxWorkerClientHw::frame_zeros_
private

◆ program_start_ticks_

size_t TxRxWorkerClientHw::program_start_ticks_
private

◆ radio_

ClientRadioConfig& TxRxWorkerClientHw::radio_
private

◆ resync_retry_cnt_

size_t TxRxWorkerClientHw::resync_retry_cnt_ = 0
private

◆ resync_success_cnt_

size_t TxRxWorkerClientHw::resync_success_cnt_ = 0
private

◆ rx_frame_pkts_

std::vector<RxPacket> TxRxWorkerClientHw::rx_frame_pkts_
private

◆ rx_pkts_ptrs_

std::vector<RxPacket*> TxRxWorkerClientHw::rx_pkts_ptrs_
private

◆ rx_status_

std::vector<TxRxWorkerRx::RxStatusTracker> TxRxWorkerClientHw::rx_status_
private

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