mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-12-25 23:39:37 -05:00
Reinstate logging of ERT packets.
This commit is contained in:
parent
a2df8ea599
commit
f1b45d4e7f
@ -72,6 +72,10 @@ Consumption Packet::consumption() const {
|
|||||||
return invalid_consumption;
|
return invalid_consumption;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ManchesterFormatted Packet::symbols_formatted() const {
|
||||||
|
return format_manchester(decoder_);
|
||||||
|
}
|
||||||
|
|
||||||
bool Packet::crc_ok() const {
|
bool Packet::crc_ok() const {
|
||||||
if( type() == ERTPacket::Type::SCM ) {
|
if( type() == ERTPacket::Type::SCM ) {
|
||||||
CRC<uint16_t> ert_bch { 0x6f63 };
|
CRC<uint16_t> ert_bch { 0x6f63 };
|
||||||
@ -100,7 +104,12 @@ ERTModel::ERTModel() {
|
|||||||
log_file.open_for_append("ert.txt");
|
log_file.open_for_append("ert.txt");
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ERTModel::on_packet(const ert::Packet&) {
|
bool ERTModel::on_packet(const ert::Packet& packet) {
|
||||||
|
if( log_file.is_ready() ) {
|
||||||
|
const auto formatted = packet.symbols_formatted();
|
||||||
|
log_file.write_entry(packet.received_at(), formatted.data + "/" + formatted.errors);
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,6 +71,8 @@ public:
|
|||||||
ID id() const;
|
ID id() const;
|
||||||
Consumption consumption() const;
|
Consumption consumption() const;
|
||||||
|
|
||||||
|
ManchesterFormatted symbols_formatted() const;
|
||||||
|
|
||||||
bool crc_ok() const;
|
bool crc_ok() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Loading…
Reference in New Issue
Block a user