-
Notifications
You must be signed in to change notification settings - Fork 61
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
Add support for Zephyr HCI VSC set TX power command #258
Conversation
README.md
Outdated
@@ -63,3 +63,23 @@ This is not an official Google product. | |||
This library is in alpha and will be going through a lot of breaking changes. While releases will be stable enough for prototyping, experimentation and research, we do not recommend using it in any production environment yet. | |||
Expect bugs and sharp edges. | |||
Please help by trying it out, reporting bugs, and letting us know what you think! | |||
|
|||
# TX Power Control for nrf52840 dongles |
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.
Maybe this doc should live in a section under docs/mkdocs/src
(maybe platforms/zephyr.md
?) rather than the top-level README, which should remain very generic.
bumble/hci.py
Outdated
@@ -557,6 +557,13 @@ def phy_list_to_bits(phys): | |||
HCI_LE_SET_DEFAULT_SUBRATE_COMMAND = hci_command_op_code(0x08, 0x007D) | |||
HCI_LE_SUBRATE_REQUEST_COMMAND = hci_command_op_code(0x08, 0x007E) | |||
|
|||
# Vendor specific HCI commands | |||
HCI_VSC_TX_POWER_HANDLE_TYPE_ADV = 0x00 |
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.
Those 3 constants should be class members of the HCI_VSC_Write_Tx_Power_Level_Command
class I think.
bumble/hci.py
Outdated
('selected_tx_power_level', -1), | ||
], | ||
) | ||
class HCI_VSC_Write_Tx_Power_Level_Command(HCI_Command): |
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.
Is there a doc/spec we can point to for this vendor command?
hci_usb.zip
Outdated
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.
We should find a way to host this type of pre-built firmware images on the static pages rather than in the Git repo.
Hi @barbibulle thanks for the comments. The vendor HCI command for TX power is here: https://github.com/zephyrproject-rtos/zephyr/blob/a15e7d2326d9e8896401be479fae56f30dde71bb/include/zephyr/bluetooth/hci_vs.h#L163 However, I'm going to close this PR because I don't think it makes sense to have vendor commands for specific hardware that require custom built firmware as part of Bumble. I will add the definition for these commands at the application level for our Python project. I just wanted to use this PR to demonstrate the feasibility of setting TX power. |
Actually, I think it would be great to make these HCI commands and tool extension part of the main project. I’m sure others will find it useful, even if Nordic/Zephyr specific. |
Ok then! Is a vendor command section of hci.py a good location to place these command definitions? Is any sort of Device level API needed, or is Should we gate the presence of these commands with some sort of parameter in a device.json config file? |
It might be good to put the vendor HCI packet definitions in their own file. Maybe |
I will push a PR for review with a structure and supporting functions for separating vendor HCI commands in discrete modules. |
Great thanks!! |
I suggest to put them in their own files like in |
PR up for review: #269 |
fefd911
to
ffb9d55
Compare
@barbibulle @uael This PR is now ready to be reviewed and can be merged. I was searching for a good way to host the prebuilt hci_usb.zip file as part of the online docs. I ended up creating a discussion thread here and uploading the file. It appears that there is a static Github URL that can be include in the mkdocs. |
Create platforms/zephyr/hci.py with definitions of vendor HCI commands to read and write TX power. Add documentation for how to prepare an nRF52840 dongle with a Zephyr HCI USB firmware application that includes dynamic TX power support and how to send a write TX power vendor HCI command from Bumble.
ffb9d55
to
da02f6a
Compare
@barbibulle Changed the Zephyr firmware link to point to |
Add HCI Zephyr vendor commands to read and write TX power
Create platforms/zephyr/hci.py with definitions of vendor HCI commands
to read and write TX power.
Add documentation for how to prepare an nRF52840 dongle with a Zephyr
HCI USB firmware application that includes dynamic TX power support and
how to send a write TX power vendor HCI command from Bumble