Clean up FieldReader and BitRemap types.

This commit is contained in:
Jared Boone
2015-12-08 14:15:15 -08:00
parent 31fdf026f2
commit 90a7327cd5
4 changed files with 20 additions and 23 deletions

View File

@@ -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(

View File

@@ -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;

View File

@@ -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_;