Reparsing data

Jef Driesen jef at libdivecomputer.org
Wed Mar 18 03:38:24 PDT 2015


On 2015-03-18 09:07, Shawn Willden wrote:
> Is there a convenient way (short of figuring out the API and writing a
> program... which I can do but I'd rather not) to parse a dump file?

Yes, that's possible with the simulator. Instructions and binaries can 
be found here:

http://libdivecomputer.org/simulator.html

On Linux (and Mac OS X) the setup is the easiest. Just install socat, 
and run the command:

socat PTY,link=/tmp/ttyS0 PTY,link=/tmp/ttyS1

Next, start the simulator with the following options:

./simulator -l simulator.log -p /tmp/ttyS1 -b aladin <memorydump>

Finally, rebuild libdivecomputer with the --enable-pty option, and run 
the application. Download dives from the simulator with /tmp/ttyS0 as 
the serial port. For example with the universal test app:

./universal -l aladin.log -d aladin.xml -b aladin /tmp/ttyS0

(Note that with the aladin protocol, the download is not initiated on 
the application side, but on the device side. So you may need to start 
the application before the simulator, or start the simulator with a 
delay using the -w <milliseconds> option.)

> I have managed to download from my old Uwatec Aladin Air Z, and most
> everything is good but I'm not getting gas consumption data. Looking at
> uwatec_memomouse_parser.c, it seems like the parser should be getting 
> tank
> pressure from the data, but I'm not seeing it in subsurface. So, I'd 
> like
> to reparse a dump file so I can walk through it in the debugger and 
> figure
> out what's going on. I looked at hacking up examples/universal.c, but 
> it's
> pretty set on downloading from a computer.

The aladin/memomouse parser doesn't report tank pressure, because that 
info is not stored in the sample data.

> Also if anyone knows of any documentation for the Uwatec data format, 
> that
> might be helpful, but I suspect I can get a really good idea of what's
> going on by just walking through the code as it dissects the data.

Links to external protocol documentation can be found here:

http://libdivecomputer.org/links.html

Jef


More information about the devel mailing list