Programming questions

John Van Ostrand john at vanostrand.com
Sun Jul 6 10:25:05 PDT 2014


Hi,

I've started writing libdivecomputer code for the Cochran and I have a few
questions that I expect are easy answers.

1. I'm wondering how much I should read in the _init function. It seems I
should read enough to verify I'm talking to the right device and get the
serial number. Is that right?

2. There are other reads I can do that will get things like # of dives, gas
mixtures, conservatism, etc. I need number of dives to read the log book.
Should I do this in _read? And does it make sense to do this read before
setting progress information?

3. I have extra information that I can offer the user, pre- and post-dive
things like battery voltage, tissue load, time to fly, previous SIT,
repetitive dive count and dive profiles samples like tissue load every 24
seconds, NDL remaining (I think), deco required (I think), ascent rate. I
can also get post dive off-gassing tissue load and temperature samples. The
DC continues to log samples until off-gassed
I can't see any structure for all of this, or a way to carry around that
kind of data.

4. The DC requires some prodding to accept commands, after being prompted
it emits a byte every second. Initially it's a 0xAA but after reading dive
samples it's a 0x00. The only way I've been able to prompt it is to send a
byte to it. The vendor software doesn't do this. Could it be a USB signal
of some sort. I see "Sync Reset Pipe and Clear Stall" in the USB capture
and "Vendor Device" and "Control transfer". Any ideas on what I might try?



-- 
John Van Ostrand
At large on sabbatical
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://libdivecomputer.org/pipermail/devel/attachments/20140706/5c42a847/attachment.html>


More information about the devel mailing list