Skip to content
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

Fix the Mares usb-serial communication #63

Merged
merged 1 commit into from
May 24, 2024

Conversation

mikeller
Copy link
Member

@mikeller mikeller commented May 19, 2024

@torvalds: I cherry-picked this from libdivecomputer/libdivecomputer@8745a3b - there have been multiple reports from users with Mares dive computers running into this when using latest Subsurface:

I suspect that this might need some manual conflict resolution next time we merge from libdivecomputer, but I am happy to deal with this there and then.

Original commit message:

The BLE changes in commit e83732e are causing major problems for some of the usb-serial enabled models, like the Puck Pro and Quad Air.

These models appear to require a small delay of a few milliseconds between sending the two command bytes and the remainder of the command payload. I suspect the device is still busy processing those first two bytes, and thus not ready in time to receive the remaining data. Instead of manually adding a fixed delay, restore the previous behaviour and wait for the ack byte again. This has the advantage that the delay is automatically proportional to the response time of the dive computer.

For the BLE communication nothing changes.

The BLE changes in commit e83732e are
causing major problems for some of the usb-serial enabled models, like
the Puck Pro and Quad Air.

These models appear to require a small delay of a few milliseconds
between sending the two command bytes and the remainder of the command
payload. I suspect the device is still busy processing those first two
bytes, and thus not ready in time to receive the remaining data. Instead
of manually adding a fixed delay, restore the previous behaviour and
wait for the ack byte again. This has the advantage that the delay is
automatically proportional to the response time of the dive computer.

For the BLE communication nothing changes.
@mikeller mikeller merged commit 9b12e8e into subsurface:Subsurface-DS9 May 24, 2024
7 of 8 checks passed
@mikeller mikeller deleted the cherry_pick_mares_fix branch May 24, 2024 20:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mares Smart Air - "Dive data import error"
2 participants