Skip to content

Distinguish hardware/rfkill-blocked from software-off Bluetooth adapter state #1996

Description

@Vodur

Follow-up from #1986.

While adding BleakAdapter.get() in #1986, we chose to raise BleakBluetoothNotAvailableError with reason POWERED_OFF whenever the adapter isn't on, without distinguishing a hardware/rfkill block from a software toggle. Worth revisiting whether to expose that distinction with a dedicated reason.

Per-platform state:

  • Windows: exposed reliably — RadioState.Disabled is the hardware/firmware switch (not programmatically changeable), RadioState.Off is the software toggle.
  • Linux/BlueZ: only via the experimental PowerState property, where off-blocked (rfkill) looks equivalent to Windows' Disabled. The stable Powered flag carries no cause.
  • macOS: no hardware switch exists and CBManagerState.poweredOff carries no cause, so there's nothing to distinguish.

Since BlueZ PowerState is still experimental, leaving this for the future. Once it's stable, the direction would be to map WinRT Disabled and BlueZ off-blocked to a shared "hardware/rfkill blocked" reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions