mirror of
https://github.com/esphome/esphome.git
synced 2026-10-10 13:33:06 +00:00
[improv_ble] Pack the byte fields into the padding after connecting_sta_ (#20137)
This commit is contained in:
@@ -72,9 +72,6 @@ class ImprovBLEComponent final : public Component, public improv_base::ImprovBas
|
||||
improv::Error get_improv_error_state() const { return this->error_state_; }
|
||||
|
||||
protected:
|
||||
bool should_start_{false};
|
||||
bool setup_complete_{false};
|
||||
|
||||
uint32_t identify_start_{0};
|
||||
uint32_t identify_duration_;
|
||||
uint32_t authorized_start_{0};
|
||||
@@ -84,6 +81,14 @@ class ImprovBLEComponent final : public Component, public improv_base::ImprovBas
|
||||
|
||||
std::vector<uint8_t> incoming_data_;
|
||||
wifi::WiFiAP connecting_sta_;
|
||||
// Single byte fields here fill the alignment gap between connecting_sta_ and the next pointer
|
||||
improv::State state_{improv::STATE_STOPPED};
|
||||
improv::Error error_state_{improv::ERROR_NONE};
|
||||
bool should_start_{false};
|
||||
bool setup_complete_{false};
|
||||
bool status_indicator_state_{false};
|
||||
bool advertising_device_name_{false};
|
||||
bool advertising_requested_{false};
|
||||
|
||||
BLEService *service_{nullptr};
|
||||
BLECharacteristic *status_{nullptr};
|
||||
@@ -99,16 +104,11 @@ class ImprovBLEComponent final : public Component, public improv_base::ImprovBas
|
||||
output::BinaryOutput *status_indicator_{nullptr};
|
||||
#endif
|
||||
|
||||
improv::State state_{improv::STATE_STOPPED};
|
||||
improv::Error error_state_{improv::ERROR_NONE};
|
||||
#ifdef USE_IMPROV_BLE_STATE_CALLBACK
|
||||
CallbackManager<void(improv::State, improv::Error)> state_callback_{};
|
||||
#endif
|
||||
|
||||
bool status_indicator_state_{false};
|
||||
uint32_t last_name_adv_time_{0};
|
||||
bool advertising_device_name_{false};
|
||||
bool advertising_requested_{false};
|
||||
void set_status_indicator_state_(bool state);
|
||||
void update_advertising_type_();
|
||||
void request_advertising_();
|
||||
|
||||
@@ -303,7 +303,7 @@ class WiFiAP {
|
||||
bssid_t bssid_{}; // 6 bytes, all zeros = any/not set
|
||||
uint8_t channel_{0}; // 1 byte, 0 = auto/not set
|
||||
int8_t priority_{0}; // 1 byte
|
||||
bool hidden_{false}; // 1 byte (+ 3 bytes end padding to 4-byte align)
|
||||
bool hidden_{false}; // 1 byte; WiFiAP is byte aligned unless manual IP or EAP adds a 4 byte aligned member
|
||||
};
|
||||
|
||||
class WiFiScanResult {
|
||||
|
||||
Reference in New Issue
Block a user