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

Data Structures

class  AdvDispatcher
 The delivery half of a split-report tracker, shared so the dispatch contract (raw-callback ordering, raw_only gate, discovered-log policy) lives in one place. More...
 
class  BLEEndOfScanTrigger
 
class  BLEManufacturerDataAdvertiseTrigger
 
class  BLEServiceDataAdvertiseTrigger
 
class  DiscoveredDeviceLog
 Per-scan-period "Found device" DEBUG logger, deduplicated by MAC address. More...
 
class  ESPBLEiBeacon
 
class  ESPBTAdvertiseTrigger
 
class  ESPBTDevice
 
class  ESPBTDeviceListener
 
class  ESPBTUUID
 
struct  GattCharacteristic
 
class  GattClientListener
 The event surface a backend delivers completions through - the one place with genuine runtime polymorphism (several consumer types, one non-virtual backend). More...
 
struct  GattDescriptor
 
struct  GattService
 
struct  GattServiceTable
 Borrowed view of the backend-owned service table. More...
 
struct  HubCapabilities
 What a tracker's controller/SDK can do — consumers branch on data, not #ifdefs. More...
 
struct  RawAdvertisement
 One raw advertisement as delivered by the controller — a borrowed view, valid only for the duration of the invoke() callback. More...
 
struct  RawAdvertisementCallback
 Subscriber slot for the raw-advertisement stream (the bluetooth_proxy path). More...
 
struct  ScannerStateCallback
 Subscriber slot for scanner-state transitions; same shape as RawAdvertisementCallback, delivered on the ESPHome main loop. More...
 
class  ScanResponseMerger
 
struct  ServiceData
 

Concepts

concept  BLEGattConnectionContract
 
concept  BLEHubContract
 

Typedefs

using adv_data_t = std::vector<uint8_t>
 
using BLEHub = ESPHOME_BLE_HUB_TYPE
 
using BLEGattConnection = ESPHOME_BLE_GATT_CONNECTION_TYPE
 

Enumerations

enum class  ClientState : uint8_t {
  INIT , DISCONNECTING , IDLE , DISCOVERED ,
  CONNECTING , CONNECTED , ESTABLISHED
}
 
enum class  ConnectionType : uint8_t { V1 , V3_WITH_CACHE , V3_WITHOUT_CACHE }
 
enum class  ScannerState : uint8_t {
  IDLE = 0 , STARTING = 1 , RUNNING = 2 , FAILED = 3 ,
  STOPPING = 4 , STOPPED = 5
}
 Scanner lifecycle, wire-value aligned with the api enum so consumers cast directly (pinned by static_asserts at the cast sites). More...
 

Functions

void aes128_encrypt_block (const uint8_t key[16], const uint8_t in[16], uint8_t out[16])
 AES-128 single-block encrypt (the same software cipher CCM uses).
 
bool aes_ccm_auth_decrypt (const uint8_t key[16], const uint8_t *nonce, size_t nonce_len, const uint8_t *aad, size_t aad_len, const uint8_t *ciphertext, size_t ct_len, uint8_t *plaintext, const uint8_t *tag, size_t tag_len)
 
const char * client_state_to_string (ClientState state)
 
uint64_t mac_lsb_first_to_uint64 (const uint8_t *mac)
 Pack a controller-order (LSB-first) MAC into the uint64 the API speaks.
 
void uint64_to_mac_msb_first (uint64_t address, uint8_t out[6])
 Unpack a uint64 BLE address into printable (MSB-first) byte order — the order bd_addr_t / esp_bd_addr_t style APIs expect.
 

Typedef Documentation

◆ adv_data_t

using esphome::ble_device_base::adv_data_t = std::vector<uint8_t>

Definition at line 38 of file ble_device.h.

◆ BLEGattConnection

using esphome::ble_device_base::BLEGattConnection = ESPHOME_BLE_GATT_CONNECTION_TYPE

Definition at line 60 of file bluetooth_connection_gatt_backend.h.

◆ BLEHub

using esphome::ble_device_base::BLEHub = ESPHOME_BLE_HUB_TYPE

Definition at line 30 of file ble_hub_impl.h.

Enumeration Type Documentation

◆ ClientState

enum class esphome::ble_device_base::ClientState : uint8_t
strong
Enumerator
INIT 
DISCONNECTING 
IDLE 
DISCOVERED 
CONNECTING 
CONNECTED 
ESTABLISHED 

Definition at line 49 of file ble_client_state.h.

◆ ConnectionType

enum class esphome::ble_device_base::ConnectionType : uint8_t
strong
Enumerator
V1 
V3_WITH_CACHE 
V3_WITHOUT_CACHE 

Definition at line 69 of file ble_client_state.h.

◆ ScannerState

enum class esphome::ble_device_base::ScannerState : uint8_t
strong

Scanner lifecycle, wire-value aligned with the api enum so consumers cast directly (pinned by static_asserts at the cast sites).

Enumerator
IDLE 
STARTING 
RUNNING 
FAILED 
STOPPING 
STOPPED 

Definition at line 53 of file ble_hub.h.

Function Documentation

◆ aes128_encrypt_block()

void esphome::ble_device_base::aes128_encrypt_block ( const uint8_t key[16],
const uint8_t in[16],
uint8_t out[16] )

AES-128 single-block encrypt (the same software cipher CCM uses).

Used by ESPBTDevice::resolve_irk() for the Bluetooth "ah" RPA hash, so IRK matching works identically on every platform with no chip crypto dependency.

Definition at line 110 of file ble_aes_ccm.cpp.

◆ aes_ccm_auth_decrypt()

bool esphome::ble_device_base::aes_ccm_auth_decrypt ( const uint8_t key[16],
const uint8_t * nonce,
size_t nonce_len,
const uint8_t * aad,
size_t aad_len,
const uint8_t * ciphertext,
size_t ct_len,
uint8_t * plaintext,
const uint8_t * tag,
size_t tag_len )

Definition at line 115 of file ble_aes_ccm.cpp.

◆ client_state_to_string()

const char * esphome::ble_device_base::client_state_to_string ( ClientState state)

Definition at line 5 of file ble_client_state.cpp.

◆ mac_lsb_first_to_uint64()

uint64_t esphome::ble_device_base::mac_lsb_first_to_uint64 ( const uint8_t * mac)
inline

Pack a controller-order (LSB-first) MAC into the uint64 the API speaks.

Trackers with LSB-native SDKs call this at the emit site before filling RawAdvertisement::address; ESPBTDevice::address_uint64() is the equivalent for an already parsed device, whose address is stored MSB-first.

Definition at line 160 of file ble_device.h.

◆ uint64_to_mac_msb_first()

void esphome::ble_device_base::uint64_to_mac_msb_first ( uint64_t address,
uint8_t out[6] )
inline

Unpack a uint64 BLE address into printable (MSB-first) byte order — the order bd_addr_t / esp_bd_addr_t style APIs expect.

Definition at line 169 of file ble_device.h.