four_multi
Multi-Antenna,Multi-Node,Multi-Band,Multi-Cell
Classes | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | Friends
four_multi_node Class Reference

This is a base class which defines the behavior of a node e.g. a base-station, relay, etc. When implementing a new scheme the core of the work is to create a new class which inherits this class. Even if you intend to use super_node you should start with a class which inherits four_multi_node. More...

#include <four_multi.hpp>

Inheritance diagram for four_multi_node:
file_based SISO_AMC_OFDM_node super_node

List of all members.

Classes

class  udp_function_thread_class
 This class is not part of the API. More...
class  usrp_thread_function_class
 This class is not part of the API. More...

Public Member Functions

void run (void)
 This is the function which is called by the application when real-time is to be performed (or semi-realtime to be more precise). Upon calling this function, the node calls node_init() and then waits for the PPS. When the PPS goes high the time is set to zero and frame transmission and reception according to the frame_settings parameter returned by the node in node_init starts. If you call run() more than once in an application you should set skip_hw_set_during_init to true before the second call. It may also be useful to set set_time_on_pps to false in order to skip the extra time involded in waiting for the PPS.
void run (const char *device_name, uint32_t gps_time_combined)
 four_multi_node (uint32_t buffer_length, uint32_t no_ant1, uint32_t no_ant2, bool use_external_10MHz, bool same_antenna, uint32_t node_ix, std::vector< std::string > IP_addresses, bool simulate, uint32_t skip_ant)
 This is the constructor of four_multi_node.
uint32_t node_ix (void)
 Returns index of the node.
void save_raw_input_on_file (uint32_t max_no_frames_to_save, std::string direcory_name="/usr/local/meas_data/")
 If this function is called prior to calling "run()", in the application, the ADC data received in up to max_no_frames_to_save buffers will be stored in the directory direcory_name. The file name is given by frame_node=x_frame=y.dat, where x is the node index and y is the frame number .The directory name can also be used to include a prefix to the filename e.g. directory_name="/home/arnold/sunday_". The files will then be named e.g. /home/arnold/sunday_frame_node=x_frame=y.dat and so on. How to read this data from the files into matlab is described in the document http://fourmulti.sourceforge.net/four_multi.pdf.
void dont_save_raw_input_on_file (void)
 This function undoes a call to save_raw_input_on_file.

Public Attributes

double wait_time_for_transmissions_to_finish
 Advanced parameter.
bool set_time_on_pps
 This parameter is set to true during instansiation. See run() for more information.
bool skip_hw_set_during_init
 This parameter is set to false during instantiation. See run() for more information.
bool use_udp

Protected Member Functions

void x2_tx (uint32_t other_node_ix, const void *pointer_to_data, uint32_t num_bytes)
 Set this to true to use UDP protocoll for backbone transmissions. Set to false be default.
void x2_tx_udp (uint32_t other_node_ix, const void *pointer_to_data, uint32_t num_bytes)
 This version of x2_tx is called if use_udp is true. The user may also call it directly.
void x2_tx_tcp (uint32_t other_node_ix, const void *pointer_to_data, uint32_t num_bytes)
 This version of x2_tx is called if use_udp is false. The user may also call it directly.
void x2_rx (uint32_t other_node_ix, void *const pointer_to_data, uint32_t num_bytes)
 Call this from node_process to receive a memory segment from another node. Se more info in http://fourmulti.sourceforge.net/four_multi.pdf. http://fourmulti.sourceforge.net/four_multi.pdf The boolean use_udp (a member of four_multi_node) defines if UDP/IP (if true) or TCP/IP (if false) should be used. It is false by default.
void x2_rx (std::vector< uint32_t > other_node_ixs, std::vector< void * > const pointers_to_data, std::vector< uint32_t > num_bytess)
 This version of x2_rx receives buffers from several nodes simultanously.
void x2_rx_tcp (uint32_t other_node_ix, void *const pointer_to_data, uint32_t num_bytes)
 This version of x2_rx is called if use_udp is false. The user may also call it directly.
void x2_rx_udp (uint32_t other_node_ix, void *const pointer_to_data, uint32_t num_bytes)
 This version of x2_rx is called if use_udp is true. The user may also call it directly.
void x2_rx_tcp (std::vector< uint32_t > other_node_ixs, std::vector< void * > const pointers_to_data, std::vector< uint32_t > num_bytess)
 This version of x2_rx receives buffers from several nodes simultanously using TCP/IP.
void x2_rx_udp (std::vector< uint32_t > other_node_ixs, std::vector< void * > const pointers_to_data, std::vector< uint32_t > num_bytess)
 This version of x2_rx receives buffers from several nodes simultanously using UDP/IP.
virtual frame_settings node_process (void)=0
 Override this function with your implementation. This is the most important function of your implementation. The function returns a "frame_settings" value which defines when then next frame should be transmitted, if it is a transmit or receive buffer. If it is a transmit frame then you should fill the transmitter buffers, d_tx_buffers, with the signal that should be transmitted before exiting node_process. If the previous frame was a receive frame then you should process the samples in d_rx_buffers. The frame_settings of the previous frame is stored in d_old_frame_settings.
virtual frame_settings node_init (void)=0
 Override this function with your implementation. This function has the same function as node_process except that it is called only once and before anything has been transmitted and received. The function is called before synchronizing against the PPS. Here you can place any time consuming initializations you may need.
virtual void end_of_run (void)=0
 Override this function with any post processing you may want to do.
void save_logged_raw_data (void)
void log_raw_buffer (uint32_t number_of_samples)
void set_trx_params (frame_settings fs_new, frame_settings fs_old)
void set_trx_params (frame_settings fs)
void init (uint32_t buffer_length)

Protected Attributes

uint32_t d_buffer_length
uint32_t d_no_ant1
uint32_t d_no_ant2
uint32_t d_no_ant
uint32_t d_node_ix
uint32_t d_skip_ant
bool save_input_on_file
std::string raw_data_dir
uint32_t no_rx_buffer_stored_so_far
uint32_t d_max_no_frames_to_save
usrp_thread_function_classm1
usrp_thread_function_classm2
std::vector< std::string > d_IP_addresses
std::string d_args
double d_rate
bool d_use_external_10MHz
bool d_use_same_antenna
bool d_simulate
void ** feedback_buffers
bool * feedback_buffers_empty
uint32_t num_nodes
bool never_run
void * feedback_buffer_simulate
frame_settings d_old_frame_settings
std::vector< void * > d_tx_buffers
std::vector< void * > d_rx_buffers
std::vector< void * > d_rx_storage_buffers

Static Protected Attributes

static const time_t time_available_for_trigger = 1
static const time_t headroom_after_trigger = 1

Friends

class super_node
class node_process_class
void simulate (std::vector< four_multi_node * > *nodes, channel_model *c)

Detailed Description

This is a base class which defines the behavior of a node e.g. a base-station, relay, etc. When implementing a new scheme the core of the work is to create a new class which inherits this class. Even if you intend to use super_node you should start with a class which inherits four_multi_node.

Definition at line 82 of file four_multi.hpp.


Constructor & Destructor Documentation

four_multi_node::four_multi_node ( uint32_t  buffer_length,
uint32_t  no_ant1,
uint32_t  no_ant2,
bool  use_external_10MHz,
bool  same_antenna,
uint32_t  node_ix,
std::vector< std::string >  IP_addresses,
bool  simulate,
uint32_t  skip_ant 
)

This is the constructor of four_multi_node.

Parameters:
buffer_length.The size of buffer (in samples) per USRP. Advice: leave some headroom in the biginning and end.
no_ant1Set this parameter to the number of antennas in your system.
no_ant2Set this to zero (this is used in certain calibration schemes).
use_external_10MHzSet to true since we are using external 10MHz.
same_antenna.If XCVR2450 is used, setting this value to true makes the J1 antenna connector be used during TX and RX. Setting it to false makes J1 being used for RX and J2 for TX.
node_ixEach node needs a unique number. Use the range from 0 to number_of_nodes_in_system-1.
IP_addressesSet to the IP address of the back-bone of all nodes in the system. Use dummy string, e.g. "xxx", in nodes without backbone not used.
simulateSet this parameter to true if you are going to do simulations using the simulate functions or if the node is one of several to be used with the super_node class, otherwise set to false. When set to false, the node will not initialize any USRPs and no USRPs are needed.
skip_antThe USRPs are assumed to have 192.168.10*(1+skip_ant).2, 192.168.10*(2+skip_ant).2,....

Definition at line 215 of file four_multi.cpp.


Member Function Documentation

void four_multi_node::save_raw_input_on_file ( uint32_t  max_no_frames_to_save,
std::string  direcory_name = "/usr/local/meas_data/" 
)

If this function is called prior to calling "run()", in the application, the ADC data received in up to max_no_frames_to_save buffers will be stored in the directory direcory_name. The file name is given by frame_node=x_frame=y.dat, where x is the node index and y is the frame number .The directory name can also be used to include a prefix to the filename e.g. directory_name="/home/arnold/sunday_". The files will then be named e.g. /home/arnold/sunday_frame_node=x_frame=y.dat and so on. How to read this data from the files into matlab is described in the document http://fourmulti.sourceforge.net/four_multi.pdf.

Parameters:
max_no_frames_to_saveMaximum number of buffers that will be saved. Any additional buffers will not be saved.
direcory_nameDirectory where the measurements will be located.

Definition at line 279 of file four_multi.cpp.

void four_multi_node::x2_rx ( uint32_t  other_node_ix,
void *const  pointer_to_data,
uint32_t  num_bytes 
) [protected]

Call this from node_process to receive a memory segment from another node. Se more info in http://fourmulti.sourceforge.net/four_multi.pdf. http://fourmulti.sourceforge.net/four_multi.pdf The boolean use_udp (a member of four_multi_node) defines if UDP/IP (if true) or TCP/IP (if false) should be used. It is false by default.

Parameters:
other_node_ixThe index of the other node.
pointer_to_dataPointer to the memory segment.
num_bytesNumber of bytes to receive.

Definition at line 929 of file four_multi.cpp.

void four_multi_node::x2_rx ( std::vector< uint32_t >  other_node_ixs,
std::vector< void * > const  pointers_to_data,
std::vector< uint32_t >  num_bytess 
) [protected]

This version of x2_rx receives buffers from several nodes simultanously.

Parameters:
other_node_ixsThe indecies of the other nodes.
pointers_to_dataThe pointers to the memory segment to store the received data in.
num_bytessNumber of bytes to receive per reception.

Definition at line 1025 of file four_multi.cpp.

void four_multi_node::x2_rx_tcp ( uint32_t  other_node_ix,
void *const  pointer_to_data,
uint32_t  num_bytes 
) [protected]

This version of x2_rx is called if use_udp is false. The user may also call it directly.

Parameters:
other_node_ixThe index of the other node.
pointer_to_dataPointer to the memory segment.
num_bytesNumber of bytes in the memory segment.

Definition at line 938 of file four_multi.cpp.

void four_multi_node::x2_rx_tcp ( std::vector< uint32_t >  other_node_ixs,
std::vector< void * > const  pointers_to_data,
std::vector< uint32_t >  num_bytess 
) [protected]

This version of x2_rx receives buffers from several nodes simultanously using TCP/IP.

Parameters:
other_node_ixsThe indecies of the other nodes.
pointers_to_dataThe pointers to the memory segment to store the received data in.
num_bytessNumber of bytes to receive per reception.

Definition at line 1034 of file four_multi.cpp.

void four_multi_node::x2_rx_udp ( uint32_t  other_node_ix,
void *const  pointer_to_data,
uint32_t  num_bytes 
) [protected]

This version of x2_rx is called if use_udp is true. The user may also call it directly.

Parameters:
other_node_ixThe index of the other node.
pointer_to_dataPointer to the memory segment.
num_bytesNumber of bytes in the memory segment.

Definition at line 1011 of file four_multi.cpp.

void four_multi_node::x2_rx_udp ( std::vector< uint32_t >  other_node_ixs,
std::vector< void * > const  pointers_to_data,
std::vector< uint32_t >  num_bytess 
) [protected]

This version of x2_rx receives buffers from several nodes simultanously using UDP/IP.

Parameters:
other_node_ixsThe indecies of the other nodes.
pointers_to_dataThe pointers to the memory segment to store the received data in.
num_bytessNumber of bytes to receive per reception.

Definition at line 1043 of file four_multi.cpp.

void four_multi_node::x2_tx ( uint32_t  other_node_ix,
const void *  pointer_to_data,
uint32_t  num_bytes 
) [protected]

Set this to true to use UDP protocoll for backbone transmissions. Set to false be default.

Call this from node_process to send a memory segment to another node. See more info in http://fourmulti.sourceforge.net/four_multi.pdf. The boolean use_udp (a member of four_multi_node) defines if UDP/IP (if true) or TCP/IP (if false) should be used. It is false by default.

Parameters:
other_node_ixThe index of the other node.
pointer_to_dataPointer to the memory segment.
num_bytesNumber of bytes in the memory segment.

Definition at line 838 of file four_multi.cpp.

void four_multi_node::x2_tx_tcp ( uint32_t  other_node_ix,
const void *  pointer_to_data,
uint32_t  num_bytes 
) [protected]

This version of x2_tx is called if use_udp is false. The user may also call it directly.

Parameters:
other_node_ixThe index of the other node.
pointer_to_dataPointer to the memory segment.
num_bytesNumber of bytes in the memory segment.

Definition at line 849 of file four_multi.cpp.

void four_multi_node::x2_tx_udp ( uint32_t  other_node_ix,
const void *  pointer_to_data,
uint32_t  num_bytes 
) [protected]

This version of x2_tx is called if use_udp is true. The user may also call it directly.

Parameters:
other_node_ixThe index of the other node.
pointer_to_dataPointer to the memory segment.
num_bytesNumber of bytes in the memory segment.

Definition at line 809 of file four_multi.cpp.


The documentation for this class was generated from the following files:
 All Classes Functions Variables