Skip to content

Commit

Permalink
[toup][nrfconnect] Fix compatibility with wifi driver
Browse files Browse the repository at this point in the history
Replace static assert with runtime check due to wifi_scan_result.ssid
size change.

Signed-off-by: Adrian Gielniewski <[email protected]>
  • Loading branch information
adigie committed Jan 23, 2025
1 parent 4ced6d7 commit 326026e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/platform/nrfconnect/wifi/WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,8 @@ NetworkCommissioning::WiFiScanResponse ToScanResponse(const wifi_scan_result * r
{
NetworkCommissioning::WiFiScanResponse response = {};

if (result != nullptr)
if (result != nullptr && sizeof(response.ssid) >= result->ssid_length)
{
static_assert(sizeof(response.ssid) == sizeof(result->ssid), "SSID length mismatch");
static_assert(sizeof(response.bssid) == sizeof(result->mac), "BSSID length mismatch");

// TODO: Distinguish WPA versions
Expand Down

0 comments on commit 326026e

Please sign in to comment.