This implements fairly basic support for the A300CS
- adds a cached reading function that supports transparent caching of 16
byte reads, implemented as 256 byte reads (I cannot get the A300CS to
respond to the B1 command, but with B8 I can read 256 bytes; so I
implemented a neat little caching layer that makes 16 byte reads
available to the upper layers while in fact reading the larger pages
that contain the 16 byte block and caching them for later use).
- adds support for an oceanic_atom2 open function that gets passed the
model information, since the A300CS needs us to toggle DTR and RTS twice
before it's willing to talk to us. The old oceanic_atom2 open function
remains unchanged in order not to break apps that might be using it
directly (tsk, tsk, tsk, your're not supposed to...)
- adds the necessary changes to the parser to deal with the different
locations for various information; it supports the basics: date, time,
duration, max depth, gasmixes plus depth, temperature and sensor
pressure from the samples
Missing / issues:
- there is a TON more information available. Some I know where it is, but
can't easily pass it back because of libdivecomputer architecture issues
(e.g. the firmware version). Others are clearly there but I haven't
figured out where (e.g. the deco state).
- the 256 byte read uses a two byte crc and I haven't been able to figure
out the algorithm. I'm sure it's obvious and I'm just being stupid, but
for now the check is commented out
This has been tested with Linus' new computer which has all of six dives
on it - and those six dives are rather homogeneous. This needs a lot more
testing, obviously. But so far so good - it works well from Subsurface :-)
/D
PS: Jef, I looked at the multiblock support. It adds more complexity for
no benefit - so I decided not to add this to my patches. The reduced
number of calls to the read function really makes no difference
whatsoever, but the changes make the code more complex and (IMHO) more
fragile. The caching read on the other hand is easy, straight forward,
and reasonably obviously correct (famous last words).