Skip to content

Commit

Permalink
revert and fix (#870)
Browse files Browse the repository at this point in the history
  • Loading branch information
taclane authored Nov 16, 2023
1 parent 06b911c commit 947b5d0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions trunk-recorder/systems/p25_parser.cc
Original file line number Diff line number Diff line change
Expand Up @@ -973,13 +973,13 @@ std::vector<TrunkMessage> P25Parser::parse_message(gr::message::sptr msg, System

// # nac is always 1st two bytes
// ac = (ord(s[0]) << 8) + ord(s[1])
uint16_t s0 = (int)s[0];
uint16_t s1 = (int)s[1];
uint8_t s0 = (int)s[0];
uint8_t s1 = (int)s[1];
int shift = s0 << 8;
long nac = shift + s1;

if (s.length() < 2) {
BOOST_LOG_TRIVIAL(error) << "P25 Parse error, s: " << s << " s0: " << s0 << " s1: " << s1 << " shift: " << shift << " nac: " << nac << " type: " << type << " Len: " << s.length();
BOOST_LOG_TRIVIAL(error) << "P25 Parse error, s: " << s << " s0: " << static_cast<int>(s0) << " s1: " << static_cast<int>(s1) << " shift: " << shift << " nac: " << nac << " type: " << type << " Len: " << s.length();
messages.push_back(message);
return messages;
}
Expand Down

0 comments on commit 947b5d0

Please sign in to comment.