The mingw native 64bit integer type is long long. The msvc __int64 type
is supported for compatibility reasons, but requires including one of
the standard C header files.
The internal memory appears to contain two separate areas. One for the
normal dives and one for the freedives. Currently, only the freedive
section is processed.
If the first few bytes of the timestamp are equal to zero, they were
incorrectly identified as part of the header marker. The correct header
marker is located a the start of this zero byte sequence, not the end.
Because the sample data contains a timestamp with a limited resolution
of only one minute, there can be consecutive samples with identical
timestamps. To deal with this situation, samples with identical
timestamps are distributed evenly inside the one minute interval. All
resulting non-integer timestamps are rounded to the nearest second.
For dives with a time based interval, the timestamps are now validated.
Not all devices appear to send the last zero byte, resulting in a
timeout. If a device does send this zero byte, it is automatically
flushed when sending the next command.
When the Sensus Ultra reaches the end of a memory page while recording
data, the next page is erased to all 0xFF, and the current page cursor
is advanced. With this memory usage scheme, the last page will be empty
if the previous one was just filled.
The Geo 2 appears to respond with a single NAK byte instead of three.
The issue is fixed by expecting only a single byte, and flushing the
serial line to discard all other bytes (if there are any).
To be able to cancel an operation, an application should register a
callback function that returns a non-zero value whenever the active
operaton should be cancelled. A backend can invoke this callback function
to query the application for a pending cancellation request.