I dropped the rEvo from the subject since it has nothing to do with the discussion at hand.
I suspect that their software is reading the response line by line, using the \r\n sequence as the end-of-line marker. And then that 'End' followed by '@@' as the end-of-message marker. That probably also explains why they are reading single bytes: they have to inspect every byte to find for those markers.
Yeah, and I've updated now the github repository with a version that does something similar (when using the universal-command).
FWIW I noticed that not all my changes were pushed to github, git is also new to me and I need to remember to do the 'git push' after the 'git commit...'.
So what the vms_sentinel_device_dump currently does is send 'M' to the rebreather, which should get a response of listing all the dive headers. I read the data one byte at a time, and look at the end of the data-buffer in search for a) line ends '\r\n', dive header separators 'd\r\n' as well as end of the whole list '@@P'. It seems to do a reasonable job of this.
I run the following command:
examples/universal -b sentinel -l ../logs/sentinel-`date '+%Y-%m-%d-%H%M%S'`.log -d ../logs/dives-`date '+%Y-%m-%d-%H%M%S'`.log /dev/ttyUSB0 | tee ../logs/output-`date '+%Y-%m-%d-%H%M%S'`.log
And I've uploaded the logs of the last successful run here:
http://poltsi.fi/Sukeltaminen/Sentinel/sentinel_logs-2016-01-30-000659.tar.g...
At the end of the output-file (search for 'Data is') I print out the data-buffer which looks pretty ok
How does the response looks like when it fails? Do you still get the P bytes?
It only continues sending the P character.
What is the real purpose of the *_device_dump?
Currently I have used it as a convenient playground for my exploration, as it is called from the universal, but I guess it has some real function too?
I have insofar not been able to detect any command that would dump everything in the rebreather memory.
I guess the next step would be to be to actually store the list of dives somewhere, but it's not clear to me where that happens?
Since I used cressi_leonard as a base, it no longer works as a template since the devices differ too much.
Poltsi