diff --git a/src/divesystem_idive_parser.c b/src/divesystem_idive_parser.c index 073f4987..0e98d892 100644 --- a/src/divesystem_idive_parser.c +++ b/src/divesystem_idive_parser.c @@ -60,7 +60,7 @@ #define REC_SAMPLE 0 #define REC_INFO 1 -#define REC_SAMPLE_APOS5_COMPAT 0x8006 +#define REC_SAMPLE_APOS5_COMPAT 0x8000 typedef struct divesystem_idive_parser_t divesystem_idive_parser_t; @@ -467,10 +467,10 @@ divesystem_idive_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba unsigned int type = ISIX3M(parser->model) ? array_uint16_le (data + offset + 52) : REC_SAMPLE; - // AI-generated (Claude) - // APOS5 uses 0x8006 for ordinary profile samples. Keep this alias - // narrow until the record type is confirmed by the vendor. - if (firmware_major >= 5 && type == REC_SAMPLE_APOS5_COMPAT) + // APOS5 firmware uses various record type values for ordinary + // profile samples (0x8006, 0x800E observed). The high bit 0x8000 + // appears to flag sample records in APOS5. + if (firmware_major >= 5 && (type & REC_SAMPLE_APOS5_COMPAT)) type = REC_SAMPLE; if (type != REC_SAMPLE) { if (type == REC_INFO) {