Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trace log some repetitive P25 messages #896

Merged
merged 2 commits into from
Jan 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 19 additions & 18 deletions trunk-recorder/systems/p25_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ std::vector<TrunkMessage> P25Parser::decode_mbt_data(unsigned long opcode, boost
message.freq = 0;
message.opcode = opcode;

BOOST_LOG_TRIVIAL(debug) << "decode_mbt_data: $" << opcode;
BOOST_LOG_TRIVIAL(trace) << "decode_mbt_data: $" << opcode;
if (opcode == 0x0) { // grp voice channel grant
// unsigned long mfrid = bitset_shift_mask(header, 72, 0xff);
unsigned long ch1 = bitset_shift_mask(mbt_data, 64, 0xffff);
Expand Down Expand Up @@ -198,7 +198,7 @@ std::vector<TrunkMessage> P25Parser::decode_mbt_data(unsigned long opcode, boost
message.sys_site_id = stid;
os << "mbt3a rfss status: syid: " << syid << " rfid " << rfid << " stid " << stid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ")";
message.meta = os.str();
BOOST_LOG_TRIVIAL(debug) << os.str();
BOOST_LOG_TRIVIAL(trace) << os.str();
} else if (opcode == 0x3b) { // network status
unsigned long wacn = bitset_shift_mask(mbt_data, 76, 0xfffff);
unsigned long syid = bitset_shift_mask(header, 48, 0xfff);
Expand All @@ -213,14 +213,14 @@ std::vector<TrunkMessage> P25Parser::decode_mbt_data(unsigned long opcode, boost
message.sys_id = syid;
message.freq = f1;
}
BOOST_LOG_TRIVIAL(debug) << "mbt3b net stat: wacn " << std::dec << wacn << " syid " << syid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ";
BOOST_LOG_TRIVIAL(trace) << "mbt3b net stat: wacn " << std::dec << wacn << " syid " << syid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ";
} else if (opcode == 0x3c) { // adjacent status
unsigned long syid = bitset_shift_mask(header, 48, 0xfff);
unsigned long rfid = bitset_shift_mask(header, 24, 0xff);
unsigned long stid = bitset_shift_mask(header, 16, 0xff);
unsigned long ch1 = bitset_shift_mask(mbt_data, 80, 0xffff);
unsigned long ch2 = bitset_shift_mask(mbt_data, 64, 0xffff);
BOOST_LOG_TRIVIAL(debug) << "mbt3c adjacent status "
BOOST_LOG_TRIVIAL(trace) << "mbt3c adjacent status "
<< "syid " << syid << " rfid " << rfid << " stid " << stid << " ch1 " << ch1 << " ch2 " << ch2;
} else if (opcode == 0x04) { // Unit to Unit Voice Service Channel Grant -Extended (UU_V_CH_GRANT)
// unsigned long mfrid = bitset_shift_mask(header, 80, 0xff);
Expand Down Expand Up @@ -297,7 +297,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
unsigned long ga1 = bitset_shift_mask(tsbk, 48, 0xffff);
unsigned long ga2 = bitset_shift_mask(tsbk, 32, 0xffff);
unsigned long ga3 = bitset_shift_mask(tsbk, 16, 0xffff);
BOOST_LOG_TRIVIAL(debug) << "tsbk00\tMoto Patch Add \tsg: " << sg << "\tga1: " << ga1 << "\tga2: " << ga2 << "\tga3: " << ga3;
BOOST_LOG_TRIVIAL(trace) << "tsbk00\tMoto Patch Add \tsg: " << sg << "\tga1: " << ga1 << "\tga2: " << ga2 << "\tga3: " << ga3;
message.message_type = PATCH_ADD;
PatchData moto_patch_data;
moto_patch_data.sg = sg;
Expand Down Expand Up @@ -596,7 +596,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
} else if (opcode == 0x15) {
BOOST_LOG_TRIVIAL(debug) << "tsbk15: SNDCP Data Page Request";
} else if (opcode == 0x16) {
BOOST_LOG_TRIVIAL(debug) << "tsbk16: SNDCP Data Channel Announcement -Explicit";
BOOST_LOG_TRIVIAL(trace) << "tsbk16: SNDCP Data Channel Announcement -Explicit";
} else if (opcode == 0x18) {
BOOST_LOG_TRIVIAL(debug) << "tsbk18: Status Update";
} else if (opcode == 0x1a) {
Expand Down Expand Up @@ -658,7 +658,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
os << "tsbk29 secondary cc: rfid " << std::dec << rfid << " stid " << stid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ch2 " << ch2 << "(" << channel_id_to_string(ch2, sys_num) << ") ";

message.meta = os.str();
BOOST_LOG_TRIVIAL(debug) << os.str();
BOOST_LOG_TRIVIAL(trace) << os.str();

} else if (opcode == 0x2a) { // Group Affiliation Query
BOOST_LOG_TRIVIAL(debug) << "tsbk2a Group Affiliation Query";
Expand Down Expand Up @@ -750,7 +750,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
}
}
} else {
BOOST_LOG_TRIVIAL(debug) << "tsbk30 TDMA SYNCHRONIZATION BROADCAST";
BOOST_LOG_TRIVIAL(trace) << "tsbk30 TDMA SYNCHRONIZATION BROADCAST";
}
} else if (opcode == 0x31) { //
BOOST_LOG_TRIVIAL(debug) << "tsbk31 AUTHENTICATION DEMAND";
Expand Down Expand Up @@ -787,7 +787,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
slots_per_carrier[channel_type], // tdma;
6.25};
add_channel(iden, temp_chan, sys_num);
BOOST_LOG_TRIVIAL(debug) << "tsbk33 iden up tdma id " << std::dec << iden << " f " << temp_chan.frequency << " offset " << temp_chan.offset << " spacing " << temp_chan.step << " slots/carrier " << temp_chan.slots_per_carrier;
BOOST_LOG_TRIVIAL(trace) << "tsbk33 iden up tdma id " << std::dec << iden << " f " << temp_chan.frequency << " offset " << temp_chan.offset << " spacing " << temp_chan.step << " slots/carrier " << temp_chan.slots_per_carrier;
}
} else if (opcode == 0x34) { // iden_up vhf uhf
unsigned long iden = bitset_shift_mask(tsbk, 76, 0xf);
Expand Down Expand Up @@ -819,15 +819,15 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
bandwidth};
add_channel(iden, temp_chan, sys_num);

BOOST_LOG_TRIVIAL(debug) << "tsbk34 iden vhf/uhf id " << std::dec << iden << " toff " << toff * spac * 0.125 * 1e-3 << " spac " << spac * 0.125 << " freq " << freq * 0.000005 << " [ " << txt[toff_sign] << "]";
BOOST_LOG_TRIVIAL(trace) << "tsbk34 iden vhf/uhf id " << std::dec << iden << " toff " << toff * spac * 0.125 * 1e-3 << " spac " << spac * 0.125 << " freq " << freq * 0.000005 << " [ " << txt[toff_sign] << "]";
} else if (opcode == 0x35) { // Time and Date Announcement
BOOST_LOG_TRIVIAL(debug) << "tsbk35 Time and Date Announcement";
} else if (opcode == 0x36) { //
BOOST_LOG_TRIVIAL(debug) << "tsbk36 ROAMING ADDRESS COMMAND";
} else if (opcode == 0x37) { //
BOOST_LOG_TRIVIAL(debug) << "tsbk37 ROAMING ADDRESS UPDATE";
} else if (opcode == 0x38) { //
BOOST_LOG_TRIVIAL(debug) << "tsbk38 SYSTEM SERVICE BROADCAST";
BOOST_LOG_TRIVIAL(trace) << "tsbk38 SYSTEM SERVICE BROADCAST";
} else if (opcode == 0x39) { // secondary cc
unsigned long rfid = bitset_shift_mask(tsbk, 72, 0xff);
unsigned long stid = bitset_shift_mask(tsbk, 64, 0xff);
Expand All @@ -849,7 +849,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
}
os << "tsbk39 secondary cc: rfid " << std::dec << rfid << " stid " << stid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ch2 " << ch2 << "(" << channel_id_to_string(ch2, sys_num) << ") ";
message.meta = os.str();
BOOST_LOG_TRIVIAL(debug) << os.str();
BOOST_LOG_TRIVIAL(trace) << os.str();
} else if (opcode == 0x3a) { // rfss status
unsigned long syid = bitset_shift_mask(tsbk, 56, 0xfff);
unsigned long rfid = bitset_shift_mask(tsbk, 48, 0xff);
Expand All @@ -861,7 +861,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
message.sys_site_id = stid;
os << "tsbk3a rfss status: syid: " << syid << " rfid " << rfid << " stid " << stid << " ch1 " << chan << "(" << channel_id_to_string(chan, sys_num) << ")";
message.meta = os.str();
BOOST_LOG_TRIVIAL(debug) << os.str();
BOOST_LOG_TRIVIAL(trace) << os.str();
} else if (opcode == 0x3b) { // network status
unsigned long wacn = bitset_shift_mask(tsbk, 52, 0xfffff);
unsigned long syid = bitset_shift_mask(tsbk, 40, 0xfff);
Expand All @@ -874,13 +874,13 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
message.sys_id = syid;
message.freq = f1;
}
BOOST_LOG_TRIVIAL(debug) << "tsbk3b net stat: wacn " << std::dec << wacn << " syid " << syid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ";
BOOST_LOG_TRIVIAL(trace) << "tsbk3b net stat: wacn " << std::dec << wacn << " syid " << syid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ";
} else if (opcode == 0x3c) { // adjacent status
unsigned long rfid = bitset_shift_mask(tsbk, 48, 0xff);
unsigned long stid = bitset_shift_mask(tsbk, 40, 0xff);
unsigned long ch1 = bitset_shift_mask(tsbk, 24, 0xffff);
unsigned long f1 = channel_id_to_frequency(ch1, sys_num);
BOOST_LOG_TRIVIAL(debug) << "tsbk3c\tAdjacent Status\t rfid " << std::dec << rfid << " stid " << stid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ";
BOOST_LOG_TRIVIAL(trace) << "tsbk3c\tAdjacent Status\t rfid " << std::dec << rfid << " stid " << stid << " ch1 " << ch1 << "(" << channel_id_to_string(ch1, sys_num) << ") ";

if (f1) {
it = channels[stid].find((ch1 >> 12) & 0xf);
Expand All @@ -891,7 +891,7 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
// self.adjacent[f1] = 'rfid: %d stid:%d uplink:%f
// tbl:%d' % (rfid, stid, (f1 + self.freq_table[table]['offset']) /
// 1000000.0, table)
BOOST_LOG_TRIVIAL(debug) << "\ttsbk3c Chan " << temp_chan.frequency << " " << temp_chan.step;
BOOST_LOG_TRIVIAL(trace) << "\ttsbk3c Chan " << temp_chan.frequency << " " << temp_chan.step;
}
}
} else if (opcode == 0x3d) { // iden_up
Expand All @@ -916,9 +916,9 @@ std::vector<TrunkMessage> P25Parser::decode_tsbk(boost::dynamic_bitset<> &tsbk,
1, // slots
bw * .125};
add_channel(iden, temp_chan, sys_num);
BOOST_LOG_TRIVIAL(debug) << "tsbk3d iden id " << std::dec << iden << " toff " << toff * 0.25 << " spac " << spac * 0.125 << " freq " << freq * 0.000005;
BOOST_LOG_TRIVIAL(trace) << "tsbk3d iden id " << std::dec << iden << " toff " << toff * 0.25 << " spac " << spac * 0.125 << " freq " << freq * 0.000005;
} else {
BOOST_LOG_TRIVIAL(debug) << "tsbk other " << std::hex << opcode;
BOOST_LOG_TRIVIAL(trace) << "tsbk other " << std::hex << opcode;
return messages;
}
messages.push_back(message);
Expand Down Expand Up @@ -1075,3 +1075,4 @@ std::vector<TrunkMessage> P25Parser::parse_message(gr::message::sptr msg, System
messages.push_back(message);
return messages;
}

2 changes: 1 addition & 1 deletion trunk-recorder/systems/system_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,7 @@ void System_impl::update_active_talkgroup_patches(PatchData patch_data) {
}
if (new_flag == true) {
// TGIDs from the Message were not found in an existing patch, so add them to a new one
// BOOST_LOG_TRIVIAL(debug) << "Adding a new patch";
BOOST_LOG_TRIVIAL(debug) << "tsbk00\tNew Motorola patch fround, \tsg: " << patch_data.sg << "\tga1: " << patch_data.ga1 << "\tga2: " << patch_data.ga2 << "\tga3: " << patch_data.ga3;
std::map<unsigned long, std::time_t> new_patch;
if (0 != patch_data.sg) {
new_patch[patch_data.sg] = update_time;
Expand Down
Loading