26 uint8_t
mac[MAC_ADDRESS_SIZE];
63static constexpr uint8_t MAX_SCAN_REPORT_QUEUE_SIZE = 64;
67static constexpr uint16_t REJECTED_DEAD_SCANNER_THRESHOLD = 16;
71 void setup()
override;
91#ifdef LN882H_BLE_SCAN_LISTENER_COUNT
102 void scan_start(uint16_t interval, uint16_t window,
bool active);
121#ifdef LN882H_BLE_SCAN_LISTENER_COUNT
Minimal static vector - saves memory by avoiding std::vector overhead.
Consumer interface for controller scan reports.
virtual void on_scan_report(const BLEScanReport &report)=0
~BLEScanListener()=default
void count_rejected_report()
Internal, rw-task context: count a report rejected by the legacy-only filter, so a wrong assumption a...
esphome::EventPool< BLEScanReport, MAX_SCAN_REPORT_QUEUE_SIZE - 1 > report_pool_
float get_setup_priority() const override
bool reject_diagnosis_done_
void get_mac_lsb_first(uint8_t out[6]) const
Controller BLE address in the SDK's ln_bd_addr_t order: least-significant octet first (the BLE/HCI co...
esphome::LockFreeQueue< BLEScanReport, MAX_SCAN_REPORT_QUEUE_SIZE > report_queue_
uint32_t rejected_before_delivery_
BLEScanReport * allocate_scan_report()
Internal, SDK rw-task event-callback context: allocate a pool slot for a scan report.
void set_enable_on_boot(bool enable_on_boot)
void register_scan_listener(BLEScanListener *listener)
Register a consumer for scan reports (delivered on the main task via loop()).
std::atomic< uint16_t > rejected_reports_
StaticVector< BLEScanListener *, LN882H_BLE_SCAN_LISTENER_COUNT > scan_listeners_
uint8_t ble_mac_[MAC_ADDRESS_SIZE]
void dump_config() override
void push_scan_report(BLEScanReport *report)
Internal: hand a filled slot to the main-task queue (cannot fail — the pool is sized to the queue cap...
void enable()
Bring up the LN882H BLE stack (one-time; the SDK has no teardown path).
void scan_stop()
Stop the controller scan (no-op when not scanning).
One scan report from the controller, decoded from the SDK's rw-task event (RSSI already sign-correcte...
uint8_t mac[MAC_ADDRESS_SIZE]