Merge with upstream libdivecomputer:
- uwatec cleanups and fixes (G2/trimix parsing etc)
- event and bookmark fixes for Oceanic, iDive/iX3M and Aqualung i300
* git://git.libdivecomputer.org/libdivecomputer:
Use more descriptive names
Use two passes to parse the profile data
Fix the Uwatec trimix data format
Implement the ndl/deco, rbt and bookmark samples
Implement the setpoint sample for the iDive and iX3M
Implement the ndl/deco sample for the Aqualung i300
Update the msvc project file
Merge with upstream libdivecomputer from Jef:
- more Cochran work from John Van Ostrand
- new 'timesync' interface to synchronize the clock on a dive computer
- support for Aqualung i200
- misc updates (Cressi Leonardo fix, OSTC 3+ renaming, fix surface pressure on iX3M, idive salinity parsing)
- HIDAPI work.
It turns out that HIDAPI is not compatible with libusb in the actual
packet sending path, so this will need some more cleanups - Jef doesn't
see the issue because he doesn't have a generic packet IO layer and
doesn't share packets with the BLE code.
* git://git.libdivecomputer.org/libdivecomputer: (25 commits)
Add basic timezone support
Add time synchronization to the example application
Implement the new api for the HW devices
Add support for synchronizing the device clock
Use hidapi as the default USB HID library
Workaround for a Windows hidapi issue
Reset the number of bytes to zero on error
Add a zero report ID to the commands
Fix compatibility issue with hidapi
Implement the salinity field
Fix the atmospheric pressure for the iX3M
Rename the OSTC 3+ to OSTC Plus
Locate the most recent dive using the logbook pointers
Add support for the Aqualung i200
Add event handling to TM model
Fix profile buffer size and address size
Add three event codes
Add support for the Commander TM
Dump function no longer assumes reads begin at byte 0
Remove unneeded function
...
Allthough most dive computers always use local time and don't support
timezones at all, there are a few exceptions. There are two different
sources of timezone information:
- Some of the newer Uwatec/Scubapro devices use UTC internally and also
support a timezone setting. This UTC offset is currently taken into
account to obtain the dive date/time, but the UTC offset itself is
lost.
- Uwatec/Scubapro and Reefnet devices rely on the clock of the host
system to synchronize the internal device clock and calculate the
dive date/time. The consequence is that the resulting date/time is
always in the timezone of the host system.
In order to preserve this timezone information, the dc_datetime_t
structure is extended with a new "timezone" field, containing the UTC
offset in seconds. Devices without timezone support will set the field
to the special value DC_TIMEZONE_NONE.
The dc_datetime_localtime() and dc_datetime_gmtime() functions will
automatically populate the new field with respectively the local
timezone offset and zero. The dc_datetime_mktime() function will take
into account the new timezone field for the conversion to UTC. The
special value DC_TIMEZONE_NONE is interpreted as zero.
Merge with upstream libdivecomputer from Jef:
- Jef merged my Scubapro G2 work, but renamed everything, and didn't
get the newer IO model code. Very annoying.
I went along with changing the G2 model family name to
DC_FAMILY_UWATEC_G2 just to keep some of the basic infrastructure
more easily mergeable. But his uwatec_g2 version is not usable.
- Cochran updates from John Van Ostrand
- Misc improvements from Jef:
* divesystems idive improvements
* Oceanic OCS freedive mode
* ppO2 callback cleanup
- Some transport type work:
* changes to IRDA configuration
* basic bluetooth rfcomm transport mode
* 'master' of git://git.libdivecomputer.org/libdivecomputer: (35 commits)
Removed unused code
Fixed duplicate gasmix event reports
Added decompression event handling for the Commander
Fix bad profiles when profile ringbuffer wraps around
Changed cochran_comander_profile_size function parameters
Fixed location and encoding of Commander II pointers
Use a local variable for the layout pointer
Add new EMC device model string
Add support for Pre-21000 s/n Commander dive computers
Fix problems with wrapped logbook ringbuffer
Retry read operations on failure
Change profile download to be incremental
Fix the id string offset
Fix the progress events
Use the trimix data format
Use the correct model number
Enable more fine grained progress events
Abort with an error if the buffer is too small
Use the standard libdivecomputer error codes
Scubapro G2: add missed command packet logging
...
Merge upstream libdivecomputer changes from Jef Driesen.
The most noticeable part is Jen Mulder's OSTC3 initial setpoint
addition, which fixes the OSTC3 data in CCR3 mode.
But also various cleanups and fixups from Jef.
* 'master' of git://git.libdivecomputer.org/libdivecomputer:
OSTC3: set initial setpoint in profile data
Remove unused parameters
Cleanup the extract dives functions
Remove unnecessary helper functions
Remove deprecated functions from the public api
Remove unnecessary include statements
Fix the firmware version and serial number
Add support for the Uwatec Aladin Tec 3G
The vendor_product_parser_create() and vendor_product_device_open()
functions should be called indirectly, through the generic
dc_device_open() and dc_parser_new() functions. And the
vendor_product_extract_dives() functions are internal functions that
should never have been part of the public api in the first place.
Merge upstream libdivecomputer changes from Jef Driesen.
No major changes and no conflicts except for a trivial one where Jef had
marked a couple of private functions 'static' and our versions had
extended the argument lists of those functions.
This just updates to the current upstream state of libdivecomputer,
where the bulk of the changes come mainly from the new ringbuffer helper
code, but there are various other small misc fixes and cleanups.
* git://git.libdivecomputer.org/libdivecomputer:
Disable the deco events
Replace the deco events with a deco sample
Report errors from the close function
Mark the private function as static
Fix a bug in the tank pressure samples
Disable freedive mode for the Uwatec Aladin Tec 2G
Mark the private function as static
Fix some compiler warnings
Fix some more null pointer dereferences
Use a more efficient download algorithm
Use the new ringbuffer stream
Add a common ringbuffer reading algorithm
Improve the robustness of the IrDA I/O code
Fix a few null pointer dereferences
Fix the number of gas mixes
Always use the sample timestamp as the base value
The Aqualung i450T appears to ignore the fixed sample rate and instead
store a timestamp in each sample.
The presence of the surface samples in combination with this timestamp
based format is odd. Even the official Diverlog software is confused:
the Windows versions seems to ignore them, but the Mac version takes
them into account.
After the previous commit, the raw data is now reported with one large
vendor sample. Because that makes the data more difficult to interpret
(for example during debugging), a small helper function is added to
split the data again in multiple vendor samples.
Originally, the time and vendor sample values are emitted immediately
after the previous sample is complete. This is now postponed until all
raw samples are available.
This will be required for the Aqualung i450t. That model appears to
ignore the fixed sample rate and instead store a timestamp in each
sample. That means the timestamp is only available once the last raw
sample data has been reached.
Skipping the extra samples by increasing the length is not always
reliable. If there are empty samples present, they will get skipped
instead of the real samples. And if the number of samples isn't an exact
multiple of the samplerate, we're accessing data beyond the end of the
dive profile.
Merge upstream libdivecomputer changes from Jef Driesen.
The most notable one is how libdivecomputer no longer sends the
GASCHANGE events, but uses DC_SAMPLE_GASMIX instead.
We still turn it into a SAMPLE_EVENT_GASCHANGE2 event internally in
subsurface, since we want all the normal event handling to trigger.
* 'master' of git://git.libdivecomputer.org/libdivecomputer: (21 commits)
Document the date/time functions
Document the public api with man pages
Add support for the Cressi Drake
Detect overwritten dive profiles
Ignore tank pressure if no sensor is attached
Add support for the tank field
Add support for the salinity field
Use the sample interval from the settings
Update the Aqualung i750TC parser
Toggle the DTR line during setup
Implement the read function
Add doxygen documentation to the build system
Add support for the Aqualung i750TC
Fix the Windows version resource build
Force the dive mode to gauge
Add support for the dive mode
Report the initial gas mix on the first sample
Remove the deprecated gas change events
Add support for the Hollis DG02.
Add support for the Oceanic F10.
...
Merge upstream version 0.5.0.
Some small updates from Jef Driesen since the last sync, but let's sync
with the real 0.5.0 release.
* tag 'v0.5.0' of git://git.libdivecomputer.org/libdivecomputer:
Release version 0.5.0.
Include the public header in the implementation file.
Add explicit casts for the msvc C++ compiler.
Add some workarounds for the msvc compiler.
Update the msvc project file.
Add missing header files to the Makefiles.
Add support for the Subgear XP-Air
This is a rough merge of the upstream libdivecomputer changes.
I say "rough", because this disables the custom serial code as it
clashes very badly with Jef's new dc_serial_t abstraction.
Anton Lundin has patches on top of this to re-introduce the custom code
in a way that integrates better with the upstream libdivecomputer state.
* git://git.libdivecomputer.org/libdivecomputer: (42 commits)
Add support for the Sherwood Vision.
Fix the decoding of the maximum depth.
Improve the default layout detection.
Add a warning for unsupported devices.
Fix the temperature for the Tusa Zen Air.
Add support for the Aqualung i550T.
Use the new settings field for the salinity.
Fix the parsing of freedives.
Detect the gauge and freedive mode correctly.
Add the salinity field for the Aladin Tec.
Add support for the Scubapro Mantis 2.
Fix the decoding of the dive time.
Add support for the Scubapro Mantis.
Fix the Aeris 500AI serial number.
Add the serial number encoding to the layout.
Add salinity and timezone fields to Aladin Tec 2G
Add NDL and RBT for the ATOM31 and I450T
Add support for the new extended hardware descriptor.
Update the OSTC device descriptors.
Add a workaround for an OSTC4 firmware bug.
...
Several devices (e.g. Oceanic Geo, Oceanic Veo 2.0 and Tusa Zen) report
a maximum depth that is clearly too large. The problem is easily fixed
by ignoring the higher bits. The exact bit mask is an educated guess. A
12 bit value is plausible because it's also used for the sample depths.
In freedive mode, samples are only 2 or 4 bytes large, thus a sample
containing all 0x00 bytes represents a zero depth value and not some
invalid data that should be ignored.
I originally assumed the second byte contains the hour, but that turns
out to be wrong. At least some of the bits have a different meaning.
With only seconds and minutes, the maximum divetime is limited to at
most 99 minutes and 59 seconds. That shouldn't be a problem for
freedives.
The Oceanic and Aeris F11 have a configurable sample rate. The possible
sample intervals are 2, 1, 0.5 and 0.25 seconds. Since our smallest unit
of time is one second, we can't represent the last two, and the extra
samples will get dropped for now.