|
fun_ofdm
1.0
802.11a Physical Layer for USRP
|
Receiver test. More...
#include <iostream>#include <boost/date_time/posix_time/posix_time.hpp>#include <boost/date_time/gregorian/gregorian.hpp>#include <boost/program_options.hpp>#include "receiver.h"Go to the source code of this file.
Functions | |
| void | test_rx (double freq, double sample_rate, double rx_gain) |
| Function for testing the fun_ofdm receiver. More... | |
| void | test_rx_pause (double freq, double sample_rate, double rx_gain) |
| Function for testing the fun_ofdm receiver and demonstrating the use of the receiver::pause() and receiver::resume() functions. More... | |
| void | process_packets_callback (std::vector< std::vector< unsigned char > > packets) |
| The callback function for processing the Received Packets. More... | |
| int | main (int argc, char *argv[]) |
Variables | |
| double | freq = 5.72e9 |
| double | sample_rate = 5e6 |
| double | rx_gain = 30 |
| int | rx_count = 0 |
| Total number of packets received since the receiver was activated. More... | |
Receiver test.
This file is used to test receiving OFDM PHY frames over the air.
Definition in file test_rx.cpp.
| int main | ( | int | argc, |
| char * | argv[] | ||
| ) |
| void process_packets_callback | ( | std::vector< std::vector< unsigned char > > | packets) |
The callback function for processing the Received Packets.
| packets | The successfully received packets in from the receiver_chain |
This function merely counts the number of received packets and prints the timestamps of when the packets were received.
Definition at line 109 of file test_rx.cpp.
References rx_count.
Referenced by test_rx(), and test_rx_pause().
| void test_rx | ( | double | freq, |
| double | sample_rate, | ||
| double | rx_gain | ||
| ) |
Function for testing the fun_ofdm receiver.
| freq | Center Frequency |
| sample_rate | Sample Rate |
| rx_gain | Receiver Gain |
This function creates a receiver object which spawns its own thread for the receiver chain. It passes a pointer to the process_packets_callback() function which is used to process the received packets (in this case it just counts them). This function then proceeds to spin forever in a while(1) loop until the user kills the program externally (preferably by using something like Ctrl+c or the kill command in the shell, however, while not suggested, pulling the power plug does also effectively kill the program).
Definition at line 54 of file test_rx.cpp.
References process_packets_callback().
Referenced by main().
| void test_rx_pause | ( | double | freq, |
| double | sample_rate, | ||
| double | rx_gain | ||
| ) |
Function for testing the fun_ofdm receiver and demonstrating the use of the receiver::pause() and receiver::resume() functions.
| freq | Center Frequency |
| sample_rate | Sample Rate |
| rx_gain | Receiver Gain |
This function is similar to test_rx() function, however instead of running an empty while(1) loop, it instead runs a while(1) loop that sleeps for 4 seconds allowing the receiver to run freely. It then pauses the receiver for 1 second using the receiver::pause() function, waits 1 second, then resumes the receiver by using the receiver::resume() function.
Definition at line 79 of file test_rx.cpp.
References fun::receiver::pause(), process_packets_callback(), and fun::receiver::resume().
| double freq = 5.72e9 |
Definition at line 20 of file test_rx.cpp.
Referenced by main().
| int rx_count = 0 |
Total number of packets received since the receiver was activated.
Definition at line 27 of file test_rx.cpp.
Referenced by process_packets_callback().
| double rx_gain = 30 |
Definition at line 23 of file test_rx.cpp.
Referenced by main().
| double sample_rate = 5e6 |
Definition at line 21 of file test_rx.cpp.
Referenced by main().