Add basic ERT (OOK) utility meter reception.

Extracted the Manchester formatting function for use in ERT, now also returns an indication of bits in error.
This commit is contained in:
Jared Boone 2015-12-01 11:24:48 -08:00
parent 0c36a74351
commit 82ff45860e
8 changed files with 329 additions and 8 deletions

View file

@ -46,6 +46,7 @@ public:
TPMSPacket = 6,
Shutdown = 8,
AISPacket = 7,
ERTPacket = 9,
MAX
};
@ -240,6 +241,22 @@ public:
}
};
struct ERTPacket {
uint64_t preamble { 0 };
std::bitset<1024> payload;
size_t bits_received { 0 };
};
class ERTPacketMessage : public Message {
public:
constexpr ERTPacketMessage(
) : Message { ID::ERTPacket }
{
}
ERTPacket packet;
};
class MessageHandlerMap {
public:
using MessageHandler = std::function<void(Message* const p)>;