Fix the decoding of the OSTC4 firmware version.
The OSTC4 firmware version uses four digits for the firmware version (X.Y.Z.Beta), while all other hwOS models use two digits (X.Y). To preserve backwards compatibility with the existing two byte data format, the OSTC4 firmware version is packed into a 16 bit integer as follows: XXXX XYYY YYZZ ZZZB and stored with little endian byte order.
This commit is contained in:
parent
2829f7ebf9
commit
ff15b865b2
@ -595,7 +595,11 @@ hw_ostc3_device_foreach (dc_device_t *abstract, dc_dive_callback_t callback, voi
|
||||
|
||||
// Emit a device info event.
|
||||
dc_event_devinfo_t devinfo;
|
||||
devinfo.firmware = array_uint16_be (id + 2);
|
||||
if (device->hardware == OSTC4) {
|
||||
devinfo.firmware = array_uint16_le (id + 2);
|
||||
} else {
|
||||
devinfo.firmware = array_uint16_be (id + 2);
|
||||
}
|
||||
devinfo.serial = array_uint16_le (id + 0);
|
||||
if (device->hardware != UNKNOWN) {
|
||||
devinfo.model = device->hardware;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user