Agora
1.2.0
Agora project
|
Go to the documentation of this file.
5 #ifndef RADIO_SOCKET_H_
6 #define RADIO_SOCKET_H_
26 void Create(
size_t samples_per_symbol,
const std::string& local_addr,
27 const std::string& remote_addr,
const std::string& local_port,
28 const std::string& remote_port);
30 inline const std::string&
Port()
const {
return socket_->Port(); };
32 int RxSamples(std::vector<void*>& out_data,
long long& rx_time_ns,
33 size_t req_samples_per_channel);
39 long long& rx_time_ticks,
size_t& burst_count)
const;
40 size_t UnpackSamples(std::vector<void*>& out_samples,
size_t req_samples,
44 const std::complex<int16_t>* in_samples,
45 size_t num_in_samples);
48 size_t req_total_samples);
51 size_t sample_offset,
size_t req_samples);
67 #endif // RADIO_SOCKET_H_
size_t InspectRx(const std::byte *in_data, size_t in_count, long long &rx_time_ticks, size_t &burst_count) const
Definition: radio_socket.cc:497
long long rx_time_unpacked_
Definition: radio_socket.h:59
byte
Definition: core.h:388
Class to commicate with the Radios. Including symbol parsing, packing and unpacking based on control ...
Definition: radio_socket.h:18
auto printf(const S &fmt, const T &... args) -> int
Definition: printf.h:631
size_t GetUnpackedSamples(std::vector< void * > &out_samples, long long &rx_time, size_t req_total_samples)
Definition: radio_socket.cc:547
const std::string & Port() const
Definition: radio_socket.h:30
const size_t bytes_per_element_
Definition: radio_socket.h:65
#define HAS_TIME_RX_bf
Definition: radio_socket.cc:72
static size_t ValidateSamples(long long &stream_rx_time, const long long &pkt_rx_time, size_t previous_samples, size_t new_samples, size_t requested_samples, size_t burst_samples, size_t output_dim)
Definition: radio_socket.cc:84
int RxSamples(std::vector< void * > &out_data, long long &rx_time_ns, size_t req_samples_per_channel)
Definition: radio_socket.cc:159
Provides the UDPServer functions from the UDPComm class. Receiver only support.
size_t UnpackSamples(std::vector< void * > &out_samples, size_t req_samples, long long &rx_time)
Definition: radio_socket.cc:264
#define AGORA_LOG_ERROR(...)
Definition: logger.h:39
SPDLOG_INLINE spdlog::log_clock::time_point now() SPDLOG_NOEXCEPT
Definition: os-inl.h:71
Definition: radio_socket.cc:75
#define AGORA_LOG_TRACE(...)
Definition: logger.h:92
#define IS_TRIGGER_bf
Definition: radio_socket.cc:64
#define IS_BURST_bf
Definition: radio_socket.cc:66
std::vector< std::complex< int16_t > > sample_buffer_
Definition: radio_socket.h:58
static constexpr size_t kMaxMTU
Definition: radio_socket.cc:13
#define RX_TIME_ERROR_bf
Definition: radio_socket.cc:70
size_t LoadSamples(std::vector< void * > &out_samples, const std::complex< int16_t > *in_samples, size_t num_in_samples)
Definition: radio_socket.cc:465
bool CheckSymbolComplete(const std::byte *in_data, const int &in_count)
Definition: radio_socket.cc:386
~RadioSocket()
Definition: radio_socket.cc:135
Plot Rx waveform for u
Definition: inspect_single_frame.m:108
size_t GetPackedSamples(std::vector< void * > &out_samples, long long &rx_time, size_t sample_offset, size_t req_samples)
Definition: radio_socket.cc:588
static constexpr bool kDebugIrisRx
Definition: radio_socket.cc:18
static constexpr size_t kRxBufferSize
Definition: radio_socket.cc:15
void Create(size_t samples_per_symbol, const std::string &local_addr, const std::string &remote_addr, const std::string &local_port, const std::string &remote_port)
Definition: radio_socket.cc:137
const std::string & Address() const
Definition: radio_socket.h:29
std::unique_ptr< UDPServer > socket_
Definition: radio_socket.h:53
Definition: json.hpp:5213
#define RX_OVERFLOW_bf
Definition: radio_socket.cc:68
static constexpr size_t kRxSampleRemBufSize
Definition: radio_socket.cc:17
static void RtAssert(bool condition, const char *throw_str)
Definition: utils.h:104
size_t rx_samples_
Definition: radio_socket.h:62
#define AGORA_LOG_WARN(...)
Definition: logger.h:53
uint64_t header_[2u]
Definition: radio_socket.cc:76
uint8_t data_[]
Definition: radio_socket.cc:78
case QPSK rx_data
Definition: generate_data.m:160
#define DEBUG_OUTPUT(...)
Definition: radio_socket.cc:26
size_t rx_bytes_
Definition: radio_socket.h:61
std::vector< std::byte > rx_buffer_
Definition: radio_socket.h:54
size_t samples_per_symbol_
Definition: radio_socket.h:64
struct IrisCommData __attribute__((packed))
Declaration file for the RadioSocket class.
static constexpr size_t kSockBufSize
Definition: channel_sim.cc:26
RadioSocket()
Definition: radio_socket.cc:126
std::queue< size_t > rx_pkt_byte_count_
Definition: radio_socket.h:55
void Flush()
Definition: radio_socket.cc:420