Hello -
I'm having an issue downloading dives from my Mares Quad Air in Subsurface, so I tried to see what I could find out more directly with libdivecomputer. The only issue I've found with libdivecomputer is the inability to parse a dump file for the Quad Air. I don't think this is related to my Subsurface issue, but figured I'd flag it anyway.
I have downloaded and built livdivecomputer on OS X (10.13.4).
I generated the attached dump file with:
./dctool -f iconhd -m 35 dump -o mares_quad_air.dump /dev/tty.SLAB_USBtoUART > dctool.log 2>&1
Parsing of the dump file fails:
./dctool -f iconhd -m 35 parse -o mares_quad_air_parsed.xml mares_quad_air.dump Creating the parser. Registering the data. Parsing the dive data. Parsing the datetime. ERROR: Buffer overflow detected! [in mares_iconhd_parser.c:149 (mares_iconhd_parser_cache)] ERROR: Error parsing the datetime. [in output_xml.c:229 (dctool_xml_output_write)] ERROR: Error parsing the dive data. [in dctool_parse.c:73 (parse)] ERROR: Data format error
However, direct download of dives works (dive download attached):
$ ./dctool -f iconhd -m 35 download -o mares_quad_air_dives.xml /dev/tty.SLAB_USBtoUART
I see that dctool_parse calls dc_parser_new2 while dctool_download calls dc_parser_new.
Am I wrong in thinking that dctool should be able to parse the dump file and produce the same results as a direct download?
Regards, Rick
On 2018-06-11 06:56, Rick Balsano wrote:
I'm having an issue downloading dives from my Mares Quad Air in Subsurface, so I tried to see what I could find out more directly with libdivecomputer. The only issue I've found with libdivecomputer is the inability to parse a dump file for the Quad Air. I don't think this is related to my Subsurface issue, but figured I'd flag it anyway.
I have downloaded and built livdivecomputer on OS X (10.13.4).
I generated the attached dump file with:
./dctool -f iconhd -m 35 dump -o mares_quad_air.dump /dev/tty.SLAB_USBtoUART > dctool.log 2>&1
Parsing of the dump file fails:
./dctool -f iconhd -m 35 parse -o mares_quad_air_parsed.xml mares_quad_air.dump Creating the parser. Registering the data. Parsing the dive data. Parsing the datetime. ERROR: Buffer overflow detected! [in mares_iconhd_parser.c:149 (mares_iconhd_parser_cache)] ERROR: Error parsing the datetime. [in output_xml.c:229 (dctool_xml_output_write)] ERROR: Error parsing the dive data. [in dctool_parse.c:73 (parse)] ERROR: Data format error
However, direct download of dives works (dive download attached):
$ ./dctool -f iconhd -m 35 download -o mares_quad_air_dives.xml /dev/tty.SLAB_USBtoUART
I see that dctool_parse calls dc_parser_new2 while dctool_download calls dc_parser_new.
Am I wrong in thinking that dctool should be able to parse the dump file and produce the same results as a direct download?
Yes and no. The dctool parse command expects a single dive, not a full memory dump.
You can download the individual dives as follows:
./dctool -l dctool.log -f iconhd -m 35 download -o dive.%n.bin -f raw /dev/tty.SLAB_USBtoUART
And then the parse them with:
./dctool -l dctool.log -f iconhd -m 35 parse -o mares_quad_air_parsed.xml dive.*.bin
This produces the same result as doing both steps at once with:
./dctool -l dctool.log -f iconhd -m 35 download -o mares_quad_air_parsed.xml /dev/tty.SLAB_USBtoUART
To be able to use a memory dump, you'll need the libdivecomputer simulator:
https://libdivecomputer.org/simulator.html
Jef