Agora  1.2.0
Agora project
mac_receiver.h
Go to the documentation of this file.
1 
5 #ifndef MAC_RECEIVER_H_
6 #define MAC_RECEIVER_H_
7 
8 #include <thread>
9 
10 #include "config.h"
11 
12 class MacReceiver {
13  public:
14  explicit MacReceiver(Config* const cfg, size_t num_frame_data_bytes,
15  std::string phy_server_address, size_t phy_port,
16  size_t rx_thread_num = 1, size_t core_offset = 1);
17 
18  explicit MacReceiver(Config* const cfg, size_t num_frame_data_bytes,
19  std::string phy_server_address, size_t phy_port,
20  std::string fwd_data_udp_address, size_t fwd_port,
21  size_t rx_thread_num = 1, size_t core_offset = 1);
22 
23  ~MacReceiver() = default;
24 
25  std::vector<std::thread> StartRecv();
26  void* LoopRecv(size_t tid);
27 
28  private:
29  const size_t data_bytes_;
30  const std::string phy_address_;
31  const size_t phy_port_;
32 
33  const bool enable_udp_output_;
34  const size_t udp_dest_port_;
35  const std::string udp_dest_address_;
36 
37  const size_t rx_thread_num_;
38  const size_t core_id_;
39  Config* const cfg_;
40 };
41 
42 #endif // MAC_RECEIVER_H_
MacReceiver::phy_port_
const size_t phy_port_
Definition: mac_receiver.h:31
fmt::v8::detail::byte
byte
Definition: core.h:388
Config::Running
void Running(bool value)
Definition: config.h:33
MacReceiver::core_id_
const size_t core_id_
Definition: mac_receiver.h:38
PinToCoreWithOffset
void PinToCoreWithOffset(ThreadType thread_type, size_t core_offset, size_t thread_id, bool allow_reuse, bool verbose)
Definition: utils.cc:157
MacReceiver::cfg_
Config *const cfg_
Definition: mac_receiver.h:39
SignalHandler::GotExitSignal
static bool GotExitSignal()
Definition: signal_handler.cc:23
mac_receiver.h
Declaration file for the simple mac receiver class.
udp_server.h
Provides the UDPServer functions from the UDPComm class. Receiver only support.
MacReceiver::phy_address_
const std::string phy_address_
Definition: mac_receiver.h:30
signal_handler.h
MacReceiver::~MacReceiver
~MacReceiver()=default
MacReceiver
Definition: mac_receiver.h:12
ThreadType::kWorkerRX
@ kWorkerRX
MacReceiver::StartRecv
std::vector< std::thread > StartRecv()
Definition: mac_receiver.cc:46
MacReceiver::enable_udp_output_
const bool enable_udp_output_
Definition: mac_receiver.h:33
kDebugMacReceiver
static const bool kDebugMacReceiver
Definition: mac_receiver.cc:14
i
for i
Definition: generate_data.m:107
MacReceiver::data_bytes_
const size_t data_bytes_
Definition: mac_receiver.h:29
u
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
kMacTxAddress
static const std::string kMacTxAddress
Definition: mac_receiver.cc:16
kMacTxPort
static constexpr uint16_t kMacTxPort
Definition: mac_receiver.cc:17
MacReceiver::MacReceiver
MacReceiver(Config *const cfg, size_t num_frame_data_bytes, std::string phy_server_address, size_t phy_port, size_t rx_thread_num=1, size_t core_offset=1)
Definition: mac_receiver.cc:19
Config
Definition: config.h:26
AGORA_LOG_INFO
#define AGORA_LOG_INFO(...)
Definition: logger.h:62
std
Definition: json.hpp:5213
config.h
Declaration file for the configuration class which importants json configuration values into class va...
MacReceiver::LoopRecv
void * LoopRecv(size_t tid)
Definition: mac_receiver.cc:58
MacReceiver::udp_dest_address_
const std::string udp_dest_address_
Definition: mac_receiver.h:35
MacReceiver::rx_thread_num_
const size_t rx_thread_num_
Definition: mac_receiver.h:37
MacReceiver::udp_dest_port_
const size_t udp_dest_port_
Definition: mac_receiver.h:34
kSockBufSize
static constexpr size_t kSockBufSize
Definition: channel_sim.cc:26
kMacRxAddress
static const std::string kMacRxAddress
Definition: mac_receiver.cc:15