Fix the vtpro datetime parsing

For the BCD encoded day field (range 1-31), two bits are sufficient to
represent the upper digit (range 0-3). The purpose of the highest bit is
unknown, but it's certainly not part of the day field, and needs to be
masked off.
This commit is contained in:
Nick Shore 2020-01-28 08:17:28 +01:00 committed by Jef Driesen
parent f65e3cf39e
commit ba96b3092d

View File

@ -129,7 +129,7 @@ oceanic_vtpro_parser_get_datetime (dc_parser_t *abstract, dc_datetime_t *datetim
else
datetime->year = bcd2dec (((p[32 + 3] & 0xC0) >> 2) + ((p[32 + 2] & 0xF0) >> 4)) + 2000;
datetime->month = (p[4] & 0xF0) >> 4;
datetime->day = bcd2dec (p[3]);
datetime->day = bcd2dec (p[3] & 0x7F);
datetime->hour = bcd2dec (p[1] & 0x7F);
pm = p[1] & 0x80;
}