diff --git a/src/devices/tpms_gear_hive.c b/src/devices/tpms_gear_hive.c index 8367a002..48e7d47d 100644 --- a/src/devices/tpms_gear_hive.c +++ b/src/devices/tpms_gear_hive.c @@ -29,7 +29,7 @@ Differential XOR decode (seeded from sync byte 0x94): Data layout (nibbles): - CC CS II II II PP TT CK + CC CS II II II PP TT KK - C: 12 bit rolling counter (p[0] + p[1] high nibble) - S: 4 bit sensor class (p[1] low nibble) @@ -120,12 +120,11 @@ static int tmps_gear_hive_callback(r_device *decoder, bitbuffer_t *bitbuffer) { uint8_t const sync_pattern[] = {0x25, 0x94}; // 16 bits - unsigned bitpos = 0; - int ret = 0; - int events = 0; + int ret = 0; + int events = 0; for (int row = 0; row < bitbuffer->num_rows; ++row) { - bitpos = 0; + unsigned bitpos = 0; while ((bitpos = bitbuffer_search(bitbuffer, row, bitpos, sync_pattern, 16)) + 16 + 72 <= bitbuffer->bits_per_row[row]) { ret = tmps_gear_hive_decode(decoder, bitbuffer, row, bitpos); diff --git a/src/devices/tpms_nissan.c b/src/devices/tpms_nissan.c index f662c1c1..c48699da 100644 --- a/src/devices/tpms_nissan.c +++ b/src/devices/tpms_nissan.c @@ -9,13 +9,6 @@ the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ -/** -Nissan FSK 37 bit Manchester encoded checksummed TPMS data. - -Data format: - - MODE:3d TPMS_ID:24h (PSI+THREE)*FOUR=8d UNKNOWN:2b -*/ #include "decoder.h" @@ -37,6 +30,13 @@ static uint8_t tpms_nissan_checksum(uint8_t const *b) return ~chk & 0x03; } +/** +Nissan FSK 37 bit Manchester encoded checksummed TPMS data. + +Data format: + + MODE:3d TPMS_ID:24h (PSI+THREE)*FOUR=8d UNKNOWN:2b +*/ static int tpms_nissan_decode(r_device *decoder, bitbuffer_t *bitbuffer, unsigned row, unsigned bitpos) { bitbuffer_t packet_bits = {0};