FreeRTOS:
BLE
BLE
|
Return to main page ↑ |
WiFi provisioning Gatt service. More...
Go to the source code of this file.
Data Structures | |
struct | IotBleWifiProvListNetworksRequest_t |
Defines the list wifi networks request message structure sent from the provisioining app to the device. The request is used to list already provisioned networks as well as to scan nearby access points. More... | |
struct | IotBleWifiProvAddNetworkRequest_t |
Defines add wifi network request message structure sent from the provisioining app to the device. The request is used to provision a new access point with the credentials or to connect to an already provisioned access point. Inorder to connect to an already provisioned access point, a valid accessPointStoredIndex needs to be provided. Setting flag connectToAccessPoint to true results in the device first connecting to access point successfully before provisioning it in the flash. More... | |
struct | IotBleWifiProvEditNetworkRequest_t |
Defines edit wifi network request message structure sent from provisioning app to the device. The request is used to change the priority index for a provisioned access point. Priority index ranges from 0 (Max priority) to wificonfigMAX_NETWORK_PROFILES - 1 (Minimum priority). More... | |
struct | IotBleWifiProvDeleteNetworkRequest_t |
Defines delete access point request message structure sent from provisioning app to the device. The request is used to delete a provisioned access point at an index. Index ranges from 0 (Max priority) to wificonfigMAX_NETWORK_PROFILES - 1 (Minimum priority) More... | |
struct | IotBleWifiProvNetworkInfo_t |
Defines the structure used to hold a scanned or saved network information. More... | |
struct | IotBleWifiProvResponse_t |
Defines the structure used to hold the wifi provisioning response. More... | |
struct | IotBleWifiProvSerializer_t |
Enumerations | |
enum | IotBleWiFiProvRequest_t { IotBleWiFiProvRequestInvalid = 0, IotBleWiFiProvRequestListNetwork = 1, IotBleWiFiProvRequestAddNetwork = 2, IotBleWiFiProvRequestEditNetwork = 3, IotBleWiFiProvRequestDeleteNetwork = 4, IotBleWiFiProvRequestStop = 5 } |
This enumeration defines the different types of request processed by the WiFi provisioning library. More... | |
enum | IotBleWifiProvEvent_t { IOT_BLE_WIFI_PROV_CONNECT = 0x01, IOT_BLE_WIFI_PROV_CONNECTED = 0x02, IOT_BLE_WIFI_PROV_DELETED = 0x4, IOT_BLE_WIFI_PROV_FAILED = 0x8 } |
Events Used by the WIFI provisioning service. More... | |
Functions | |
bool | IotBleWifiProv_Init (void) |
Initialize wifi provisioning over BLE service. More... | |
bool | IotBleWifiProv_RunProcessLoop (void) |
Function which runs the process loop for Wifi provisioning. Process loop can be run within a task, it waits for the incoming requests from the transport interface as well as commands from the user application. Process loop terminates when a stop command is sent from the application. More... | |
uint32_t | IotBleWifiProv_GetNumNetworks (void) |
Gets the total number of provisioned networks. More... | |
bool | IotBleWifiProv_Connect (uint32_t networkIndex) |
Connects to one of the saved networks in priority order. More... | |
bool | IotBleWifiProv_Stop (void) |
Stop the WiFi provisionig process loop function. This enqueues a command to stop the WiFi provisioning process loop function. More... | |
bool | IotBleWifiProv_EraseAllNetworks (void) |
Erase all wifi networks. More... | |
void | IotBleWifiProv_Deinit (void) |
Tear down WIFI provisioning service. | |
IotBleWifiProvSerializer_t * | IotBleWifiProv_GetSerializer (void) |
Gets the serializer interface used to serialize/deserialize packets over BLE. By default it uses the cbor based serialization compatible with FreeRTOS wiFi provisioning mobile App. User can provide a serializer for their custom message format as well. More... | |
WiFi provisioning Gatt service.
This enumeration defines the different types of request processed by the WiFi provisioning library.
bool IotBleWifiProv_Init | ( | void | ) |
Initialize wifi provisioning over BLE service.
Creates necessary data structures for the service. Opens ble data transfer channel and listens for incoming messages from the channel.
bool IotBleWifiProv_RunProcessLoop | ( | void | ) |
Function which runs the process loop for Wifi provisioning. Process loop can be run within a task, it waits for the incoming requests from the transport interface as well as commands from the user application. Process loop terminates when a stop command is sent from the application.
uint32_t IotBleWifiProv_GetNumNetworks | ( | void | ) |
Gets the total number of provisioned networks.
bool IotBleWifiProv_Connect | ( | uint32_t | networkIndex | ) |
Connects to one of the saved networks in priority order.
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 ); }
bool IotBleWifiProv_Stop | ( | void | ) |
Stop the WiFi provisionig process loop function. This enqueues a command to stop the WiFi provisioning process loop function.
bool IotBleWifiProv_EraseAllNetworks | ( | void | ) |
Erase all wifi networks.
IotBleWifiProvSerializer_t* IotBleWifiProv_GetSerializer | ( | void | ) |
Gets the serializer interface used to serialize/deserialize packets over BLE. By default it uses the cbor based serialization compatible with FreeRTOS wiFi provisioning mobile App. User can provide a serializer for their custom message format as well.