Agora  1.2.0
Agora project
radio_socket.cc File Reference

Implementation file for the RadioSocket class. More...

#include "radio_socket.h"
#include <cassert>
#include <chrono>
#include "logger.h"
#include "utils.h"
Include dependency graph for radio_socket.cc:

Classes

struct  IrisCommData
 

Macros

#define DEBUG_OUTPUT(...)   ((void)0)
 
#define SEQUENCE_MASK   (0xffff)
 Iris tx status header flags. More...
 
#define HAS_SEQUENCE_bp   (16)
 
#define HAS_SEQUENCE_bf   (uint64_t(1) << HAS_SEQUENCE_bp)
 
#define SEQUENCE_ERROR_bp   (17)
 
#define SEQUENCE_ERROR_bf   (uint64_t(1) << SEQUENCE_ERROR_bp)
 
#define HAS_STATUS_bp   (18)
 
#define HAS_STATUS_bf   (uint64_t(1) << HAS_STATUS_bp)
 
#define HAS_TIME_bp   (19)
 
#define HAS_TIME_bf   (uint64_t(1) << HAS_TIME_bp)
 
#define TIME_ERROR_bp   (20)
 
#define TIME_ERROR_bf   (uint64_t(1) << TIME_ERROR_bp)
 
#define UNDERFLOW_ERROR_bp   (21)
 
#define UNDERFLOW_ERROR_bf   (uint64_t(1) << UNDERFLOW_ERROR_bp)
 
#define BURST_END_bp   (22)
 
#define BURST_END_bf   (uint64_t(1) << BURST_END_bp)
 
#define OVERFLOW_ERROR_bp   (23)
 
#define OVERFLOW_ERROR_bf   (uint64_t(1) << OVERFLOW_ERROR_bp)
 
#define SEQ_REQUEST_bp   (25)
 Iris rx header flags. More...
 
#define SEQ_REQUEST_bf   (uint64_t(1) << SEQ_REQUEST_bp)
 
#define IS_TRIGGER_bp   (26)
 
#define IS_TRIGGER_bf   (uint64_t(1) << IS_TRIGGER_bp)
 
#define IS_BURST_bp   (28)
 
#define IS_BURST_bf   (uint64_t(1) << IS_BURST_bp)
 
#define RX_OVERFLOW_bp   (29)
 
#define RX_OVERFLOW_bf   (uint64_t(1) << RX_OVERFLOW_bp)
 
#define RX_TIME_ERROR_bp   (30)
 
#define RX_TIME_ERROR_bf   (uint64_t(1) << RX_TIME_ERROR_bp)
 
#define HAS_TIME_RX_bp   (31)
 
#define HAS_TIME_RX_bf   (uint64_t(1) << HAS_TIME_RX_bp)
 

Functions

struct IrisCommData __attribute__ ((packed))
 
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)
 

Variables

static constexpr size_t kMaxMTU = 9000
 
static constexpr size_t kRxBufferSize = 524288
 
static constexpr size_t kRxSampleRemBufSize = 4096
 
static constexpr bool kDebugIrisRx = false
 
uint64_t header_ [2u]
 
uint8_t data_ []
 

Detailed Description

Implementation file for the RadioSocket class.

Macro Definition Documentation

◆ BURST_END_bf

#define BURST_END_bf   (uint64_t(1) << BURST_END_bp)

◆ BURST_END_bp

#define BURST_END_bp   (22)

◆ DEBUG_OUTPUT

#define DEBUG_OUTPUT (   ...)    ((void)0)

◆ HAS_SEQUENCE_bf

#define HAS_SEQUENCE_bf   (uint64_t(1) << HAS_SEQUENCE_bp)

◆ HAS_SEQUENCE_bp

#define HAS_SEQUENCE_bp   (16)

◆ HAS_STATUS_bf

#define HAS_STATUS_bf   (uint64_t(1) << HAS_STATUS_bp)

◆ HAS_STATUS_bp

#define HAS_STATUS_bp   (18)

◆ HAS_TIME_bf

#define HAS_TIME_bf   (uint64_t(1) << HAS_TIME_bp)

◆ HAS_TIME_bp

#define HAS_TIME_bp   (19)

◆ HAS_TIME_RX_bf

#define HAS_TIME_RX_bf   (uint64_t(1) << HAS_TIME_RX_bp)

◆ HAS_TIME_RX_bp

#define HAS_TIME_RX_bp   (31)

◆ IS_BURST_bf

#define IS_BURST_bf   (uint64_t(1) << IS_BURST_bp)

◆ IS_BURST_bp

#define IS_BURST_bp   (28)

◆ IS_TRIGGER_bf

#define IS_TRIGGER_bf   (uint64_t(1) << IS_TRIGGER_bp)

◆ IS_TRIGGER_bp

#define IS_TRIGGER_bp   (26)

◆ OVERFLOW_ERROR_bf

#define OVERFLOW_ERROR_bf   (uint64_t(1) << OVERFLOW_ERROR_bp)

◆ OVERFLOW_ERROR_bp

#define OVERFLOW_ERROR_bp   (23)

◆ RX_OVERFLOW_bf

#define RX_OVERFLOW_bf   (uint64_t(1) << RX_OVERFLOW_bp)

◆ RX_OVERFLOW_bp

#define RX_OVERFLOW_bp   (29)

◆ RX_TIME_ERROR_bf

#define RX_TIME_ERROR_bf   (uint64_t(1) << RX_TIME_ERROR_bp)

◆ RX_TIME_ERROR_bp

#define RX_TIME_ERROR_bp   (30)

◆ SEQ_REQUEST_bf

#define SEQ_REQUEST_bf   (uint64_t(1) << SEQ_REQUEST_bp)

◆ SEQ_REQUEST_bp

#define SEQ_REQUEST_bp   (25)

Iris rx header flags.

◆ SEQUENCE_ERROR_bf

#define SEQUENCE_ERROR_bf   (uint64_t(1) << SEQUENCE_ERROR_bp)

◆ SEQUENCE_ERROR_bp

#define SEQUENCE_ERROR_bp   (17)

◆ SEQUENCE_MASK

#define SEQUENCE_MASK   (0xffff)

Iris tx status header flags.

◆ TIME_ERROR_bf

#define TIME_ERROR_bf   (uint64_t(1) << TIME_ERROR_bp)

◆ TIME_ERROR_bp

#define TIME_ERROR_bp   (20)

◆ UNDERFLOW_ERROR_bf

#define UNDERFLOW_ERROR_bf   (uint64_t(1) << UNDERFLOW_ERROR_bp)

◆ UNDERFLOW_ERROR_bp

#define UNDERFLOW_ERROR_bp   (21)

Function Documentation

◆ __attribute__()

struct IrisCommData __attribute__ ( (packed)  )

◆ ValidateSamples()

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 
)
inlinestatic

If Samples to Load > 0 we should stop trying to receive Otherwise, keep trying to get more data

Here is the caller graph for this function:

Variable Documentation

◆ data_

uint8_t data_[]

◆ header_

uint64_t header_[2u]

◆ kDebugIrisRx

constexpr bool kDebugIrisRx = false
staticconstexpr

◆ kMaxMTU

constexpr size_t kMaxMTU = 9000
staticconstexpr

◆ kRxBufferSize

constexpr size_t kRxBufferSize = 524288
staticconstexpr

◆ kRxSampleRemBufSize

constexpr size_t kRxSampleRemBufSize = 4096
staticconstexpr