Skip to content

Commit

Permalink
[NXP][Zephyr] Integrate wifi improvements and updates from nrfconnect (
Browse files Browse the repository at this point in the history
…project-chip#35273)

* [NXP][Zephyr] Integrate wifi improvements and updates from nrfconnect

 * WiFiNetworkDiagnostics events generation
 * Make Wi-Fi manager use Wi-Fi interface only
 * Rework joining/leaving mcast group
 * mDNS refresh after IPv6 change
 * Scan for a specific SSID
 * Fix tx/rx unicast counters
 * Fix missing network band in scan response
 * Various other fixes/improvements

Signed-off-by: Axel Le Bourhis <[email protected]>

* Restyled by clang-format

---------

Signed-off-by: Axel Le Bourhis <[email protected]>
Co-authored-by: Restyled.io <[email protected]>
  • Loading branch information
axelnxp and restyled-commits authored Aug 29, 2024
1 parent 203f03a commit 9bbf5b9
Show file tree
Hide file tree
Showing 6 changed files with 395 additions and 173 deletions.
16 changes: 8 additions & 8 deletions src/platform/Zephyr/wifi/ConnectivityManagerImplWiFi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ ConnectivityManager::WiFiStationMode ConnectivityManagerImplWiFi::_GetWiFiStatio
{
if (mStationMode != ConnectivityManager::WiFiStationMode::kWiFiStationMode_ApplicationControlled)
{
mStationMode = (WiFiManager::StationStatus::DISABLED == WiFiManager().Instance().GetStationStatus())
mStationMode = (WiFiManager::StationStatus::DISABLED == WiFiManager::Instance().GetStationStatus())
? ConnectivityManager::WiFiStationMode::kWiFiStationMode_Disabled
: ConnectivityManager::WiFiStationMode::kWiFiStationMode_Enabled;
}
Expand All @@ -60,7 +60,7 @@ CHIP_ERROR ConnectivityManagerImplWiFi::_SetWiFiStationMode(ConnectivityManager:

bool ConnectivityManagerImplWiFi::_IsWiFiStationEnabled(void)
{
return (WiFiManager::StationStatus::DISABLED <= WiFiManager().Instance().GetStationStatus());
return (WiFiManager::StationStatus::DISABLED <= WiFiManager::Instance().GetStationStatus());
}

bool ConnectivityManagerImplWiFi::_IsWiFiStationApplicationControlled(void)
Expand All @@ -70,7 +70,7 @@ bool ConnectivityManagerImplWiFi::_IsWiFiStationApplicationControlled(void)

bool ConnectivityManagerImplWiFi::_IsWiFiStationConnected(void)
{
return (WiFiManager::StationStatus::CONNECTED == WiFiManager().Instance().GetStationStatus());
return (WiFiManager::StationStatus::CONNECTED == WiFiManager::Instance().GetStationStatus());
}

System::Clock::Timeout ConnectivityManagerImplWiFi::_GetWiFiStationReconnectInterval(void)
Expand All @@ -88,14 +88,14 @@ bool ConnectivityManagerImplWiFi::_IsWiFiStationProvisioned(void)
{
// from Matter perspective `provisioned` means that the supplicant has been provided
// with SSID and password (doesn't matter if valid or not)
return (WiFiManager::StationStatus::CONNECTING <= WiFiManager().Instance().GetStationStatus());
return (WiFiManager::StationStatus::CONNECTING <= WiFiManager::Instance().GetStationStatus());
}

void ConnectivityManagerImplWiFi::_ClearWiFiStationProvision(void)
{
if (_IsWiFiStationProvisioned())
{
if (CHIP_NO_ERROR != WiFiManager().Instance().ClearStationProvisioningData())
if (CHIP_NO_ERROR != WiFiManager::Instance().ClearStationProvisioningData())
{
ChipLogError(DeviceLayer, "Cannot clear WiFi station provisioning data");
}
Expand All @@ -104,9 +104,9 @@ void ConnectivityManagerImplWiFi::_ClearWiFiStationProvision(void)

bool ConnectivityManagerImplWiFi::_CanStartWiFiScan()
{
return (WiFiManager::StationStatus::DISABLED != WiFiManager().Instance().GetStationStatus() &&
WiFiManager::StationStatus::SCANNING != WiFiManager().Instance().GetStationStatus() &&
WiFiManager::StationStatus::CONNECTING != WiFiManager().Instance().GetStationStatus());
return (WiFiManager::StationStatus::DISABLED != WiFiManager::Instance().GetStationStatus() &&
WiFiManager::StationStatus::SCANNING != WiFiManager::Instance().GetStationStatus() &&
WiFiManager::StationStatus::CONNECTING != WiFiManager::Instance().GetStationStatus());
}

void ConnectivityManagerImplWiFi::_OnWiFiStationProvisionChange()
Expand Down
Loading

0 comments on commit 9bbf5b9

Please sign in to comment.