2 #ifndef USRP_HW_MANAGER 3 #define USRP_HW_MANAGER 8 #include <uhd/types/time_spec.hpp> 26 hardware_manager(server_settings* settings,
bool sw_loop_init,
size_t usrp_number = 0);
71 param *current_settings,
83 param *current_settings,
105 bool tx_loaded_cmd_A;
108 bool tx_loaded_cmd_B;
111 bool rx_loaded_cmd_A;
114 bool rx_loaded_cmd_B;
116 void apply(usrp_param* requested_config);
123 uhd::rx_streamer::sptr A_rx_stream;
124 uhd::tx_streamer::sptr A_tx_stream;
125 uhd::rx_streamer::sptr B_rx_stream;
126 uhd::tx_streamer::sptr B_tx_stream;
130 void flush_rx_streamer(uhd::rx_streamer::sptr &rx_streamer);
133 boost::thread* A_rx_thread;
135 boost::thread* B_rx_thread;
138 std::atomic<bool> A_tx_thread_operation;
139 boost::thread* A_tx_thread;
140 std::atomic<bool> B_tx_thread_operation;
141 boost::thread* B_tx_thread;
144 error_queue* A_tx_error_queue;
145 error_queue* B_tx_error_queue;
148 uhd::device_addr_t hint;
151 uhd::device_addrs_t dev_addrs;
157 tx_queue* A_sw_loop_queue;
158 tx_queue* B_sw_loop_queue;
162 std::vector<size_t> channel_num;
173 void clear_streams();
176 char front_end_code0;
177 char front_end_code1;
182 std::string apply_antenna_config(param *parameters, param *old_parameters,
size_t chan);
185 bool check_double_txrx(ant_mode
TXRX);
189 bool check_global_mode_presence(ant_mode mode,
size_t chan);
191 void software_tx_thread(
192 param *current_settings,
195 tx_queue* sw_loop_queue,
199 void single_tx_thread(
200 param *current_settings,
203 uhd::tx_streamer::sptr &tx_stream,
209 void async_stream(uhd::tx_streamer::sptr &tx_stream,
char fron_tend);
211 void software_rx_thread(
212 param *current_settings,
215 tx_queue* sw_loop_queue,
220 void single_rx_thread(
221 param *current_settings,
226 uhd::rx_streamer::sptr &rx_stream,
std::atomic< bool > B_rx_thread_operation
void start_rx(int buffer_len, threading_condition *wait_condition, preallocator< float2 > *memory, int thread_op, param *current_settings, char front_end)
@ brief start a rx thread.
bool check_tx_status(bool verbose=false)
Check the status of every tx operations. Returns the status of A or B.
bool check_rx_status(bool verbose=false)
Check the status of every rx operations. Returns the status of A or B.
std::atomic< bool > A_rx_thread_operation
bool check_A_rx_status(bool verbose=false)
Check the status of A rx operations.
int clean_rx_queue(rx_queue *RX_queue, preallocator< float2 > *memory)
Release the memory associated with pointers holded by a rx queue using the respective memory allocato...
bool check_B_tx_status(bool verbose=false)
Check the status of B tx operations.
tx_queue * B_TX_queue
Queue accessed to stream data from B frontend.
tx_queue * A_TX_queue
Queue accessed to stream data from A frontend.
hardware_manager(server_settings *settings, bool sw_loop_init, size_t usrp_number=0)
The initializer of the class can be used to select which usrp is controlled by the class Default call...
int clean_tx_queue(tx_queue *TX_queue, preallocator< float2 > *memory)
Release the memory associated with pointers holded by a tx queue using the respective memory allocato...
bool preset_usrp(usrp_param *requested_config)
Set the USRP device with user parameters.
bool check_B_rx_status(bool verbose=false)
Check the status of B rx operations.
void close_tx()
Close all the tx streamer threads.
void start_tx(threading_condition *wait_condition, int thread_op, param *current_settings, char front_end, preallocator< float2 > *memory=NULL)
Start a transmission thread. The threads started by this function do two things: pop a packet from th...
void close_rx()
Close all the rx streamer threads.
bool check_A_tx_status(bool verbose=false)
Check the status of A tx operations.
rx_queue * A_RX_queue
Queue accessed to retrive data from A frontend.
Manages the hardware I/O of one usrp unit.
uhd::usrp::multi_usrp::sptr main_usrp
rx_queue * B_RX_queue
Queue accessed to retrive data from B frontend.