Bearer.LE1: Add ReadRSSI
Status from this message: This series was applied to bluetooth/bluez.git (master)
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v5 Latest4 patches 1 replyApplied
- v44 patches 1 replySuperseded
- v34 patches 2 repliesSuperseded
Earlier versions · 2
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v2 | 4 patches | 2 replies | Superseded | |
| v1 RFC | 4 patches | 4 replies | Superseded |
Changes in v2 from the cover letter
- Make ReadRSSI a testing method and mark it [testing] in the documentation.
- Enable testing interfaces on one host in the functional test, and check that the other host does not export ReadRSSI.
- Rebase on master.
Patches in v5 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/4 | org.bluez.Bearer: Add ReadRSSI methoddoc/ | +19 | 1 reply | |
| 2/4 | adapter: Add btd_adapter_get_conn_infosrc/ src/ | +25 | 0 replies | |
| 3/4 | bearer: Add ReadRSSI methodsrc/ | +140 | 0 replies | |
| 4/4 | test: functional: add bearer ReadRSSI testtest/ | +58 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.
Cover letter [PATCH BlueZ v5 0/4] Bearer.LE1: Add ReadRSSI
This adds ReadRSSI to Bearer.LE1 as a testing method, for diagnostics and production testing, as discussed on v1 [1]. It is only available when D-Bus testing interfaces are enabled, with bluetoothd -T or Testing = true in main.conf.
Each call sends Get Connection Information, which the kernel answers from the controller or with the value it read in the last 1 to 3 seconds. A call made right after Connect returns fails with NotReady until the kernel has read the remote features.
Changes in v5, from the automated review of v4 [2]:
- When the bearer is destroyed, fail the ReadRSSI calls still waiting for the reply with NotConnected, rather than leaving them to time out.
- Rebase on master.
Changes in v4, from the automated review of v3 [3]:
- Don't cancel a Get Connection Information request that is still pending when the bearer is destroyed. The kernel replies to it anyway, and shared/mgmt would take that reply for the reply to the next request. The request now has its own state, freed by a destroy callback btd_adapter_get_conn_info takes, and btd_adapter_cancel_request is removed.
- Allocate the queue of pending calls with the request, so it does not leak if the bearer interface fails to register.
Changes in v3, from the review of v2 [4]:
- Retry ReadRSSI in the functional test while it fails with NotReady.
- Check that the RSSI is between -127 and 20 dBm instead of the -1 dBm of the emulated controller, so the test also passes with real controllers.
Changes in v2:
- Make ReadRSSI a testing method and mark it [testing] in the documentation.
- Enable testing interfaces on one host in the functional test, and check that the other host does not export ReadRSSI.
- Rebase on master.
Tested with the functional test on bluetooth-next 3f425f95ba39, and on an RTL8761BU connected to an nRF52840: with -T, ReadRSSI returned -42 dBm; without it, the method was not exported.
A request pending when the bearer is destroyed was tested with three emulated hosts and an emulator that answers Read RSSI after 1.5
seconds: host0 reads the RSSI of host1, host1 powers off, host0 removes it and then reads the RSSI of host2. With v5 the read of host1 failed with NotConnected when host1 was removed, and the read of host2 got the RSSI of host2. With v4 the read of host1 got no reply until its D-Bus timeout, and with v3 the read of host2 got the RSSI of host1. The test is not included as it needs the delay in the emulator, but I can send it if it is useful.
[1] https://lore.kernel.org/linux-bluetooth/[email protected]/
[2] https://github.com/bluez/bluez/pull/2832
[3] https://github.com/bluez/bluez/pull/2825
[4] https://lore.kernel.org/linux-bluetooth/[email protected]/
Kevin Dewald (4):
org.bluez.Bearer: Add ReadRSSI method
adapter: Add btd_adapter_get_conn_info
bearer: Add ReadRSSI method
test: functional: add bearer ReadRSSI test
doc/org.bluez.Bearer.LE.rst | 19 +++++ src/adapter.c | 18 +++++ src/adapter.h | 7 ++ src/bearer.c | 142 ++++++++++++++++++++++++++++++++- test/functional/test_bearer.py | 58 ++++++++++++++ 5 files changed, 242 insertions(+), 2 deletions(-)
base-commit: 923d95d0c2fb001b545fa8a8b2e3a8a9bf0dbabf
Signature · 1 line
2.54.0 (Apple Git-157)