diff --git a/firmware/application/app_ais.cpp b/firmware/application/app_ais.cpp index a7711818..b222e611 100644 --- a/firmware/application/app_ais.cpp +++ b/firmware/application/app_ais.cpp @@ -130,23 +130,6 @@ struct PacketTooLong { } }; -struct CRCCheck { - bool operator()(const ::Packet& packet) { - const size_t fcs_length = 16; - const size_t data_and_fcs_length = packet.size() - 7; - const size_t data_length = data_and_fcs_length - fcs_length; - - CRCFieldReader field_crc { packet }; - CRC ais_fcs { 0x1021, 0xffff, 0xffff }; - - for(size_t i=0; i(field_.read(start_bit, 28) << 4) / 16; } +bool Packet::crc_ok() const { + CRCFieldReader field_crc { packet_ }; + CRC ais_fcs { 0x1021, 0xffff, 0xffff }; + + for(size_t i=0; i