Skip to content

Commit

Permalink
Merge pull request #810 from robotastic/cc-retune
Browse files Browse the repository at this point in the history
Fixes retuning the CC when it has to move to a new source
  • Loading branch information
robotastic authored May 10, 2023
2 parents 6b31523 + d6ef010 commit 093c9a0
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions trunk-recorder/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1356,22 +1356,18 @@ void retune_system(System *sys) {
// We must lock the flow graph in order to disconnect and reconnect blocks
tb->lock();
tb->disconnect(current_source->get_src_block(), 0, system->smartnet_trunking, 0);
system->smartnet_trunking = make_smartnet_trunking(control_channel_freq, source->get_center(), source->get_rate(), msg_queue, system->get_sys_num());
tb->connect(source->get_src_block(), 0, system->smartnet_trunking, 0);
tb->unlock();
system->smartnet_trunking->set_center(source->get_center());
system->smartnet_trunking->set_rate(source->get_rate());
system->smartnet_trunking->tune_freq(control_channel_freq);
system->smartnet_trunking->reset();
} else if (system->get_system_type() == "p25") {
system->set_source(source);
// We must lock the flow graph in order to disconnect and reconnect blocks
tb->lock();
tb->disconnect(current_source->get_src_block(), 0, system->p25_trunking, 0);
system->p25_trunking = make_p25_trunking(control_channel_freq, source->get_center(), source->get_rate(), msg_queue, system->get_qpsk_mod(), system->get_sys_num());
tb->connect(source->get_src_block(), 0, system->p25_trunking, 0);
tb->unlock();
system->p25_trunking->set_center(source->get_center());
system->p25_trunking->set_rate(source->get_rate());
system->p25_trunking->tune_freq(control_channel_freq);
} else {
BOOST_LOG_TRIVIAL(error) << "\t - Unkown system type for Retune";
}
Expand Down

0 comments on commit 093c9a0

Please sign in to comment.