Skip to content

Commit a1bafe1

Browse files
[NXP] fix on network build issue, add wifi diagnostics status code (#35888)
* [NXP][platform][common] Fix wifi onnetwork build issue Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * [NXP][platform][common] Add wlan status code Signed-off-by: Martin Girardot <martin.girardot@nxp.com> * Restyled by whitespace * Restyled by clang-format --------- Signed-off-by: Martin Girardot <martin.girardot@nxp.com> Co-authored-by: Restyled.io <commits@restyled.io>
1 parent 4b6dcd8 commit a1bafe1

File tree

2 files changed

+14
-5
lines changed

2 files changed

+14
-5
lines changed

src/platform/nxp/common/ConnectivityManagerImpl.cpp

+13-5
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,11 @@ using namespace ::chip::System;
7575
using namespace ::chip::DeviceLayer::Internal;
7676
using namespace ::chip::DeviceLayer::DeviceEventType;
7777

78+
#if !SDK_2_16_100
7879
// Table 9-50 "Status codes" of IEEE 802.11-2020: Unspecified failure
7980
// Temporary default status code before SDK API to map wlan_event_reason to IEEE Status codes
8081
#define WLAN_REFUSED_REASON_UNSPECIFIED 1
82+
#endif
8183

8284
namespace chip {
8385
namespace DeviceLayer {
@@ -243,6 +245,12 @@ void ConnectivityManagerImpl::ProcessWlanEvent(enum wlan_event_reason wlanEvent)
243245
uint8_t associationFailureCause =
244246
chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCauseEnum::kUnknown);
245247

248+
#if SDK_2_16_100
249+
uint16_t wlan_status_code = wlan_get_status_code(wlanEvent);
250+
#else
251+
uint16_t wlan_status_code = WLAN_REFUSED_REASON_UNSPECIFIED;
252+
#endif
253+
246254
#if CHIP_DETAIL_LOGGING
247255
enum wlan_connection_state state;
248256
int result;
@@ -283,7 +291,7 @@ void ConnectivityManagerImpl::ProcessWlanEvent(enum wlan_event_reason wlanEvent)
283291
chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCauseEnum::kAssociationFailed);
284292
if (delegate)
285293
{
286-
delegate->OnAssociationFailureDetected(associationFailureCause, WLAN_REFUSED_REASON_UNSPECIFIED);
294+
delegate->OnAssociationFailureDetected(associationFailureCause, wlan_status_code);
287295
}
288296
UpdateInternetConnectivityState();
289297
break;
@@ -296,7 +304,7 @@ void ConnectivityManagerImpl::ProcessWlanEvent(enum wlan_event_reason wlanEvent)
296304
chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCauseEnum::kSsidNotFound);
297305
if (delegate)
298306
{
299-
delegate->OnAssociationFailureDetected(associationFailureCause, WLAN_REFUSED_REASON_UNSPECIFIED);
307+
delegate->OnAssociationFailureDetected(associationFailureCause, wlan_status_code);
300308
}
301309
break;
302310

@@ -309,7 +317,7 @@ void ConnectivityManagerImpl::ProcessWlanEvent(enum wlan_event_reason wlanEvent)
309317
chip::to_underlying(chip::app::Clusters::WiFiNetworkDiagnostics::AssociationFailureCauseEnum::kAuthenticationFailed);
310318
if (delegate)
311319
{
312-
delegate->OnAssociationFailureDetected(associationFailureCause, WLAN_REFUSED_REASON_UNSPECIFIED);
320+
delegate->OnAssociationFailureDetected(associationFailureCause, wlan_status_code);
313321
}
314322
break;
315323

@@ -321,7 +329,7 @@ void ConnectivityManagerImpl::ProcessWlanEvent(enum wlan_event_reason wlanEvent)
321329
sInstance.OnStationDisconnected();
322330
if (delegate)
323331
{
324-
delegate->OnAssociationFailureDetected(associationFailureCause, WLAN_REFUSED_REASON_UNSPECIFIED);
332+
delegate->OnAssociationFailureDetected(associationFailureCause, wlan_status_code);
325333
}
326334
}
327335
break;
@@ -332,7 +340,7 @@ void ConnectivityManagerImpl::ProcessWlanEvent(enum wlan_event_reason wlanEvent)
332340
sInstance.OnStationDisconnected();
333341
if (delegate)
334342
{
335-
delegate->OnAssociationFailureDetected(associationFailureCause, WLAN_REFUSED_REASON_UNSPECIFIED);
343+
delegate->OnAssociationFailureDetected(associationFailureCause, wlan_status_code);
336344
}
337345
break;
338346

src/platform/nxp/common/DiagnosticDataProviderImpl.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626

2727
#include "DiagnosticDataProviderImpl.h"
2828
#include <crypto/CHIPCryptoPAL.h>
29+
#include <lib/support/CHIPMemString.h>
2930
#include <platform/DiagnosticDataProvider.h>
3031

3132
#include <inet/InetInterface.h>

0 commit comments

Comments
 (0)