This way BLE dive computers that are otherwise conditional on USBHID will be
built on platforms that support them but don't have USBHID (like iOS).
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Sync up with upstream cersion 0.6.0.
Annoying merge, mainly because a lof of the changes Jef had done are
actually changes that came from our Subsurface branch, but in a
different form, because Jef doesn't actually take patches directly from
us.
Why? I don't know.
* tag 'v0.6.0' of git://git.libdivecomputer.org/libdivecomputer:
Release version 0.6.0
Fix some potential buffer overflows
Fix some casts with constant pointers
Enable some useful compiler warnings by default
Generate html documentation from the manpages
Fix the decoding of the ndl/deco information
Decode the firmware version for the iDive series
Add support for the Suunto Eon Core
Locate the most recent dive
Add EON Steel time sync capability
Improve the progress events
Detect the model number using the hardware type
Shearwater: add support for remaining gas time
Shearwater: extract tank sensor data for log version 7
Shearwater: extract log version from header
Nick Shore reports that it seems to act exactly like an EON Steel, just
with a different USB device ID.
Acting like the EON Steel is not a surprise: it does seem to be the same
dive computer, just in a smaller and lighter package (same screen size,
but more compact body and without the stainless steel to make it less
than half the weight). Looks like the battery is smaller, but the
electronics are likely the same.
We probably really should have some way to add new device ID's without
having to add whole new model numbers etc. It's not the first time this
happens (see the Scubapro Aladin Square vs the G2), and it's likely not
the last time.
Reported-by: Nick Shore <support@mac-dive.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The Suunto Eon Core uses a different USB PID, but otherwise it's
compatible with the Eon Steel. It's probably an Eon Steel internally,
but with a smaller form factor.
To be able to distinguish between the two models and use the correct USB
PID, each model is assigned a different (artificial) model number.
Reported-by: Nick Shore <support@mac-dive.com>
The model number is stored in the final block of each dive. But for an
efficient implementation of the fingerprint feature, the devinfo event
should be emitted before downloading the manifests or the dives. Thus
reporting the correct model number is problematic.
Currently the model number is simply hardcoded to the value of the
Petrel. This is sufficient for the parser, because there the model
number is only used to distinguish the Predator from all the other
models. Now, because the petrel backend doesn't support the Predator,
and the predator backend (which supports both the Predator and Petrel)
can obtain the correct model number from the final block, the hardcoded
value works fine. Except of course for identifying the actual model!
Allthough there doesn't seems to be a command to retrieve the model
number directly, we can retrieve the hardware type and map that to the
model number.
It works like the G2, but has a different model number, and different USB device ID.
Lots-of-testing-by: Vincent <vavincavent@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The communication protocol is identical to the G2 protocol, but with a
different USB VID/PID (c251:2006).
Note that unlike the G2, the Aladin Square seems to support only 33 byte
USB HID packets (1 byte report id and 32 bytes payload), even when the
actual command is much smaller. Without padding the commands, the dive
computer doesn't reply at all. Because the padding is already there, to
support the Windows api, no further changes are necessary.
Merge with Jef's upstream libdivecomputer:
- some OSTC parsing fixes, including getting the initial CNS into the
first sample
- syntactic cleanups to the Scubapro Aladin Sport Matrix support to
match upstream
* git://git.libdivecomputer.org/libdivecomputer:
OSTC: initialize initial CNS from header
Use an out-of-range value as undefined
Support for the Scubapro Aladin Sport Matrix.
The model number was wrong. Mea culpa.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The protocol is identical to the G2 protocol, with the exception of a
missing handshake.
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Merge with upstream libdivecomputer:
- workarounds for Windows libusb and hidapi issues
- misc random cleanups/noise
- rename DiveSystem to Ratio
- make Cochran with better with FTDI
- new support for: Suunto D4f, Ratio idive tank pressure, and Sherwood
Insight temperature and Oceanic ndl/deco sample.
* git://git.libdivecomputer.org/libdivecomputer:
Workaround for a Windows libusb issue
Use a fixed size packet for sending
Replace the size macro with the sizeof operator
Use the correct printf format for the size_t type
Move platform specific macros to a common header file
Use the correct data type for the return value
Rename the DiveSystem vendor to Ratio
Fix the Sherwood Insight temperature
Implement the ndl/deco sample
Change communication parameter to work better with FTDI
Retry read operations on failure
Add support for the Suunto D4f
Implement the tank pressure
At the time support for the Orca and iDive series was implemented, they
were being sold under the "DiveSystem" brand. But nowadays, the newer
iDive and iX3M series are being sold under the "Ratio" brand. Since this
frequently confuses end-users, let's rename the libdivecomputer vendor
name as well.
The Orca and the original iDive series remain under the DiveSystem
brand.
This with serial_ftdi.c changes and other libdivecomputer changes
enables Cochran DCs to work with libftdi on android devices.
Signed-off-by: John Van Ostrand <john@vanostrand.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Technically this is inaccurate because while some Perdix and Petrel 2
models do in fact support dual stack, the Petrel only does BT. But
the Petrel 2 identifies itself as Petrel via BT, so we need to flag
them both here.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
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
...
On Windows, the hidapi library uses the standard Microsoft USB HID
driver, while libusb requires the installation of a different driver
(WinUSB or libusbK). But installing one of the libusb drivers breaks
compatibility with other applications using hidapi (Scubapro LogTRAK and
Suunto DM5) because only one driver can be active. Switching
libdivecomputer to hidapi avoids this problem.
On Linux, the hidapi library doesn't seem to offer any advantages over
libusb. Most distributions don't even have the hidapi library installed
by default. Because there are usually two variants of the hidapi library
available on Linux (hidapi-libusb and hidapi-hidraw), the autotools
build system won't be able to detect it out-of-the-box, and will
automatically fallback to the libusb implementation.
On Mac OS X, hidapi is already the default (and also the only option).
The correct name for the OSTC 3+ is OSTC Plus nowadays. Allthough the
exact name doesn't really matter because all OSTC3 based models are
compatible, using the correct name should reduce confusing for
end-users.
The Cochran Commander TM appears to be a first generation Commander with
limited storage and function compared to later models.
The main differences are:
- The TM doesn't support high-speed transfer so use the 0x05 read
command and don't change to a higher baud rate. Still reset to 9600
to wait for the heartbeat.
- The TM has a different config command (one byte).
- The TM has only one config page.
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
...
The syntax is trivial.
"// FTDI" for FTDI cable support
"// BT" for classic Bluetooth support
"// BLE" for Bluetooth LE support
We can then parse this information during the Subsurface build process
and create the (hopefully correct) support matrix for dive computer
download from the mobile apps.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Stop pretending that all the devices since the Petrel are the same. They
actually aren't. So let's detect them and correctly identify them.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This adds support for older Cochran Commander dive computers,
specifically Commanders with serial numbers prior to 21000.
This also renames "Commander" model to "Commander II" and
adds "Commander I" to refer to pre-21000 models.
The back-end parser seems to be the same as for the Uwatec Smart (aka
Galileo Sol). At least that's the assumption right now.
The downloader just uses USB HID (very similar to EON Steel) rather than
the horrible IrDA thing.
There's also eventually a BLE thing, but that's for the future.
This is an unholy mixture of the Uwatec Smart downloader logic and the
EON Steel usbhid transfer code. The back-end is pure Uwatec Smart
(model 0x11, same as Galileo Sol).
I'm not at all sure this gets everything right, but it downloads
*something*.
[Jef Driesen: Renamed the backend to uwatec, and made some smaller
cosmetic changes to match the existing coding style.]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The back-end parser seems to be the same as for the Uwatec Smart (aka
Galileo Sol). At least that's the assumption right now.
The downloader just uses USB HID (very similar to EON Steel) rather than
the horrible IrDA thing.
There's also eventually a BLE thing, but that's for the future.
This is an unholy mixture of the Uwatec Smart downloader logic and the
EON Steel usbhid transfer code. The back-end is pure Uwatec Smart
(model 0x11, same as Galileo Sol).
I'm not at all sure this gets everything right, but it downloads
*something*.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
The dummy IrDA implementation is integrated in the main file. The
appropriate implementation is selected using conditional compilation
based on the features detect by the autotools build system.
Merge upstream libdivecomputer changes as requested by Jan Mulder.
"DiveSystem iX3M:
- Add support for new iX3M models
- Add support for new iX3M APOS4 firmware
- Add iX3M firmware version to the devinfo event (ix3m)
Shearwater:
- Report the ppO2 in external O2 sensor mode only (Shearwater)
- Replace the constant offset with a scaling factor (Shearwater)
- Apply the calibration correction only for the Predator
- Report individual sensor values
- Predator: don't report PPO2 unless in CC mode
Misc:
- Fix Sherwood Wisdom 3 memory layout
- Implement read and write functions for OSTC3
- Add support for Mares Quad
- Fix uwatec handshaking error handling"
* 'master' of git://git.libdivecomputer.org/libdivecomputer:
Add support for the new models
Add support for the new iX3M APOS4 firmware
Add the firmware version to the devinfo event
Report the ppO2 in external O2 sensor mode only
Replace the constant offset with a scaling factor
Apply the calibration correction only for the Predator
shearwater: Report individual sensor values
Predator: don't report PPO2 unless in CC mode
Fix the Sherwood Wisdom 3 memory layout
Implement the read and write functions for the OSTC3
Don't ignore handshaking errors
Add support for the Mares Quad
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
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.
...
The Cressi Drake is a mainly a freedive computer. The data format is
almost identical to the Leonardo. The main difference is that a single
dive now contains an entire freedive session. Each freedive in the
session is delimited with a 4 byte header containing the surface
interval and a special marker.
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
Merge with Jef Driesen's upstream.
Jef has updated his branch with about half of the EON Steel fixes, but
still refuses to admit that the string model is much superior to his
crazy "random numbers that can't actually describe anything properly"
model, and left out all those parts.
But Jef also made a generic HID layer thing that cleans things up (but
causes a spurious warning about a failed usb hid read due to the "clean
out old data" code that *expects& the failure), and fixed his version of
the HW Frog firmware, so this cleans up that issue.
We also now have that gas mix parsing fix for the Aladin Tec 2G properly
merged, so that our cherry-pick won't cause merge issues later.
* 'master' of git://git.libdivecomputer.org/libdivecomputer:
Fix the firmware version for the HW Frog.
Use the new USB HID backend for the Eon Steel.
Add a dummy backend for systems without USB HID support.
Use the hidapi library on Mac OS X.
Add a new USB HID communication backend.
Add a configure option to build without libusb.
Restore the sample events.
Suunto EON Steel: initialize the tank 'gasmix' index
Suunto EON Steel: do the proper enum lookup for a few more cases
Suunto EON Steel: fix the event begin/end flag
Suunto EON Steel: split out gas info parsing
EON Steel: look up enum descriptor strings
EON Steel: pass in the type descriptor to samples that need it
EON Steel: mark tank cache initialized when filling it in
EON Steel: fix uninitialized field cache entries
Initial Suunto EON Steel CCR support
Suunto EON Steel: add descriptor debugging output
Add tank size reporting for Suunto EON Steel
Fix the gas mix parsing for the Aladin Tec 2G.
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.
...