[wifi] Inline trivial WiFiAP and WiFiComponent accessors (#15075)

This commit is contained in:
J. Nick Koston
2026-03-22 10:36:18 -10:00
committed by GitHub
parent 2b6d63fd09
commit daafa8faa3
2 changed files with 5 additions and 10 deletions

View File

@@ -871,9 +871,6 @@ void WiFiComponent::loop() {
WiFiComponent::WiFiComponent() { global_wifi_component = this; } WiFiComponent::WiFiComponent() { global_wifi_component = this; }
bool WiFiComponent::has_ap() const { return this->has_ap_; }
bool WiFiComponent::is_ap_active() const { return this->ap_started_; }
bool WiFiComponent::has_sta() const { return !this->sta_.empty(); }
#ifdef USE_WIFI_11KV_SUPPORT #ifdef USE_WIFI_11KV_SUPPORT
void WiFiComponent::set_btm(bool btm) { this->btm_ = btm; } void WiFiComponent::set_btm(bool btm) { this->btm_ = btm; }
void WiFiComponent::set_rrm(bool rrm) { this->rrm_ = rrm; } void WiFiComponent::set_rrm(bool rrm) { this->rrm_ = rrm; }
@@ -2250,8 +2247,6 @@ bool WiFiAP::has_bssid() const { return this->bssid_ != bssid_t{}; }
#ifdef USE_WIFI_WPA2_EAP #ifdef USE_WIFI_WPA2_EAP
const optional<EAPAuth> &WiFiAP::get_eap() const { return this->eap_; } const optional<EAPAuth> &WiFiAP::get_eap() const { return this->eap_; }
#endif #endif
uint8_t WiFiAP::get_channel() const { return this->channel_; }
bool WiFiAP::has_channel() const { return this->channel_ != 0; }
#ifdef USE_WIFI_MANUAL_IP #ifdef USE_WIFI_MANUAL_IP
const optional<ManualIP> &WiFiAP::get_manual_ip() const { return this->manual_ip_; } const optional<ManualIP> &WiFiAP::get_manual_ip() const { return this->manual_ip_; }
#endif #endif

View File

@@ -263,8 +263,8 @@ class WiFiAP {
#ifdef USE_WIFI_WPA2_EAP #ifdef USE_WIFI_WPA2_EAP
const optional<EAPAuth> &get_eap() const; const optional<EAPAuth> &get_eap() const;
#endif // USE_WIFI_WPA2_EAP #endif // USE_WIFI_WPA2_EAP
uint8_t get_channel() const; uint8_t get_channel() const { return this->channel_; }
bool has_channel() const; bool has_channel() const { return this->channel_ != 0; }
int8_t get_priority() const { return priority_; } int8_t get_priority() const { return priority_; }
#ifdef USE_WIFI_MANUAL_IP #ifdef USE_WIFI_MANUAL_IP
const optional<ManualIP> &get_manual_ip() const; const optional<ManualIP> &get_manual_ip() const;
@@ -470,9 +470,9 @@ class WiFiComponent final : public Component {
/// Reconnect WiFi if required. /// Reconnect WiFi if required.
void loop() override; void loop() override;
bool has_sta() const; bool has_sta() const { return !this->sta_.empty(); }
bool has_ap() const; bool has_ap() const { return this->has_ap_; }
bool is_ap_active() const; bool is_ap_active() const { return this->ap_started_; }
#ifdef USE_WIFI_11KV_SUPPORT #ifdef USE_WIFI_11KV_SUPPORT
void set_btm(bool btm); void set_btm(bool btm);