mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-24 08:21:22 +00:00
Clean up FieldReader and BitRemap types.
This commit is contained in:
@@ -33,13 +33,7 @@ using namespace portapack;
|
||||
namespace baseband {
|
||||
namespace ais {
|
||||
|
||||
struct CRCBitRemap {
|
||||
constexpr size_t operator()(const size_t& bit_index) const {
|
||||
return bit_index;
|
||||
}
|
||||
};
|
||||
|
||||
using CRCFieldReader = ::FieldReader<::Packet, CRCBitRemap>;
|
||||
using CRCFieldReader = ::FieldReader<::Packet, BitRemapNone>;
|
||||
|
||||
struct PacketLengthRange {
|
||||
constexpr PacketLengthRange(
|
||||
|
@@ -43,14 +43,6 @@ using namespace lpc43xx;
|
||||
namespace baseband {
|
||||
namespace ais {
|
||||
|
||||
struct BitRemap {
|
||||
constexpr size_t operator()(const size_t bit_index) const {
|
||||
return bit_index ^ 7;
|
||||
}
|
||||
};
|
||||
|
||||
using FieldReader = ::FieldReader<::Packet, BitRemap>;
|
||||
|
||||
struct DateTime {
|
||||
uint16_t year;
|
||||
uint8_t month;
|
||||
@@ -98,9 +90,11 @@ public:
|
||||
bool crc_ok() const;
|
||||
|
||||
private:
|
||||
using Reader = FieldReader<::Packet, BitRemapByteReverse>;
|
||||
|
||||
const ::Packet packet_;
|
||||
const rtc::RTC received_at_;
|
||||
const FieldReader field_;
|
||||
const Reader field_;
|
||||
|
||||
const size_t fcs_length = 16;
|
||||
|
||||
|
@@ -38,12 +38,6 @@ using namespace lpc43xx;
|
||||
|
||||
namespace ert {
|
||||
|
||||
struct BitRemap {
|
||||
constexpr size_t operator()(const size_t bit_index) const {
|
||||
return bit_index;
|
||||
}
|
||||
};
|
||||
|
||||
using ID = uint32_t;
|
||||
using Consumption = uint32_t;
|
||||
|
||||
@@ -76,7 +70,7 @@ public:
|
||||
bool crc_ok() const;
|
||||
|
||||
private:
|
||||
using Reader = FieldReader<ManchesterDecoder, BitRemap>;
|
||||
using Reader = FieldReader<ManchesterDecoder, BitRemapNone>;
|
||||
|
||||
const ::Packet packet_;
|
||||
const rtc::RTC received_at_;
|
||||
|
Reference in New Issue
Block a user