Skip to content

Commit

Permalink
Merge 5d4d080 into 9e057a3
Browse files Browse the repository at this point in the history
  • Loading branch information
jby-nxp authored Aug 21, 2024
2 parents 9e057a3 + 5d4d080 commit 1386153
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/platform/nxp/common/CHIPDeviceNXPPlatformDefaultConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,3 +118,7 @@
#ifndef CHIP_DEVICE_CONFIG_INIT_OT_PLAT_ALARM
#define CHIP_DEVICE_CONFIG_INIT_OT_PLAT_ALARM 1
#endif // CHIP_DEVICE_CONFIG_INIT_OT_PLAT_ALARM

#ifndef CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL
#define CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL 300
#endif // CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL in Milliseconds
1 change: 1 addition & 0 deletions src/platform/nxp/common/CHIPDevicePlatformEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ enum InternalPlatformSpecificEventTypes
kPlatformNxpIpChangeEvent,
kPlatformNxpStartWlanConnectEvent,
kPlatformNxpScanWiFiNetworkDoneEvent,
kPlatformNxpStartWlanInitWaitTimerEvent,
};

} // namespace DeviceEventType
Expand Down
13 changes: 9 additions & 4 deletions src/platform/nxp/common/ConnectivityManagerImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ void ConnectivityManagerImpl::_OnPlatformEvent(const ChipDeviceEvent * event)
NetworkCommissioning::NXPWiFiDriver::GetInstance().ScanWiFINetworkDoneFromMatterTaskContext(
event->Platform.ScanWiFiNetworkCount);
}
else if (event->Type == kPlatformNxpStartWlanInitWaitTimerEvent)
{
DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(kWlanInitWaitMs), ConnectNetworkTimerHandler,
(void *) event->Platform.pNetworkDataEvent);
}
#endif
}

Expand Down Expand Up @@ -591,10 +596,10 @@ void ConnectivityManagerImpl::ConnectNetworkTimerHandler(::chip::System::Layer *
}
else
{
PlatformMgr().LockChipStack();
DeviceLayer::SystemLayer().StartTimer(System::Clock::Milliseconds32(CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL),
ConnectNetworkTimerHandler, context);
PlatformMgr().UnlockChipStack();
/* Post an event to start a delay timer asynchronously in the Matter task context */
event.Type = DeviceEventType::kPlatformNxpStartWlanInitWaitTimerEvent;
event.Platform.pNetworkDataEvent = (struct wlan_network *) context;
(void) PlatformMgr().PostEvent(&event);
}
}

Expand Down
1 change: 1 addition & 0 deletions src/platform/nxp/common/ConnectivityManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ class ConnectivityManagerImpl final : public ConnectivityManager,

BitFlags<GenericConnectivityManagerImpl_WiFi::ConnectivityFlags> mFlags;
static netif_ext_callback_t sNetifCallback;
static constexpr uint32_t kWlanInitWaitMs = CHIP_DEVICE_CONFIG_WIFI_STATION_RECONNECT_INTERVAL;

#if CHIP_ENABLE_OPENTHREAD
Inet::InterfaceId mThreadNetIf;
Expand Down

0 comments on commit 1386153

Please sign in to comment.