Skip to content

Add Advertising Coding Selection (Bluetooth 5.4) - #211

Merged
colemancda merged 1 commit into
masterfrom
feature/hci-cssa
Jul 9, 2026
Merged

Add Advertising Coding Selection (Bluetooth 5.4)#211
colemancda merged 1 commit into
masterfrom
feature/hci-cssa

Conversation

@colemancda

Copy link
Copy Markdown
Member

Phase 3 of Bluetooth Core 5.4 support: Advertising Coding Selection (CSSA), plus the missing 5.1–5.3 link layer feature bits and another wrong-opcode fix found along the way.

What changed

  • HCILESetExtendedAdvertisingParametersV2 (opcode 0x007F) — composes the v1 parameters and appends the new Primary_Advertising_PHY_Options / Secondary_Advertising_PHY_Options octets (noPreference/preferS2/preferS8/requireS2/requireS8), with return parameter and a setExtendedAdvertisingParametersV2 convenience method.
  • Extended advertising reportPrimaryPHY/SecondaryPHY now accept 0x04 (LE Coded, S=2); 0x03 documented as S=8 under CSSA.
  • LowEnergyFeature — added all missing feature bits 17–44 (CTE, PAST, SCA, CIS/ISO, power control, path loss, subrating, channel classification, CSSA 40/41, DBAF 42, PAwR 43/44) with allCases and name-table entries. Bit numbers verified against Zephyr's hci_types.h.
  • Bug fix: HCILESetExtendedAdvertisingParameters.command was bound to .setAdvertisingSetRandomAddress (0x0035) instead of .setExtendedAdvertisingParameters (0x0036) — same defect class as the setDefaultPhy fix in Fix Set Default PHY opcode and implement Set Event Filter #208. The v1 command struct sent the wrong opcode; regression test added.

Notes for review

  • The isValid (valid Controller-to-Controller) flags for the new feature bits follow the Vol 6 Part B Table 4.4 pattern (connection procedures = Y; advertising/broadcast/host-support = N) — worth double-checking against the spec table.
  • Tests: byte-exact v1/v2 encode vectors, opcode regression checks, feature-bit position checks, uniqueness of raw values, and a sweep asserting every feature case has a name entry (the name lookup would fatalError otherwise).

Full suite: 285 tests pass; lint clean.

- Add HCILESetExtendedAdvertisingParametersV2 (opcode 0x007F) with the
  Primary/Secondary_Advertising_PHY_Options parameters for expressing
  S=2/S=8 coding preferences on the LE Coded PHY, plus a host controller
  convenience method.
- Allow the LE Coded S=2 value (0x04) in the extended advertising report
  Primary_PHY and Secondary_PHY fields.
- Add the missing 5.1-5.4 link layer feature bits (17-44) to
  LowEnergyFeature, including Advertising Coding Selection (40/41) and
  Periodic Advertising with Responses (43/44).
- Fix HCILESetExtendedAdvertisingParameters being bound to the
  setAdvertisingSetRandomAddress opcode (0x0035) instead of
  setExtendedAdvertisingParameters (0x0036).
@colemancda
colemancda merged commit 9c87bc4 into master Jul 9, 2026
34 of 38 checks passed
@colemancda
colemancda deleted the feature/hci-cssa branch July 9, 2026 21:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant