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.
The handshake function is now called internally (even if it doesn't seem
to be required at all), and the version function can be called through
the public api. The format of the version data is changed too.
Trying to send the version command immediately after the initialization
of the data cable doesn't work very well. Adding a small delay before
sending the version commands turns out to be much more reliable.
When using the ringbuffer pointers to traverse the linked list, a full
ringbuffer appears as an empty one. This is probably a very rare
condition, but a very annoying one if you run into it it. Using byte
counts and the number of dives in the header avoids the problem.
In a ringbuffer implementation with only two begin/end pointers, it's
impossible to distinguish between an empty and a full ringbuffer. The
correct interpretation mode needs to be specified by the user.