-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
feat(bt) - Enable use of RESERVED bits in COD (IDFGH-13374) #14286
Conversation
👋 Hello WebDust21, we appreciate your contribution to this project! 📘 Please review the project's Contributions Guide for key guidelines on code, documentation, testing, and more. 🖊️ Please also make sure you have read and signed the Contributor License Agreement for this project. Click to see more instructions ...
Review and merge process you can expect ...
|
allows reading back the applied COD
Hi, @WebDust21 ,Thank you for your submission! We really appreciate it. And there are two places that need to be modified:
|
I'm sorry, I'm not a Github whiz...I don't know how to do either of these. from what I read, it should be easy for your side to "squash" the commits (I do not have the option). I do not know how to change a commit message...although as this PR extends nonstandard functionality, I would consider this a "feature", and not necessarily a "fix". |
Hi, @WebDust21 In the latest Bluetooth protocol, the two least significant bits are fixed to 0b00. Could you please tell me what the model of Bluetooth board are you using? And which version of the Bluetooth protocol are you referring to? Thank you! |
Thank you for the instructions; they would work if I had forked a local copy of the entire ESP-IDF to my computer. However, I just made the edits from Github.com, with no local copy--and as such, there is no place to run the commands.
Like I mentioned in the very opening comment, this is NONSTANDARD use of the two low "reserved" bits, as required for a compatibility project. This is for SPP mode (Bluetooth Classic) on an original ESP32; it is not BLE in any way, shape or form. I've tested the modifications here as fully functional in getting the ESP32 to broadcast the necessary Bluetooth COD (although the "read COD" still incorrectly returns the LSBs as 0b00 for some reason. Need to dig into that further.) |
Hi, @WebDust21 You don’t need to modify it anymore.. But in the original implementation, reserved_2 is not part of the minor class and is always set to 0. With your fix, reserved_2 may be non-zero, which changes the API behavior and affects users who don't want to overwrite reserved-2. So after your commit, I made some changes to extend the functionality of the current API so that the previous API behavior does not change and allow users who want to set the reserved_2 to use the new esp_bt_cod_mode_t code. |
Can I see the changes to the code? It's worth noting that the Bluetooth device scan does return the "reserved_2" bits--which is how I was able to determine that the units used a nonstandard Bluetooth COD. It just didn't allow setting a COD with those bits used, nor can I read back a hacked COD set (although it does work when set). |
@WebDust21 I‘m sorry that you can't see the changed code for now. The changes have been merged into the internal repository, but it will take a few days to see the updates on GitHub. |
Thanks for contribution again, changes have been with 59066e3. Thanks. |
This is a very niche-case patch, one that most people should never have need to bother with.
But in my case, trying to make a replacement for an obsolete Bluetooth board, I ran into an issue with a nonstandard use of the BT COD field: the two low "reserved" bits were used! Without access to the controlling firmware (and having to maintain compatibility with the thousands of "obsolete Bluetooth boards" in the field which will not function without said "reserved" bits being transmitted in the outgoing COD), this is the neatest solution to the problem.
I did a deep dive straight into the Bluedroid stack, and found exactly where (amongst the multiple unnecessary data type changes the provided COD went through) the two bits were getting lost. The very simple changes here were successful in allowing the ESP32 to work as a drop-in replacement for the obsolete board.