53 Commits

Author SHA1 Message Date
Jef Driesen
a722d50f03 Mark the last memory page on a Sherwood Wisdom 2 as unreadable. 2010-07-28 08:36:49 +02:00
Jef Driesen
f4d3747e94 Mark the last memory page on an Oceanic Atom 2 as unreadable.
When trying to read the last memory page from an Oceanic Atom 2, the
device does not respond. Strangely, other compatible devices are not
affected by this problem.
2010-06-23 15:01:51 +02:00
Jef Driesen
4e5c9ad8a3 Remove all debugging code. 2010-05-06 06:21:59 +00:00
Jef Driesen
61f9603131 Autodetect the Oceanic OC1 layout at runtime. 2010-04-27 11:33:41 +00:00
Jef Driesen
e87385850b Use independent settings for the global and logbook pointer modes. 2010-04-27 11:33:29 +00:00
Jef Driesen
b9f7d4e425 Improve the ACK/NAK error recovery to fix more errors. 2010-03-18 09:40:29 +00:00
Jef Driesen
f8ff2852bf Fix the init sequence for Geo 2 devices.
The Geo 2 appears to respond with a single NAK byte instead of three.
The issue is fixed by expecting only a single byte, and flushing the
serial line to discard all other bytes (if there are any).
2010-03-06 11:48:22 +00:00
Jef Driesen
f6d35fa2c2 Add cancellation support.
To be able to cancel an operation, an application should register a
callback function that returns a non-zero value whenever the active
operaton should be cancelled. A backend can invoke this callback function
to query the application for a pending cancellation request.
2010-02-15 13:16:26 +00:00
Jef Driesen
87236f505a Remove a number of unnecessary functions. 2010-01-25 19:46:09 +00:00
Jef Driesen
a14b0b7b98 Do not ignore errors during initialization. 2010-01-25 14:08:01 +00:00
Jef Driesen
45f51fedfb Store the layout descriptor in the device handle. 2010-01-15 10:16:49 +00:00
Jef Driesen
32fd37df2c Keep only a single PAGESIZE macro. 2010-01-15 09:51:15 +00:00
Jef Driesen
a87398b7c6 Implement progress events for the device_dump() function.
A helper function is added to simplify implementing the devic_dump()
function on top of the device_read() function, and enable progress
events automatically.
2009-11-12 08:04:34 +00:00
Jef Driesen
a49d2c7b36 Changed the device_dump() function to use the new memory buffer class.
Using a resizable memory buffer allows to allocate the right amount of
memory inside the backend, avoiding having to know the required buffer
size in advance.
2009-11-10 11:36:10 +00:00
Jef Driesen
58f6b0e190 Remove the gap between the logbook and profile ringbuffers. 2009-10-20 13:43:21 +00:00
Jef Driesen
407ff06fb9 Improve the empty ringbuffer detection.
The logbook ringbuffer is now considered empty if any of the pointers is
outside the valid ringbuffer area. Compared to checking only against a
special empty value, this approach makes the code more robust against
invalid pointers.
2009-10-20 13:43:07 +00:00
Jef Driesen
a4247b7505 Define the WARNING macro only once. 2009-08-06 14:15:52 +00:00
Jef Driesen
24f0f66efd Automatically switch the device into download mode. 2009-05-27 10:23:27 +00:00
Jef Driesen
5a1658d30e Use the symbolic constants for ACK/NAK bytes. 2009-05-27 10:22:29 +00:00
Jef Driesen
f477defbf8 Increase the total memory size to 64KB. 2009-05-15 10:13:03 +00:00
Jef Driesen
f0b3253296 Add a common base class.
Introducing a common base class allows to share more code between the
backends. Sharing the fingerprint data eliminates the need to pass it
with a function parameter.
2009-05-05 13:20:11 +00:00
Jef Driesen
f642049fe2 Enable the shared parsing code. 2009-05-04 09:03:18 +00:00
Jef Driesen
be2a27c58b Remove the handshake function from the public api. 2009-04-14 21:37:39 +00:00
Jef Driesen
8bfe481e58 Add progress events. 2009-04-10 09:21:38 +00:00
Jef Driesen
6d018ab6ae Add a device info event. 2009-04-10 09:21:28 +00:00
Jef Driesen
95089c1851 Use a single buffer for all profiles. 2009-04-10 09:21:18 +00:00
Jef Driesen
85e0b9dcbf Read the profile ringbuffer backwards. 2009-04-10 09:21:08 +00:00
Jef Driesen
5ce7aeffd9 Rewrite the code to use the stored fingerprint.
Logbook entries are now downloaded one by one, until a previously
downloaded entry is identified. This approach reduces the amount of data
that needs to be transfered in the typical case, where only a few new
dives are available on the device.
2009-04-10 09:20:58 +00:00
Jef Driesen
49301d1b28 Implement the fingerprint function. 2009-04-10 09:20:48 +00:00
Jef Driesen
c1745cc535 Merge the typedef with the struct declaration. 2009-04-06 07:26:16 +00:00
Jef Driesen
ce705f8244 Use the new byte order functions everywhere. 2009-03-11 10:18:28 +00:00
Jef Driesen
4368b94ff0 Added basic support for the fingerprint feature. 2009-02-23 13:03:20 +00:00
Jef Driesen
eb9efb47e1 Check the length of the provided buffer space before the data transfer. 2009-02-11 10:43:44 +00:00
Jef Driesen
1eedd33b5d Added write support. 2008-12-27 16:18:01 +00:00
Jef Driesen
7195c000e4 Added a new function for the keepalive command. 2008-12-27 16:17:49 +00:00
Jef Driesen
56b52f8fad Take care of the init and quit command internally. 2008-12-27 16:17:35 +00:00
Jef Driesen
92b7a98260 Use a symbolic constant for the location of the pointers. 2008-11-26 10:11:20 +00:00
Jef Driesen
596af5a17b Add LGPL license headers. 2008-10-05 20:14:18 +00:00
Jef Driesen
276f45acd2 Allow the library to be compiled as C++ code.
Moved the initialization of the backend pointers to the beginning of the 
source file. Without the need for a tentative definition, the library 
can be compiled with a C++ compiler.
2008-09-03 10:16:35 +00:00
Jef Driesen
dfeea21c36 Add explicit casts to improve type safety. 2008-09-03 08:51:07 +00:00
Jef Driesen
599827d5a3 Improve the type safety by using the device_status_t enum. 2008-09-03 08:46:21 +00:00
Jef Driesen
b031d8dc2c Stop abusing status codes to return size information to the application.
When necessary, an output parameter is added to provide the size 
information. Status codes are strictly reserved for providing status 
information only.
2008-08-28 09:07:09 +00:00
Jef Driesen
7c03ddcb15 Moved all the checksum functions to a common file. 2008-07-30 08:56:08 +00:00
Jef Driesen
5ae3b98d5d Implement the device_dump() function on top of device_read(). 2008-07-22 06:05:36 +00:00
Jef Driesen
16b14e55ef Allow to abort a transfer by returning FALSE from the callback. 2008-07-22 05:35:08 +00:00
Jef Driesen
4f63295802 Add a function to initialize the base class. 2008-07-22 05:31:26 +00:00
Jef Driesen
eaf10b59da Rename the device_download() function to device_dump().
The new name makes it more clear that it's not the recommended function 
to download data.
2008-07-17 05:25:53 +00:00
Jef Driesen
8a90c18a06 Port the Oceanic Atom 2 to the new api. 2008-07-08 10:11:14 +00:00
Jef Driesen
03b186e88b Treat the first byte of a packet as an ACK/NAK byte.
The first byte of a packet seems to be an ACK/NAK byte, rather than a 
real packet header. The implementation of the transfer function is 
changed to match this observation.
2008-06-30 09:22:05 +00:00
Jef Driesen
16f12123a3 Moved the handshaking to a new function and added the quit sequence. 2008-06-30 07:50:36 +00:00