ESPHome 2026.11.0b6
Loading...
Searching...
No Matches
esphome::wifi::ExpectedDisconnect Class Reference

#include <expected_disconnect.h>

Public Member Functions

void arm (const uint8_t *bssid)
 
void clear ()
 
template<typename ReadBssid , typename Disconnect >
bool disconnect_and_expect_leave (ReadBssid &&read_bssid, Disconnect &&disconnect)
 Disconnects and, once that succeeds, expects the leave event.
 
bool is_previous_ap (const uint8_t *bssid) const
 A connected event still queued from the previous AP; it keeps the expectation.
 
ExpectedLeave consume_disconnect (const uint8_t *bssid, bool is_leave)
 Which expected leave a disconnect is.
 

Protected Member Functions

void arm_ (const uint8_t *bssid, ExpectedLeave expected)
 

Protected Attributes

std::array< uint8_t, 6 > bssid_ {}
 
ExpectedLeave expected_ {ExpectedLeave::EXPECTED_LEAVE_NONE}
 

Detailed Description

Definition at line 17 of file expected_disconnect.h.

Member Function Documentation

◆ arm()

void esphome::wifi::ExpectedDisconnect::arm ( const uint8_t * bssid)
inline

Definition at line 19 of file expected_disconnect.h.

◆ arm_()

void esphome::wifi::ExpectedDisconnect::arm_ ( const uint8_t * bssid,
ExpectedLeave expected )
inlineprotected

Definition at line 52 of file expected_disconnect.h.

◆ clear()

void esphome::wifi::ExpectedDisconnect::clear ( )
inline

Definition at line 20 of file expected_disconnect.h.

◆ consume_disconnect()

ExpectedLeave esphome::wifi::ExpectedDisconnect::consume_disconnect ( const uint8_t * bssid,
bool is_leave )
inline

Which expected leave a disconnect is.

is_leave covers an AP's association leave (8) and the station leave of an attempt that never associated (36). Every disconnect ends the expectation, so it matches at most once.

Definition at line 44 of file expected_disconnect.h.

◆ disconnect_and_expect_leave()

template<typename ReadBssid , typename Disconnect >
bool esphome::wifi::ExpectedDisconnect::disconnect_and_expect_leave ( ReadBssid && read_bssid,
Disconnect && disconnect )
inline

Disconnects and, once that succeeds, expects the leave event.

read_bssid(uint8_t *out) runs first, since the record is gone after the disconnect, and writes the AP's BSSID only when it returns true; without an AP the attempt's leave, with no BSSID, is expected. disconnect() returns whether it succeeded, which is the result.

Definition at line 26 of file expected_disconnect.h.

◆ is_previous_ap()

bool esphome::wifi::ExpectedDisconnect::is_previous_ap ( const uint8_t * bssid) const
inline

A connected event still queued from the previous AP; it keeps the expectation.

Definition at line 37 of file expected_disconnect.h.

Field Documentation

◆ bssid_

std::array<uint8_t, 6> esphome::wifi::ExpectedDisconnect::bssid_ {}
protected

Definition at line 57 of file expected_disconnect.h.

◆ expected_

ExpectedLeave esphome::wifi::ExpectedDisconnect::expected_ {ExpectedLeave::EXPECTED_LEAVE_NONE}
protected

Definition at line 58 of file expected_disconnect.h.


The documentation for this class was generated from the following file: