-
Notifications
You must be signed in to change notification settings - Fork 89
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update libdivecomputer from Upstream. #71
Update libdivecomputer from Upstream. #71
Conversation
The i330R Console is a new variant of the i330R Wrist computer. The only difference is the new model number. Reported-by: Greg McLaughlin <support@moremobilesoftware.com>
Return the error code DC_STATUS_NOMEMORY when running out of memory instead of DC_STATUS_SUCCESS.
Due to an off by one error, the last entry in the logbook buffer wasn't processed at all. In theory that means the oldest dive is skipped and can't be downloaded. However the logbook buffer usually contains some empty entries at the front. Those are already detected by inspecting the dive number for a zero value and thus the download is already aborted before reaching that last entry. Therefore this bug didn't cause any problems yet in practice.
Most BLE enabled dive computer use a simple BLE service with a TX and RX characteristic, which emulates a basic UART connection over two lines. This allows to use the I/O stream interface for the BLE communication. Unfortunately some dive computers (e.g Cressi) also have some additional characteristics that libdivecomputer must be able to read to retrieve some important data. Therefore, add some new ioctl's for reading and writing those BLE characteristics.
Add some helper functions to convert the binary UUID data structure to and from their human readable string representation.
The BLE variant of the Cressi protocol uses a completely different set of commands compared to the existing usb-serial protocol. Most of the packet framing bytes have been removed as well. But the most surprising change is the fact that there is no variant of the CMD_VERSION available. The corresponding information must be obtained by reading some secondary characteristics instead. Co-authored-by: Greg McLaughlin <support@moremobilesoftware.com> Co-authored-by: Sven Knoch <info@divinglog.de>
Previously, in commit 57cd11f, the part of the logbook entry containing the dive mode was already inserted back into the dive data, because the dive mode is needed to be able to parse the dive. Unfortunately, the newer models like the Cressi Nepto store even more important information in the logbook entry and the dive computer id data. Therefore, the data format is changed once more to preserve both pieces of data. The parser is updated to handle this new format. This change is not strictly backwards compatible, but if needed existing data can be converted into the new format.
The extra surface sample results in a nicer and more correct graph when plotting the depth profile.
The command to set the date/time does not appear to be supported for the BLE communication.
The command to exit the PC Link mode does not appear to be supported for the BLE communication.
The Cressi 'goa' protocol and data format has different versions. The current implementation only supports version 2 and 3 (both variants are mostly compatible with only some minor differences), but the Nepto uses version 4, which requires some refactoring: - The reply to the CMD_VERSION command has no longer a fixed size, and thus the receive function is changed to accept a dynamically sized buffer. - The size of the entries in the logbook can be 23 bytes (for versions 0-3) or 15 bytes (for version 4). - The Nepto is a freediving computer which supports sample rates less than one second. Therefore the sample time is internally changed from seconds to milliseconds. - Each version needs it own layout descriptor. The version number is either available directly in the device id data, or obtained indirectly from the firmware version.
The Cressi Leonardo 2.0 switched from the older 'leonardo' protocol to the newer 'goa' protocol. At the same time, the device firmware also uses a new V5 variant of the data format. Some of the other models, like the Donatello, also received a firmware update which uses this new V5 data format.
There is a minor update to the dataformat to support CCR dives. For the current firmware, the setpoint change event was originally defined as a 4 byte event, but the new implementation changed this to only 2 bytes. Since the current firmware doesn't support CCR dives yet, the 4 bytes variant is not supposed to appear in the sample data and should be ignored.
The Uwatec Aladin One shares the same model number with the Tec and Prime and is therefore already supported. Reported-by: Sven Knoch <info@divinglog.de>
I assume that a number of these (at least the BLE one) are no-ops for us. Not saying they shouldn't be merged, just maybe that should be noted in the commit message? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks all reasonable to me
All of the commits in this pull request (except for the merge commit) are the result of a
Yes, I'll do that. We can probably improve the process by adding a GitHub workflow that checks for every pull request if it will require the scripts to be run, and fails otherwise. And while we are at it, I think there is generated documentation that is kept in the repository. Maybe this should have a similar guard?
This already came out in the wash when resolving merge conflicts: |
Add a check that will fail whenever there is a change in the list of supported dive computers in libdivecomputer that is not reflected in the `SupportedDivecomputers.*` lists. Also add a script for a simplified update of these lists. From a discussion with @dirkh in subsurface/libdc#71 (comment). Signed-off-by: Michael Keller <github@ike.ch>
Add a check that will fail whenever there is a change in the list of supported dive computers in libdivecomputer that is not reflected in the `SupportedDivecomputers.*` lists. Also add a script for a simplified update of these lists. From a discussion with @dirkhh in subsurface/libdc#71 (comment). Signed-off-by: Michael Keller <github@ike.ch>
Add a check that will fail whenever there is a change in the list of supported dive computers in libdivecomputer that is not reflected in the `SupportedDivecomputers.*` lists. Also add a script for a simplified update of these lists. From a discussion with @dirkhh in subsurface/libdc#71 (comment). Signed-off-by: Michael Keller <github@ike.ch>
Tested with:
|
Add a check that will fail whenever there is a change in the list of supported dive computers in libdivecomputer that is not reflected in the `SupportedDivecomputers.*` lists. Also add a script for a simplified update of these lists. From a discussion with @dirkhh in subsurface/libdc#71 (comment). Signed-off-by: Michael Keller <github@ike.ch>
libdivecomputer. Details in subsurface/libdc#71. Signed-off-by: Michael Keller <github@ike.ch>
libdivecomputer. Details in subsurface/libdc#71. Signed-off-by: Michael Keller <github@ike.ch>
Add the latest updates in libdivecomputer as of 2024/12/31: