Invert TPMS Manchester decoding, fix dependent CRC/checksums.

This commit is contained in:
Jared Boone 2016-01-20 09:02:25 -08:00
parent 5e6a76dfe7
commit bd0ec913f5
2 changed files with 4 additions and 4 deletions

View File

@ -63,9 +63,9 @@ size_t Packet::crc_valid_length() const {
bytes[i] = reader_.read(i * 8, 8);
}
uint32_t checksum = 6;
CRC<uint8_t> crc_72 { 0x01, 0xff };
CRC<uint8_t> crc_80 { 0x01, 0xff };
uint32_t checksum = 0;
CRC<uint8_t> crc_72 { 0x01, 0x00 };
CRC<uint8_t> crc_80 { 0x01, 0x00 };
for(size_t i=0; i<bytes.size(); i++) {
const uint32_t byte_mask = 1 << i;

View File

@ -123,7 +123,7 @@ public:
constexpr Packet(
const baseband::Packet& packet
) : packet_ { packet },
decoder_ { packet_, 1 },
decoder_ { packet_, 0 },
reader_ { decoder_ }
{
}