forked from robotastic/trunk-recorder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsource.h
75 lines (70 loc) · 1.98 KB
/
source.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef SOURCE_H
#define SOURCE_H
#include <iostream>
#include <gnuradio/basic_block.h>
#include <gnuradio/top_block.h>
#include <osmosdr/source.h>
#include <gnuradio/uhd/usrp_source.h>
#include "recorder.h"
#include "analog_recorder.h"
#include "debug_recorder.h"
#include "p25_recorder.h"
class Source
{
double min_hz;
double max_hz;
double center;
double rate;
double actual_rate;
double error;
double ppm;
int gain;
int bb_gain;
int if_gain;
int max_digital_recorders;
int max_debug_recorders;
int max_analog_recorders;
std::vector<p25_recorder_sptr> digital_recorders;
std::vector<debug_recorder_sptr> debug_recorders;
std::vector<analog_recorder_sptr> analog_recorders;
std::string driver;
std::string device;
std::string antenna;
gr::basic_block_sptr source_block;
public:
int get_num_available_recorders();
Source(double c, double r, double e, std::string driver, std::string device);
gr::basic_block_sptr get_src_block();
double get_min_hz();
double get_max_hz();
double get_center();
double get_rate();
std::string get_driver();
std::string get_device();
void set_antenna(std::string ant);
std::string get_antenna();
void set_error(double e);
double get_error();
void set_if_gain(int i);
int get_if_gain();
void set_gain(int r);
int get_gain();
void set_bb_gain(int b);
int get_bb_gain();
void set_freq_corr(double p);
void create_analog_recorders(gr::top_block_sptr tb, int r);
Recorder * get_analog_recorder(int priority);
void create_digital_recorders(gr::top_block_sptr tb, int r, bool qpsk);
Recorder * get_digital_recorder(int priority);
void create_debug_recorders(gr::top_block_sptr tb, int r);
Recorder * get_debug_recorder();
inline osmosdr::source::sptr cast_to_osmo_sptr(gr::basic_block_sptr p)
{
return boost::dynamic_pointer_cast<osmosdr::source, gr::basic_block>(p);
}
inline gr::uhd::usrp_source::sptr cast_to_usrp_sptr(gr::basic_block_sptr p)
{
return boost::dynamic_pointer_cast<gr::uhd::usrp_source, gr::basic_block>(p);
}
};
#endif