mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-20 08:57:46 +00:00
Consolidate AIS Packet types.
This commit is contained in:
@@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
namespace ais {
|
namespace ais {
|
||||||
|
|
||||||
using CRCFieldReader = ::FieldReader<baseband::Packet, BitRemapNone>;
|
|
||||||
|
|
||||||
struct PacketLengthRange {
|
struct PacketLengthRange {
|
||||||
constexpr PacketLengthRange(
|
constexpr PacketLengthRange(
|
||||||
) : min_bytes { 0 },
|
) : min_bytes { 0 },
|
||||||
@@ -190,7 +188,7 @@ Longitude Packet::longitude(const size_t start_bit) const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool Packet::crc_ok() const {
|
bool Packet::crc_ok() const {
|
||||||
CRCFieldReader field_crc { packet_ };
|
CRCReader field_crc { packet_ };
|
||||||
CRC<uint16_t> ais_fcs { 0x1021, 0xffff, 0xffff };
|
CRC<uint16_t> ais_fcs { 0x1021, 0xffff, 0xffff };
|
||||||
|
|
||||||
for(size_t i=0; i<data_length(); i+=8) {
|
for(size_t i=0; i<data_length(); i+=8) {
|
||||||
|
@@ -82,6 +82,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
using Reader = FieldReader<baseband::Packet, BitRemapByteReverse>;
|
using Reader = FieldReader<baseband::Packet, BitRemapByteReverse>;
|
||||||
|
using CRCReader = FieldReader<baseband::Packet, BitRemapNone>;
|
||||||
|
|
||||||
const baseband::Packet packet_;
|
const baseband::Packet packet_;
|
||||||
const rtc::RTC received_at_;
|
const rtc::RTC received_at_;
|
||||||
|
Reference in New Issue
Block a user