mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-02-04 08:55:21 -05:00
Consolidate AIS Packet types.
This commit is contained in:
parent
3e0acc9988
commit
644d3837ff
@ -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_;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user