-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
samples: bluetooth: use zephyr:code-sample directive #77760
Conversation
71c8db2
to
d8032cd
Compare
* :ref:`bluetooth-beacon-sample` | ||
* :ref:`peripheral_hr` | ||
* :zephyr:code-sample:`bluetooth_beacon` | ||
* :zephyr:code-sample:`ble_peripheral_hr` |
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.
why is one prefixed with bluetooth_
and the other with ble_
? Don't think the beacon sample runs on a classic stack.
I would prefer bluetooth_classic_xx
for classic samples, and the rest is assumed to be LE.
What do you think?
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.
There's a few more with the same inconsistency. Also some that is prefixed with _
, and even one that is bluetooth_bt
:D
Are we planning on using explicit tags, or should we attempt to shorten them at bit? e.g.
bluetooth_beacon => bt_beacon
bluetooth_direction_finding_central => bt_df_central
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.
I would prefer long names for the documentation references. Shortening the filenames/path should be ok. Although i hope people have shell completion
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.
The simplest route might be to just use the same IDs as the folder names?
Related: is it time to introduce some subfolders underneath samples/bluetooth
? It's starting to get really packed in there :)
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.
The simplest route might be to just use the same IDs as the folder names? Related: is it time to introduce some subfolders underneath
samples/bluetooth
? It's starting to get really packed in there :)
#64443 :)
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.
The simplest route might be to just use the same IDs as the folder names? Related: is it time to introduce some subfolders underneath
samples/bluetooth
? It's starting to get really packed in there :)
Sure, so we can have bluetooth
prefix for all BT samples, and then, when we do the above move, we can have them like bluetooth_audio_xxx
, bluetooth_mesh_xxx
samples/bluetooth/hap_ha/README.rst
Outdated
|
||
Bluetooth: HAP Hearing Aid (HA) | ||
############################### | ||
Advertise and XXX |
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.
Demonstrate the Bluetooth LE Audio Hearing Aid role
samples/bluetooth/hci_ipc/README.rst
Outdated
|
||
Bluetooth: HCI IPC | ||
################## | ||
Expose Zephyr Bluetooth controller to another device or CPU using the IPC subsystem. |
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.
It can be any configured bluetooth controller. eg, even one connected over UART
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.
same comment for the other hci_xx samples
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.
I took the wording from the "Overview" section of most HCI samples, so I guess they need to be fixed?
https://docs.zephyrproject.org/latest/samples/bluetooth/hci_spi/README.html#overview
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.
oh yeah then they need to fixed, yes
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.
should be addressed both in the new descriptions and legacy "Overview" sections
|
||
Bluetooth: HCI H4 over USB | ||
########################## | ||
Turn a Zephyr board into a USB H4 Bluetooth dongle. |
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.
Turn a Zephyr board into a USB H4 Bluetooth dongle. Only supported by BlueZ on linux.
samples/bluetooth/hci_usb/README.rst
Outdated
|
||
Bluetooth: HCI USB | ||
################## | ||
Turn a Zephyr board into a USB Bluetooth dongle. |
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.
Turn a Zephyr board into a USB Bluetooth dongle. Compatible with all major operating systems (Mac, Windows, Linux).
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.
Not sure I agree with making the "short" description that long but I get your point and will see if I can add the precision in a maybe more concise way if you really think it's important to have it right at the sample listing level.
|
||
Bluetooth: HCI VS Scan Request | ||
############################## | ||
Manage vendor-specific HCI commands to obtain scan request events even using xxx. |
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.
Use vendor-specific HCI commands to enable Scan Request events when using legacy advertising.
8a08d7e
to
4a0fffa
Compare
* :ref:`bluetooth-beacon-sample` | ||
* :ref:`peripheral_hr` | ||
* :zephyr:code-sample:`bluetooth_beacon` | ||
* :zephyr:code-sample:`ble_peripheral_hr` |
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.
The simplest route might be to just use the same IDs as the folder names? Related: is it time to introduce some subfolders underneath
samples/bluetooth
? It's starting to get really packed in there :)
Sure, so we can have bluetooth
prefix for all BT samples, and then, when we do the above move, we can have them like bluetooth_audio_xxx
, bluetooth_mesh_xxx
:name: Broadcast Audio Sink | ||
:relevant-api: bluetooth | ||
|
||
Bluetooth: Broadcast Audio Sink | ||
Use LE Audio Broadcast Sink functionality. |
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.
I think I'll follow up with a name update PR later - I think several of our LE audio samples could benefit from better names and descriptions, but let's not muddy this PR too much with that :)
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.
Yes, this would be awesome. It's true that a lot of the names and descriptions are very "content-free" right now and not all that helpful. Hopefully the follow-up PR will be much easier to implement once the directives will already be there :)
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.
#78094 :)
@@ -1,8 +1,8 @@ | |||
.. zephyr:code-sample:: bluetooth_cap_acceptor | |||
:name: Bluetooth: Common Audio Profile Acceptor | |||
:name: Common Audio Profile Acceptor |
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.
What do you prefer:
- Common Audio Profile Acceptor
- Common Audio Profile (CAP) Acceptor
- CAP Acceptor
Just in case we want to be consistent with the Audio samples later
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 probably best as this makes it easier to capture all the various types/combination of search queries users might perform
I thought someone said they would address naming in a follow-up PR though? :P
Describe the samples using code-sample directive in preparation for upcoming changes to the Zephyr documentation that will be leveraging the provided description and metadata. Signed-off-by: Benjamin Cabé <[email protected]>
Replace occurrences of "BLE" by the recommended "Bluetooth LE" term. Signed-off-by: Benjamin Cabé <[email protected]>
4a0fffa
to
6d1af38
Compare
@@ -1,19 +1,20 @@ | |||
.. _bluetooth_central_gatt_write: | |||
.. zephyr:code-sample:: ble_central_gatt_write |
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.
Similar to the BLE -> Bluetooth LE
change you did, we should probably do it for the references as well - Especially the ones that you've added/modified in this PR
.. zephyr:code-sample:: ble_central_gatt_write | |
.. zephyr:code-sample:: bluetooth_central_gatt_write |
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.
They can also match the prefix we use in the stack as a shorter alternative:
.. zephyr:code-sample:: ble_central_gatt_write | |
.. zephyr:code-sample:: bt_le_central_gatt_write |
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.
Sure, I can give it a try.
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.
I am actually not sure I have the knowledge required to pick the "right" prefix. I would frankly just name them bt_<samplefoldername>
. The point is really just to have some kind of unique ID for documentation purposes, it's not like it's directly exposed to the end user or anything
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.
it's not like it's directly exposed to the end user or anything
Nor do we have any documentation or guidelines for naming schemes of sample labels :)
Doesn't need a fix in this PR, but arguably something that makes sense to make consistent later
.. _bluetooth_direction_finding_central: | ||
.. zephyr:code-sample:: bluetooth_direction_finding_central | ||
:name: Direction Finding Central | ||
:relevant-api: bluetooth |
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.
What was your process for finding the relevant APIs?
I think any central
sample should also have bt_conn
as a API reference, as that is used to establish the connections
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.
My process can be best described as "best effort" for an initial pass :)
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.
Alright - Thought you might have made a script to check which functions were called (which in theory is possible, although not a 5-min task ;) )
@jhedberg @jori-nordic good enough for you guys? Happy to address some remaining tweaks that would be needed but ideally we can continue any pending housekeeping tasks in follow-up PRs. Thanks! |
Describe the Bluetooth samples using
code-sample
directive in preparation for upcoming changes to the Zephyr documentation that will be leveraging the provided description and metadata.This is a work in progress but I am almost done. Perhaps the main "disruptive" change this is introducing is dropping "Bluetooth: " prefix in front of all the samples' names, but hopefully people agree it is redundant :)
The "descriptions" are not prominently featured just yet but will be in an upcoming update to how samples are listed. It will look something like the below, which hopefully illustrates the added value of these short descriptions :)
Could people added as early reviewers confirm that this is going in the right direction for them and that I didn't miss something obvious or a constraint specific to Bluetooth samples?
Note that the upcoming change to the docs will allow to add code sample categories, so it might make sense to add new groups for TMAP, HCI, etc. at some point