Mares Smart Apnea

Giorgio Marzano marzano.giorgio at gmail.com
Wed Sep 9 05:22:15 PDT 2015


By the way, what do the "fingerprint" field is ?

G


2015-09-09 14:18 GMT+02:00 Giorgio Marzano <marzano.giorgio at gmail.com>:

> I don't have access to any SMART memory dump, so I can't figure how to
> detect  the variant.
>
> I had only two ideas, but both of them are dirty hacks:
> - detect using the string compare in the mares_iconhd_get_model and set
> some flag
> - develop a separate backend
>
> G
>
> 2015-09-09 13:41 GMT+02:00 Jef Driesen <jef at libdivecomputer.org>:
>
>> On 2015-09-04 12:25, Giorgio Marzano wrote:
>>
>>> Right now, I noticed a bug in the mares_iconhd_get_model function, line
>>> 120
>>> of mares_iconhd.c, where sizeof should be actually strlen.
>>>
>>> if (memcmp (device->version + 0x46, models[i].name, /*sizeof*/ strlen
>>> (models[i].name) - 1) == 0) {
>>>
>>
>> This is not a bug. The name field is a 16 byte array, not a string. The
>> initialization with a sting literal is convenient. The remainder of the
>> array will automatically get padded with zero bytes, which is exactly what
>> we need.
>>
>> The correct fix is to add a new entry containing "Mares Smart". Then, the
>> next question is: what's the correct model number? According to the model
>> number in the memory dump (e.g. byte at offset 0), it's 0x10 or SMART:
>>
>>                 {"Smart",       SMART},
>> +               {"Smart Apnea", SMART},
>>                 {"Icon HD",     ICONHD},
>>
>> But then how do we distinguish the normal smart from the apnea variant?
>> That will be important, because both appear to use a different data format.
>> The strange thing here is that the normal smart already had a freedive
>> mode. The main difference is that we now not only get a summary of each
>> freedive in the session, but also a detailed profile.
>>
>> I wonder if there is some kind of format indicator in the header that we
>> can use to distinguish between dives with the enhanced apnea format and the
>> more limited normal format.
>>
>> Jef
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libdivecomputer.org/pipermail/devel/attachments/20150909/bfe4e600/attachment.html>


More information about the devel mailing list