Merging data from two DC broken?

Jef Driesen jefdriesen at telenet.be
Sat Feb 16 06:41:08 PST 2013


On 16-02-13 14:31, Miika Turkia wrote:
> On Sat, Feb 16, 2013 at 2:11 PM, Jef Driesen <jefdriesen at telenet.be> wrote:
>> On 16-02-13 10:28, Dirk Hohndel wrote:
>>>
>>>
>>> On Feb 16, 2013, at 1:25 AM, Miika Turkia wrote:
>>>>
>>>> File sent directly to Dirk.
>>>>
>>>> I did a bit more testing. If I close the combined XML file where no
>>>> merging have occurred after download and then open it again - the DCs
>>>> are merged properly. So the basic merge is functioning properly but it
>>>> is not triggered when importing/downloading from DC.
>>>
>>>
>>> And because of this I can of course not reproduce this here :-(
>>
>>
>> If Miika sends you the memory dumps of his two dive computers, then you
>> should be able to reproduce the problem with the simulator.
>>
>> On native linux, you don't need any of the virtual machine setup. Just run
>> socat to setup two pseudo terminals:
>>
>> socat PTY,raw,echo=0,link=/tmp/ttyS0 PTY,raw,echo=0,link=/tmp/ttyS1
>>
>> and then run the simulator on /tmp/ttyS1 and subsurface on /tmp/ttyS0. The
>> only extra you have to do is to compile libdivecomputer with "./configure
>> --enable-pty". Without this option, libdivecomputer will have trouble with
>> the pty's.
>
> What is the simulator you are talking about? I could do my testing
> with it rather than hooking up the dive computers back and forth
> (especially if it would be faster).

It's a small utility I wrote to help during libdivecomputer development. It 
emulates the dive computer communication protocol, and an application can talk 
to it as it where a real dive computer. This allows me to "download" without 
needing the actual dive computer. People just have to send me a memory dump of 
their device, and then I can reproduce most problems locally (except for real 
communication problems like timing issues of course).

It's usually a bit faster than a real download, but not always. That's because 
the real slow protocols like the vyper are not due to the low baudrate, but the 
excessive use of sleep calls, and those are not removed with the simulator. But 
the main advantage is obviously a lot more convenient than real hardware. I can 
test nearly all devices this way without actually owning them.

If you want to give it a try, I have uploaded binaries for the three major 
platforms to the libdivecomputer website:

http://www.divesoftware.org/libdc/tmp/

There are some setup instructions here:

http://www.divesoftware.org/libdc/simulator.html

The only reason why this isn't included in the libdivecomputer code is that the 
code is ugly and never polished. This was something that was hacked together 
over time, and never intended to leave my system. But it does work :-) If 
someone wants the code anyway, just ask!

Jef


More information about the subsurface mailing list