Skip to content

Commit

Permalink
Removing unused variables
Browse files Browse the repository at this point in the history
  • Loading branch information
robotastic committed Apr 9, 2022
1 parent b2786c9 commit dd3e6bf
Show file tree
Hide file tree
Showing 20 changed files with 9 additions and 71 deletions.
5 changes: 0 additions & 5 deletions lib/gr_blocks/decoders/tps_decoder_sink_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,6 @@ namespace gr {
class tps_decoder_sink_impl : public tps_decoder_sink
{
private:
const int phase1_samples_per_symbol = 5;
const int phase2_samples_per_symbol = 4;
const double phase1_symbol_rate = 4800;
const double phase2_symbol_rate = 6000;

int d_src_num;
decoder_callback d_callback;

Expand Down
5 changes: 0 additions & 5 deletions lib/gr_blocks/transmission_sink.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,6 @@ bool transmission_sink::start_recording(Call *call) {
}

bool transmission_sink::open_internal(const char *filename) {
int d_first_sample_pos;
unsigned d_samples_per_chan;

// we use the open system call to get access to the O_LARGEFILE flag.
// O_APPEND|
int fd;
Expand Down Expand Up @@ -315,8 +312,6 @@ int transmission_sink::work(int noutput_items, gr_vector_const_void_star &input_
// it is possible that we could get part of a transmission after a call has stopped. We shouldn't do any recording if this happens.... this could mean that we miss part of the recording though
if ((state == STOPPED) || (state == AVAILABLE)) {
if (noutput_items > 1) {
time_t now = time(NULL);
double its_been = difftime(now, d_stop_time);
char formattedTalkgroup[62];
snprintf(formattedTalkgroup, 61, "%c[%dm%10ld%c[0m", 0x1B, 35, d_current_call_talkgroup, 0x1B);
std::string talkgroup_display = boost::lexical_cast<std::string>(formattedTalkgroup);
Expand Down
5 changes: 0 additions & 5 deletions plugins/openmhz_uploader/openmhz_uploader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@ class Openmhz_Uploader : public Plugin_Api {
char formattedTalkgroup[62];
snprintf(formattedTalkgroup, 61, "%c[%dm%10ld%c[0m", 0x1B, 35, call_info.talkgroup, 0x1B);
std::string talkgroup_display = boost::lexical_cast<std::string>(formattedTalkgroup);
time_t start_time = call_info.start_time;



//BOOST_LOG_TRIVIAL(error) << "Got source list: " << source_list.str();
CURL *curl;
CURLMcode res;
CURLM *multi_handle;
Expand Down
2 changes: 0 additions & 2 deletions plugins/rdioscanner_uploader/rdioscanner_uploader.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ class Rdio_Scanner_Uploader : public Plugin_Api {
std::string talkgroup_alpha_tag = call_info.talkgroup_alpha_tag;
std::string talkgroup_description = call_info.talkgroup_description;
bool compress_wav = false;
Talkgroup *tg;
Rdio_Scanner_System *sys = get_system(call_info.short_name);

if (call_info.encrypted) {
Expand Down Expand Up @@ -93,7 +92,6 @@ class Rdio_Scanner_Uploader : public Plugin_Api {
char formattedTalkgroup[62];
snprintf(formattedTalkgroup, 61, "%c[%dm%10ld%c[0m", 0x1B, 35, call_info.talkgroup, 0x1B);
std::string talkgroup_display = boost::lexical_cast<std::string>(formattedTalkgroup);
time_t start_time = call_info.start_time;

if (call_info.transmission_source_list.size() != 0) {
for (int i = 0; i < call_info.transmission_source_list.size(); i++) {
Expand Down
1 change: 0 additions & 1 deletion plugins/stat_socket/stat_socket.cc
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,6 @@ class Stat_Socket : public Plugin_Api {

int parse_config(boost::property_tree::ptree &cfg ){ return 0; }
int stop() { return 0; }
int audio_stream(Recorder *recorder, float *samples, int sampleCount) { return 0; }
int setup_sources(std::vector<Source *> sources) { return 0; }

};
Expand Down
2 changes: 0 additions & 2 deletions trunk-recorder/call_concluder/call_concluder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,6 @@ Call_Data_t upload_call_worker(Call_Data_t call_info) {
std::string shell_command_string;
std::string files;

int filename_length;

char formattedTalkgroup[62];
snprintf(formattedTalkgroup, 61, "%c[%dm%10ld%c[0m", 0x1B, 35, call_info.talkgroup, 0x1B);
std::string talkgroup_display = boost::lexical_cast<std::string>(formattedTalkgroup);
Expand Down
5 changes: 1 addition & 4 deletions trunk-recorder/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -956,9 +956,8 @@ void unit_location(System *sys, long source_id, long talkgroup_num) {

void handle_call_grant(TrunkMessage message, System *sys) {
bool call_found = false;
bool call_retune = false;
bool recording_started = false;

/* Notes: it is possible for 2 Calls to exist for the same talkgroup on different freq. This happens when a Talkgroup starts on a freq
that current recorder can't retune to. In this case, the current orig Talkgroup reocrder will keep going on the old freq, while a new
recorder is start on a source that can cover that freq. This makes sure any of the remaining transmission that it is in the buffer
Expand Down Expand Up @@ -1045,8 +1044,6 @@ void handle_call_grant(TrunkMessage message, System *sys) {

void handle_call_update(TrunkMessage message, System *sys) {
bool call_found = false;
bool call_retune = false;
bool recording_started = false;

/* Notes: it is possible for 2 Calls to exist for the same talkgroup on different freq. This happens when a Talkgroup starts on a freq
that current recorder can't retune to. In this case, the current orig Talkgroup reocrder will keep going on the old freq, while a new
Expand Down
2 changes: 1 addition & 1 deletion trunk-recorder/plugin_manager/plugin_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ void plugman_unit_answer_request(System *system, long source_id, long talkgroup)
for (std::vector<Plugin *>::iterator it = plugins.begin(); it != plugins.end(); it++) {
Plugin *plugin = *it;
if (plugin->state == PLUGIN_RUNNING) {
plugin->api->unit_data_grant(system, source_id), talkgroup;
plugin->api->unit_answer_request(system, source_id, talkgroup);
}
}
}
Expand Down
1 change: 0 additions & 1 deletion trunk-recorder/recorders/analog_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,6 @@ bool analog_recorder::start(Call *call) {
//BOOST_LOG_TRIVIAL(error) << "Setting squelch to: " << squelch_db << " block says: " << squelch->threshold();
levels->set_k(system->get_analog_levels());
int d_max_dev = system->get_max_dev();
double d_filter_width = system->get_filter_width();
channel_lpf_taps = gr::filter::firdes::low_pass_2(1.0, initial_rate, d_max_dev, 1000, 100);
channel_lpf->set_taps(channel_lpf_taps);
quad_gain = system_channel_rate / (2.0 * M_PI * (d_max_dev + 1000));
Expand Down
1 change: 0 additions & 1 deletion trunk-recorder/recorders/analog_recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class analog_recorder : public gr::hier_block2, public Recorder {
double squelch_db;
time_t timestamp;
time_t starttime;
char filename[160];

State state;
std::vector<float> inital_lpf_taps;
Expand Down
1 change: 0 additions & 1 deletion trunk-recorder/recorders/debug_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,6 @@ debug_recorder::debug_recorder(Source *src, std::string address, int port)
config = source->get_config();
input_rate = source->get_rate();
talkgroup = 0;
port = port;

state = INACTIVE;

Expand Down
9 changes: 2 additions & 7 deletions trunk-recorder/recorders/debug_recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,34 +103,29 @@ class debug_recorder : public gr::hier_block2, public Recorder {
private:
double chan_freq;
double center_freq;
bool qpsk_mod;
int silence_frames;
long talkgroup;
int port;
time_t timestamp;
time_t starttime;

Config *config;
Source *source;
char filename[160];

//int num;
State state;

double system_channel_rate;
double arb_rate;
double samples_per_symbol;
double symbol_rate;
double initial_rate;

long decim;
double resampled_rate;
bool double_decim;
long if1;
long if2;
long input_rate;
const int phase1_samples_per_symbol = 5;
const int phase2_samples_per_symbol = 4;
const double phase1_symbol_rate = 4800;
const double phase2_symbol_rate = 6000;

std::vector<float> arb_taps;
std::vector<float> sym_taps;
Expand Down
12 changes: 0 additions & 12 deletions trunk-recorder/recorders/dmr_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -219,24 +219,14 @@ void dmr_recorder::initialize(Source *src) {
//OP25 Frame Assembler
traffic_queue = gr::msg_queue::make(2);
rx_queue = gr::msg_queue::make(100);

int udp_port = 0;
int verbosity = 0; // 10 = lots of debug messages
const char *udp_host = "127.0.0.1";
bool do_imbe = 1;
bool do_output = 1;
bool do_msgq = 0;
bool do_audio_output = 1;
bool do_tdma = 1;
bool do_nocrypt = 1;

framer = gr::op25_repeater::frame_assembler::make(0,"file:///tmp/out1.raw", verbosity, 1, rx_queue);
//op25_frame_assembler = gr::op25_repeater::p25_frame_assembler::make(0, silence_frames, udp_host, udp_port, verbosity, do_imbe, do_output, do_msgq, rx_queue, do_audio_output, do_tdma, do_nocrypt);
levels = gr::blocks::multiply_const_ff::make(1);
plugin_sink = gr::blocks::plugin_wrapper_impl::make(std::bind(&dmr_recorder::plugin_callback_handler, this, std::placeholders::_1, std::placeholders::_2));



// Squelch DB
// on a trunked network where you know you will have good signal, a carrier
// power squelch works well. real FM receviers use a noise squelch, where
Expand All @@ -245,8 +235,6 @@ void dmr_recorder::initialize(Source *src) {

squelch = gr::analog::pwr_squelch_cc::make(squelch_db, 0.0001, 0, true);



connect(cutoff_filter, 0, squelch, 0);
connect(squelch, 0, pll_freq_lock, 0);
connect(pll_freq_lock, 0, pll_amp, 0);
Expand Down
5 changes: 0 additions & 5 deletions trunk-recorder/recorders/p25_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ p25_recorder::DecimSettings p25_recorder::get_decim(long speed) {
}
void p25_recorder::initialize_prefilter() {
double phase1_channel_rate = phase1_symbol_rate * phase1_samples_per_symbol;
double phase2_channel_rate = phase2_symbol_rate * phase2_samples_per_symbol;
long if_rate = phase1_channel_rate;
long fa = 0;
long fb = 0;
Expand Down Expand Up @@ -158,7 +157,6 @@ void p25_recorder::initialize(Source *src) {
qpsk_mod = true;
silence_frames = source->get_silence_frames();
squelch_db = 0;

talkgroup = 0;
d_phase2_tdma = false;
rec_num = rec_counter++;
Expand Down Expand Up @@ -207,9 +205,6 @@ void p25_recorder::switch_tdma(bool phase2) {
double phase1_channel_rate = phase1_symbol_rate * phase1_samples_per_symbol;
double phase2_channel_rate = phase2_symbol_rate * phase2_samples_per_symbol;
long if_rate = phase1_channel_rate;
double omega;
double fmax;
const double pi = M_PI;

if (phase2) {
d_phase2_tdma = true;
Expand Down
4 changes: 1 addition & 3 deletions trunk-recorder/recorders/p25_recorder_qpsk_demod.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,8 @@ class p25_recorder_qpsk_demod : public gr::hier_block2 {
double system_channel_rate;
double symbol_rate;
int samples_per_symbol;
const int phase1_samples_per_symbol = 5;
const int phase2_samples_per_symbol = 4;
const double phase1_symbol_rate = 4800;
const double phase2_symbol_rate = 6000;


std::vector<float> baseband_noise_filter_taps;
std::vector<float> sym_taps;
Expand Down
1 change: 0 additions & 1 deletion trunk-recorder/recorders/sigmf_recorder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ bool sigmf_recorder::start(Call *call) {
timestamp = time(NULL);
starttime = time(NULL);
int nchars;
time_t now = time(NULL);
tm *ltm = localtime(&starttime);

talkgroup = call->get_talkgroup();
Expand Down
1 change: 0 additions & 1 deletion trunk-recorder/recorders/sigmf_recorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ class sigmf_recorder : public gr::hier_block2, public Recorder {

private:
double center, freq;
bool qpsk_mod;
int silence_frames;
long talkgroup;
time_t timestamp;
Expand Down
16 changes: 4 additions & 12 deletions trunk-recorder/systems/p25_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ std::vector<TrunkMessage> P25Parser::decode_mbt_data(unsigned long opcode, boost

std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk, unsigned long nac, int sys_num) {
// self.stats['tsbks'] += 1
long updated = 0;
std::vector<TrunkMessage> messages;
TrunkMessage message;
std::ostringstream os;
Expand Down Expand Up @@ -323,13 +322,6 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
unsigned long f1 = channel_id_to_frequency(ch1, sys_num);
unsigned long f2 = channel_id_to_frequency(ch2, sys_num);

if (f1) {
updated += 1;
}

if (f2) {
updated += 1;
}
message.message_type = UPDATE;
message.freq = f1;
message.talkgroup = ga1;
Expand Down Expand Up @@ -658,14 +650,14 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
} else if (opcode == 0x30) {
unsigned long mfrid = bitset_shift_mask(tsbk, 80, 0xff);
if (mfrid == 0xA4) { // GRG_EXENC_CMD (M/A-COM patch)
unsigned long grg_t = bitset_shift_mask(tsbk, 79, 0x1);
//unsigned long grg_t = bitset_shift_mask(tsbk, 79, 0x1);
unsigned long grg_g = bitset_shift_mask(tsbk, 28, 0x1);
unsigned long grg_a = bitset_shift_mask(tsbk, 77, 0x01);
unsigned long grg_ssn = bitset_shift_mask(tsbk, 72, 0x1f); //TODO: SSN should be stored and checked
//unsigned long grg_ssn = bitset_shift_mask(tsbk, 72, 0x1f); //TODO: SSN should be stored and checked
unsigned long sg = bitset_shift_mask(tsbk, 56, 0xffff);
unsigned long keyid = bitset_shift_mask(tsbk, 40, 0xffff);
//unsigned long keyid = bitset_shift_mask(tsbk, 40, 0xffff);
unsigned long rta = bitset_shift_mask(tsbk, 16, 0xffffff);
unsigned long algid = (rta >> 16) & 0xff;
//unsigned long algid = (rta >> 16) & 0xff;
unsigned long ga = rta & 0xffff;
if (grg_a == 1){ // Activate
if (grg_g == 1){ // Group request
Expand Down
1 change: 0 additions & 1 deletion trunk-recorder/systems/smartnet_decode.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ int smartnet_decode::work(int noutput_items,

uint64_t abs_sample_cnt = nitems_read(0);
std::vector<gr::tag_t> preamble_tags;

uint64_t outlen = 0; //output sample count

get_tags_in_range(preamble_tags, 0, abs_sample_cnt, abs_sample_cnt + size, pmt::string_to_symbol("smartnet_preamble"));
Expand Down
1 change: 0 additions & 1 deletion trunk-recorder/talkgroups.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,6 @@ void Talkgroups::load_channels(std::string filename) {

int lines_read = 0;
int lines_pushed = 0;
int priority = 1;

while (!safeGetline(in, line).eof()) // this works with \r, \n, or \r\n
{
Expand Down

0 comments on commit dd3e6bf

Please sign in to comment.