mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-13 21:11:02 +00:00
Add Tamper Flags to ERT RX display and meter ID to log file (#1707)
This commit is contained in:
@@ -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_);
|
||||
}
|
||||
|
@@ -34,10 +34,12 @@ namespace ert {
|
||||
using ID = uint32_t;
|
||||
using Consumption = uint32_t;
|
||||
using CommodityType = uint32_t;
|
||||
using TamperFlags = uint32_t;
|
||||
|
||||
constexpr ID invalid_id = 0;
|
||||
constexpr CommodityType invalid_commodity_type = -1;
|
||||
constexpr Consumption invalid_consumption = 0;
|
||||
constexpr TamperFlags invalid_tamper_flags = 0;
|
||||
|
||||
class Packet {
|
||||
public:
|
||||
@@ -67,6 +69,7 @@ class Packet {
|
||||
ID id() const;
|
||||
CommodityType commodity_type() const;
|
||||
Consumption consumption() const;
|
||||
TamperFlags tamper_flags() const;
|
||||
|
||||
FormattedSymbols symbols_formatted() const;
|
||||
|
||||
|
Reference in New Issue
Block a user