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

Not working on macOS Monterey #62

Closed
semvis123 opened this issue Oct 22, 2021 · 2 comments · Fixed by #68
Closed

Not working on macOS Monterey #62

semvis123 opened this issue Oct 22, 2021 · 2 comments · Fixed by #68

Comments

@semvis123
Copy link
Contributor

It freezes on macOS Monterey when it waits for the response data, it never receives anything.
The receive data method in the IOBluetoothRFCOMMChannelDelegate doesn't seem to get called.
It's probably caused by a bug in Monterey.

@semvis123
Copy link
Contributor Author

semvis123 commented Oct 25, 2021

A temporary (ugly) fix would be to disable the _waitForAck method in the macOS version, and change this->_seqNumber++ to this->_seqNumber++ % 2 because the _seqNumber always flips between 0 and 1 if the command is successful (or only the last bit is checked, not exactly sure).

auto data = CommandSerializer::packageDataForBt(bytes, DATA_TYPE::DATA_MDR, this->_seqNumber++);

One disadvantage though: If a command fails and the sequence bit is not flipped at the headphone, the next command will also be missed because the bit is wrong (after that it will sync up again).
With these changes it fully works again (but without receiving any data).

@semvis123
Copy link
Contributor Author

Managed to make it functional again, but it seems to consume one full core.
See: #68

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 a pull request may close this issue.

2 participants