Some more fixes for the new Mares Genius firmware
The changes in commit 5cb527d53ca88ac692beb55288172fc1003975fa to support the new Mares Genius firmware v01.02.00 were incomplete. For dives recorded prior to the firmware upgrade, only the header version changed from 0.0 to 1.1, while the profile version remained the same. But for dives recorded after the firmware upgrade, the profile version also changed from 0.2 to 1.0. The known header and profile object versions (indicated as type.major.minor) are now: Model | Firmware | Header | Profile ========|==========|========|========= Genius | 1.0.x | 1.0.0 | 0.0.2 Genius | 1.2.0 | 1.1.1 | 0.1.0 Horizon | 1.7.28 | 1.0.1 | 1.0.2 To simplify the object version check, all versions below a certain upper limit are now considered supported.
This commit is contained in:
parent
5bb6257acb
commit
927362354d
@ -31,6 +31,10 @@
|
|||||||
|
|
||||||
#define ISINSTANCE(parser) dc_parser_isinstance((parser), &mares_iconhd_parser_vtable)
|
#define ISINSTANCE(parser) dc_parser_isinstance((parser), &mares_iconhd_parser_vtable)
|
||||||
|
|
||||||
|
#define OBJVERSION(major,minor) ( \
|
||||||
|
(((major) & 0xFF) << 8) | \
|
||||||
|
((minor) & 0xFF))
|
||||||
|
|
||||||
#define SMART 0x000010
|
#define SMART 0x000010
|
||||||
#define SMARTAPNEA 0x010010
|
#define SMARTAPNEA 0x010010
|
||||||
#define ICONHD 0x14
|
#define ICONHD 0x14
|
||||||
@ -374,7 +378,7 @@ mares_genius_cache (mares_iconhd_parser_t *parser)
|
|||||||
unsigned int type = array_uint16_le (data);
|
unsigned int type = array_uint16_le (data);
|
||||||
unsigned int minor = data[2];
|
unsigned int minor = data[2];
|
||||||
unsigned int major = data[3];
|
unsigned int major = data[3];
|
||||||
if (type != 1 || major > 1 || minor > 1) {
|
if (type != 1 || OBJVERSION(major,minor) > OBJVERSION(1,1)) {
|
||||||
ERROR (abstract->context, "Unsupported object type (%u) or version (%u.%u).",
|
ERROR (abstract->context, "Unsupported object type (%u) or version (%u.%u).",
|
||||||
type, major, minor);
|
type, major, minor);
|
||||||
return DC_STATUS_DATAFORMAT;
|
return DC_STATUS_DATAFORMAT;
|
||||||
@ -875,7 +879,9 @@ mares_iconhd_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callback_t
|
|||||||
unsigned int type = array_uint16_le (data);
|
unsigned int type = array_uint16_le (data);
|
||||||
unsigned int minor = data[2];
|
unsigned int minor = data[2];
|
||||||
unsigned int major = data[3];
|
unsigned int major = data[3];
|
||||||
if (type > 1 || major != 0 || minor != 2) {
|
if (type > 1 ||
|
||||||
|
(type == 0 && OBJVERSION(major,minor) > OBJVERSION(1,0)) ||
|
||||||
|
(type == 1 && OBJVERSION(major,minor) > OBJVERSION(0,2))) {
|
||||||
ERROR (abstract->context, "Unsupported object type (%u) or version (%u.%u).",
|
ERROR (abstract->context, "Unsupported object type (%u) or version (%u.%u).",
|
||||||
type, major, minor);
|
type, major, minor);
|
||||||
return DC_STATUS_DATAFORMAT;
|
return DC_STATUS_DATAFORMAT;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user