Workaround for boards that do not have callbacks implemented for network manager
@@ -382,6 +382,8 @@ static bool _wifiConnectAccessPoint( void )
if( WIFI_ConnectAP( &( network ) ) != eWiFiSuccess )
{
ret = false;
+ } else {
+ wifiNetwork.state = eNetworkStateEnabled;
}
return ret;
@@ -610,8 +612,9 @@ BaseType_t AwsIotNetworkManager_Init( void )
#if WIFI_ENABLED
IotListDouble_InsertTail( &networkManager.networks, &wifiNetwork.link );
+ WIFIReturnCode_t retCode = WIFI_RegisterNetworkStateChangeEventCallback( _onNetworkStateChangeCallback );
/* One time registration of network event callback with the Wi-Fi driver */
- if( WIFI_RegisterNetworkStateChangeEventCallback( _onNetworkStateChangeCallback ) != eWiFiSuccess )
+ if ( ( retCode != eWiFiSuccess ) && ( retCode != eWiFiNotSupported ) )
{
error = pdFALSE;
}
