Skip to content

Commit

Permalink
[nrf toup] [nrfconnect] Added log for the WiFi connection failure
Browse files Browse the repository at this point in the history
This might help when debugging the WiFi connection failures.

Signed-off-by: Marcin Kajor <marcin.kajor@nordicsemi.no>
  • Loading branch information
markaj-nordic committed Aug 6, 2024
1 parent b6d6e9a commit 72b969b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/platform/nrfconnect/wifi/WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,9 @@ NetworkCommissioning::WiFiScanResponse ToScanResponse(const wifi_scan_result * r
// TODO: Distinguish WPA versions
response.security.Set(result->security == WIFI_SECURITY_TYPE_PSK ? NetworkCommissioning::WiFiSecurity::kWpaPersonal
: NetworkCommissioning::WiFiSecurity::kUnencrypted);
response.channel = result->channel;
response.rssi = result->rssi;
response.ssidLen = result->ssid_length;
response.channel = result->channel;
response.rssi = result->rssi;
response.ssidLen = result->ssid_length;
response.wiFiBand = ConvertBandEnum(result->band);
memcpy(response.ssid, result->ssid, result->ssid_length);
// TODO: MAC/BSSID is not filled by the Wi-Fi driver
Expand Down Expand Up @@ -500,6 +500,8 @@ void WiFiManager::ConnectHandler(Platform::UniquePtr<uint8_t> data, size_t lengt
}

delegate->OnAssociationFailureDetected(associationFailureCause, reason);

ChipLogError(DeviceLayer, "WiFi connection failure. Cause: %d, reason: %d", associationFailureCause, reason);
}
}
else // The connection has been established successfully.
Expand Down

0 comments on commit 72b969b

Please sign in to comment.