FreeRTOS: BLE
BLE
Return to main page ↑
IotBleWifiProv_Connect

Connects to one of the saved networks in priority order.

bool IotBleWifiProv_Connect( uint32_t networkIndex );

Example usage of this API to connect to provisioned networks in priority order:

uint32_t numNetworks =  IotBleWifiProv_GetNumNetworks(); //Gets the number of provisioned networks
uint16_t priority;
TickType_t  xNetworkConnectionDelay = pdMS_TO_TICKS( 1000 ); //1 Second delay
for( priority = 0; priority < numNetworks; priority++ ) //Priority is always in descending order/0 being highest priority.
{
     bool ret = IotBleWifiProv_Connect( priority );
     if( ret == true )
     {
         break;
     }
     vTaskDelay( xNetworkConnectionDelay );
}
Returns
Returns the connected network index in the flash.