ESPHome 2026.8.0b4
Loading...
Searching...
No Matches
esphome::bk72xx_ble Namespace Reference

Data Structures

class  BK72xxBLE
 
class  BLEScanListener
 Consumer interface for controller scan reports. More...
 
struct  BLEScanReport
 One advertisement report from the controller. More...
 
struct  ScanParams
 One scan request: mode plus timing, in BLE units (0.625 ms). More...
 

Enumerations

enum class  BdkActivityState : uint8_t { IDLE , CREATED , STARTED , OTHER }
 Scan-relevant controller activity states, read live from the SDK. More...
 
enum class  BdkOpResult : uint8_t { OK , BUSY , FAILED }
 Outcome of a BDK scan operation request. More...
 
enum class  BLEComponentState : uint8_t { STATE_OFF = 0 , ENABLING , ACTIVE }
 
enum class  ScanOpResult : uint8_t { SETTLED , PENDING , FAILED }
 Outcome of one reconciliation step. More...
 

Functions

bool bdk_scan_ready ()
 True when no controller operation is in flight (APP_BLE_READY).
 
BdkActivityState bdk_scan_state (uint8_t activity_idx)
 Live state of the given activity; INVALID_ACTIVITY_IDX reads as IDLE.
 
uint8_t bdk_scan_acquire_activity ()
 Claim an idle activity slot; INVALID_ACTIVITY_IDX when none is free.
 
BdkOpResult bdk_scan_create (uint8_t activity_idx)
 Create the scan activity (asynchronous); started once CREATED is observed.
 
BdkOpResult bdk_scan_start (uint8_t activity_idx, uint16_t interval, uint16_t window, bool active)
 Start a created activity: the packed GAPM start, taking the scan mode the BDK's own start path hardcodes away.
 
BdkOpResult bdk_scan_release (uint8_t activity_idx, bool created, int *err_out)
 Release the activity: delete when never started (a stop would be rejected), stop otherwise.
 

Variables

constexpr uint8_t INVALID_ACTIVITY_IDX = 0xFF
 Activity index value marking "no scan activity", the BDK's own convention (asserted against its symbol in bdk_scan.cpp).
 

Enumeration Type Documentation

◆ BdkActivityState

enum class esphome::bk72xx_ble::BdkActivityState : uint8_t
strong

Scan-relevant controller activity states, read live from the SDK.

Enumerator
IDLE 

No activity (or one whose create failed).

CREATED 

Created but not started.

STARTED 

Scanning.

OTHER 

A non-scan or transitional state; settles on a later read.

Definition at line 16 of file bdk_scan.h.

◆ BdkOpResult

enum class esphome::bk72xx_ble::BdkOpResult : uint8_t
strong

Outcome of a BDK scan operation request.

Enumerator
OK 

Accepted; completion is asynchronous.

BUSY 

Another controller operation is in flight; retry later.

FAILED 

Rejected.

Definition at line 24 of file bdk_scan.h.

◆ BLEComponentState

enum class esphome::bk72xx_ble::BLEComponentState : uint8_t
strong
Enumerator
STATE_OFF 
ENABLING 
ACTIVE 

Definition at line 18 of file bk72xx_ble.h.

◆ ScanOpResult

enum class esphome::bk72xx_ble::ScanOpResult : uint8_t
strong

Outcome of one reconciliation step.

Enumerator
SETTLED 

The request is reached: scan observed running, or stopped with the activity fully released.

PENDING 

A step is in flight; loop() keeps advancing — call scan_start() again to learn the outcome.

FAILED 

The controller rejected a step; retry later.

Definition at line 25 of file bk72xx_ble.h.

Function Documentation

◆ bdk_scan_acquire_activity()

uint8_t esphome::bk72xx_ble::bdk_scan_acquire_activity ( )

Claim an idle activity slot; INVALID_ACTIVITY_IDX when none is free.

Definition at line 63 of file bdk_scan.cpp.

◆ bdk_scan_create()

BdkOpResult esphome::bk72xx_ble::bdk_scan_create ( uint8_t activity_idx)

Create the scan activity (asynchronous); started once CREATED is observed.

Definition at line 70 of file bdk_scan.cpp.

◆ bdk_scan_ready()

bool esphome::bk72xx_ble::bdk_scan_ready ( )

True when no controller operation is in flight (APP_BLE_READY).

Definition at line 46 of file bdk_scan.cpp.

◆ bdk_scan_release()

BdkOpResult esphome::bk72xx_ble::bdk_scan_release ( uint8_t activity_idx,
bool created,
int * err_out )

Release the activity: delete when never started (a stop would be rejected), stop otherwise.

BUSY on a transient rejection (retry), FAILED on any other error; err_out receives the SDK code (0 on success). Teardown is asynchronous — observe IDLE to confirm.

Definition at line 105 of file bdk_scan.cpp.

◆ bdk_scan_start()

BdkOpResult esphome::bk72xx_ble::bdk_scan_start ( uint8_t activity_idx,
uint16_t interval,
uint16_t window,
bool active )

Start a created activity: the packed GAPM start, taking the scan mode the BDK's own start path hardcodes away.

Fire-and-forget; FAILED when the kernel message could not be allocated (the armed SDK operation is rolled back).

Definition at line 80 of file bdk_scan.cpp.

◆ bdk_scan_state()

BdkActivityState esphome::bk72xx_ble::bdk_scan_state ( uint8_t activity_idx)

Live state of the given activity; INVALID_ACTIVITY_IDX reads as IDLE.

Definition at line 48 of file bdk_scan.cpp.

Variable Documentation

◆ INVALID_ACTIVITY_IDX

uint8_t esphome::bk72xx_ble::INVALID_ACTIVITY_IDX = 0xFF
inlineconstexpr

Activity index value marking "no scan activity", the BDK's own convention (asserted against its symbol in bdk_scan.cpp).

Definition at line 13 of file bdk_scan.h.