Add Tamper Flags to ERT RX display and meter ID to log file (#1707)

This commit is contained in:
Mark Thompson 2024-01-03 13:17:33 -06:00 committed by GitHub
parent 58bf60695d
commit 715a2dd448
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 39 additions and 15 deletions

View file

@ -82,6 +82,19 @@ CommodityType Packet::commodity_type() const {
return invalid_commodity_type;
}
TamperFlags Packet::tamper_flags() const {
if (type() == Type::SCM) {
return (reader_.read(9, 2) << 4) | reader_.read(3, 2); // Physical/Encoder tamper flags in lower/upper nibbles
}
if (type() == Type::SCMPLUS) {
return reader_.read(10 * 8, 16);
}
if (type() == Type::IDM) {
return reader_.read(11 * 8, 48);
}
return invalid_tamper_flags;
}
FormattedSymbols Packet::symbols_formatted() const {
return format_symbols(decoder_);
}