Ranging Profile and Ranging Service PTS fixes
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest14 patches 2 repliesIn review
- v111 patches 3 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/14 | shared/gatt-client: Allow registering notify with explicit CCC valuesrc/ src/ | +45 | 2 replies | |
| 2/14 | shared/gatt-db: Pass the ATT opcode to the notify callbacksrc/ src/ src/ | +6 | 0 replies | |
| 3/14 | unit: Take the ATT opcode in the notify callbacksunit/ unit/ unit/ +3 more | +12 | 0 replies | |
| 4/14 | shared/gatt-db: Add gatt_db_attribute_indicate()src/ src/ src/ | +35 | 0 replies | |
| 5/14 | shared/rap: Honor CCCD transport for RAS on-demand ranging datasrc/ | +342 | 0 replies | |
| 6/14 | shared/rap: Add RAS Control Point Abort Operationsrc/ | +30 | 0 replies | |
| 7/14 | unit/test-rap: Expect Abort Operation in RAS Featuresunit/ | +3 | 0 replies | |
| 8/14 | shared/rap: Shorten the requester Control Point response timeoutsrc/ | +1 | 0 replies | |
| 9/14 | shared/rap: Add real-time ranging data delivery on the respondersrc/ | +139 | 0 replies | |
| 10/14 | shared/rap: Add requester ranging data subscription APIsrc/ src/ | +253 | 0 replies | |
| 11/14 | profiles/ranging: Expose requester ranging data mode over D-Busprofiles/ | +36 | 0 replies | |
| 12/14 | client: Add Channel Sounding ranging data mode controlclient/ | +87 | 0 replies | |
| 13/14 | doc: Document Channel Sounding ranging data mode controldoc/ doc/ | +56 | 0 replies | |
| 14/14 | doc/qualification: Add RAP/RAS PTS qualification resultsdoc/ doc/ | +315 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.
Cover letter [PATCH v2 00/14] Ranging Profile and Ranging Service PTS fixes
Changes since v1, from review:
- src/ and unit/ are in separate patches throughout. Two of those splits leave the unit tests broken in between: patch 2 changes gatt_db_notify_t and patch 3 updates the test callbacks, so on patch 2 alone they do not compile; patch 6 advertises Abort Operation in RAS Features and patch 7 updates the value test-rap expects. src/bluetoothd builds on every patch, and the tests pass once each pair is applied. Squashing the pairs would avoid it, if you would rather have that.
- gatt_db_attribute_indicate_only() is gone. gatt_db_notify_t now takes the ATT opcode of the operation it is serving, the way gatt_db_read_t and gatt_db_write_t already do, and gatt-database reads the transport from that argument instead of asking the attribute what the current call is doing. The test-rap hunk that read the old getter turned out to be dead
code: that callback is never reached by any of the 25 cases, and dropping it leaves them all passing.
Qualifying the existing Ranging Profile and Ranging Service code against PTS turned up behaviour that does not match the specifications, plus procedures that were not implemented at all. This series is what the RAP Requester and RAS Server needed to pass, and the PTS results it records.
Most of it comes down to one thing the GATT layer could not express. RAS picks the notification or the indication transport per characteristic, and when a client enables both, the choice is not the same everywhere:
- Ranging Data Ready and Ranging Data Overwritten must be indicated (RAS 3.4.2, 3.5.2; RAS/SR/RCO/BV-08-C and BV-09-C).
- On-demand and Real-time Ranging Data must be notified (RAS 3.2.2, 3.2.3.1; RAS/SR/RCO/BV-05..07-C and RAS/SR/RRD/BV-03-C).
gatt_db_attribute_notify() prefers notifications whenever the client enabled them, so a server cannot honour the first rule, and bt_gatt_client_register_notify() derives the CCC value from the characteristic properties, so a requester cannot ask for one transport specifically. Patches 1 to 4 add an entry point for each case.
Patches 5 to 9 apply that on the responder and fill in what the RAS Server cases exercise: the transport of every notified characteristic now follows the peer's CCCD, Abort Operation is implemented and advertised in RAS Features, the requester's Control Point watchdog uses the 5 seconds RAP 4.5.4.1 specifies, and Real-time Ranging Data is queued so segments are not dropped when a procedure completes before they are all sent.
Segmented ranging data was also queued a whole transfer at a time, which starves incoming ATT operations: notifications land on the att write queue, which pick_next_send_op() drains ahead of the request queue and with no flow control of its own. It now goes out a segment at a time, gated on confirmations for indications and on a short delay otherwise, so an Abort Operation stops a transfer the peer no longer wants instead of having to wait for it to drain. A real flow control for the notification path, driven by how much the att write queue has left to send, would be better than that delay and is left for later.
Patches 10 to 12 add the requester side the RAP cases need: an API to select Real-time or On-demand reception together with the transport to configure on the peer, exposed as org.bluez.ChannelSounding1.SetRangingDataMode() and as a bluetoothctl ranging-data-mode command.
Patches 13 and 14 document the new method and command, and record the
results: 19 RAP and 31 RAS cases pass with PTS 8.14.0.4, run against PTS pre-generated ranging data (TSPX_test_method), since the PTS dongle in use does not support Channel Sounding. That covers the RAS protocol behaviour above but not the HCI Channel Sounding entry path. RAS/SR/SPE/BI-02-C is listed as not applicable, since RAS.TS Table 5.1 selects it only when Abort Operation is unsupported and the IUT supports it.
At the tip of the series, unit/test-rap, test-bap, test-bass, test-mcp, test-micp, test-vcp and test-gatt all pass.
Cheng Jiang (14):
shared/gatt-client: Allow registering notify with explicit CCC value shared/gatt-db: Pass the ATT opcode to the notify callback
unit: Take the ATT opcode in the notify callbacks shared/gatt-db: Add gatt_db_attribute_indicate() shared/rap: Honor CCCD transport for RAS on-demand ranging data shared/rap: Add RAS Control Point Abort Operation unit/test-rap: Expect Abort Operation in RAS Features shared/rap: Shorten the requester Control Point response timeout shared/rap: Add real-time ranging data delivery on the responder shared/rap: Add requester ranging data subscription API profiles/ranging: Expose requester ranging data mode over D-Bus
client: Add Channel Sounding ranging data mode control
doc: Document Channel Sounding ranging data mode control doc/qualification: Add RAP/RAS PTS qualification results
client/cs.c | 87 +++ doc/bluetoothctl-cs.rst | 24 + doc/org.bluez.ChannelSounding1.rst | 32 ++ doc/qualification/rap-pts.rst | 180 ++++++ doc/qualification/ras-pts.rst | 135 +++++ profiles/ranging/rap.c | 36 ++ src/gatt-database.c | 10 +- src/shared/gatt-client.c | 43 +- src/shared/gatt-client.h | 7 + src/shared/gatt-db.c | 21 +- src/shared/gatt-db.h | 15 +- src/shared/rap.c | 842 ++++++++++++++++++++++++----- src/shared/rap.h | 23 + unit/test-bap.c | 3 +- unit/test-bass.c | 3 +- unit/test-mcp.c | 3 +- unit/test-micp.c | 3 +- unit/test-rap.c | 9 +- unit/test-vcp.c | 3 +- 19 files changed, 1335 insertions(+), 144 deletions(-) create mode 100644 doc/qualification/rap-pts.rst create mode 100644 doc/qualification/ras-pts.rst
Signature · 1 line
2.43.0