Fix the Aeris 500AI serial number.

The Aeris 500AI serial number appears to be located at a slightly
different offset, and with an unusual encoding. It's a BCD encoded
number, but with the digits of each byte swapped.
This commit is contained in:
Jef Driesen 2016-08-07 21:30:40 +02:00
parent 00c2705786
commit 9e585a9525
2 changed files with 7 additions and 2 deletions

View File

@ -646,8 +646,13 @@ oceanic_common_device_foreach (dc_device_t *abstract, dc_dive_callback_t callbac
devinfo.firmware = 0;
if (layout->pt_mode_serial == 0)
devinfo.serial = bcd2dec (id[10]) * 10000 + bcd2dec (id[11]) * 100 + bcd2dec (id[12]);
else
else if (layout->pt_mode_serial == 1)
devinfo.serial = id[11] * 10000 + id[12] * 100 + id[13];
else
devinfo.serial =
(id[11] & 0x0F) * 100000 + ((id[11] & 0xF0) >> 4) * 10000 +
(id[12] & 0x0F) * 1000 + ((id[12] & 0xF0) >> 4) * 100 +
(id[13] & 0x0F) * 10 + ((id[13] & 0xF0) >> 4) * 1;
device_event_emit (abstract, DC_EVENT_DEVINFO, &devinfo);
// Memory buffer for the logbook data.

View File

@ -127,7 +127,7 @@ static const oceanic_common_layout_t aeris_500ai_layout = {
0x20000, /* rb_profile_end */
0, /* pt_mode_global */
1, /* pt_mode_logbook */
0, /* pt_mode_serial */
2, /* pt_mode_serial */
};
static dc_status_t