1.5.3.10 SYS_WIFIPROV_CtrlMsg Function
C
SYS_WIFIPROV_RESULT SYS_WIFIPROV_CtrlMsg (SYS_MODULE_OBJ object,uint32_t event,void *buffer,uint32_t length )
Summary
Request Wi-Fi Provisioning system service control request interface
Description
This function is used to make control request to Wi-Fi Provisioning system service.
Precondition
The SYS_WIFIPROV_Initialize function should have been called before calling this function.
Parameters
Param | Description |
---|---|
object | SYS WIFIPROV object handle, returned from SYS_WIFIPROV_Initialize |
event | A event value, event can be any of SYS_WIFIPROV_CTRLMSG types |
buffer | Control message data input. |
length | size of buffer data |
Returns
return SYS_WIFIPROV_RESULT.
Example
Details of SYS_WIFIPROV_SETCONFIG: SYS_WIFIPROV_CONFIG wifiProvConfig; SYS_MODULE_OBJ wifiProvServHandle; // Set mode as STA wifiProvConfig.mode = SYS_WIFI_STA; // Disable saving wifi configuration wifiProvConfig.saveConfig = false; // Set the auth type to SYS_WIFI_WPA2 wifiProvConfig.staConfig.authType = SYS_WIFI_WPA2; // Enable all the channels(0) wifiProvConfig.staConfig.channel = 0; // Device doesn't wait for user request wifiProvConfig.staConfig.autoConnect = 1; // Set SSID memcpy(wifiProvConfig.staConfig.ssid,WIFI_DEV_SSID,sizeof(WIFI_DEV_SSID)); // Set PSK memcpy(wifiProvConfig.staConfig.psk,WIFI_DEV_PSK,sizeof(WIFI_DEV_PSK)); if (SYS_WIFIPROV_OBJ_INVALID != SYS_WIFIPROV_CtrlMsg (wifiProvServHandle,SYS_WIFIPROV_SETCONFIG,&wifiProvConfig,sizeof(SYS_WIFIPROV_CONFIG))) { // When Wi-Fi Provisioning Configuration need to be updated } Details of SYS_WIFIPROV_GETCONFIG: SYS_WIFIPROV_CtrlMsg (wifiProvServHandle,SYS_WIFIPROV_GETCONFIG,NULL,0); Details of SYS_WIFIPROV_CONNECT: // Updating Wi-Fi Connected state to Provisioning service bool wifiProvConnectState = true; SYS_WIFIPROV_CtrlMsg (wifiProvServHandle,SYS_WIFIPROV_CONNECT,&wifiProvConnectState,sizeof(wifiProvConnectState)); // Updating Wi-Fi disconnected state to Provisioning service bool wifiProvConnectState = false; SYS_WIFIPROV_CtrlMsg (wifiProvServHandle,SYS_WIFIPROV_CONNECT,&wifiProvConnectState,sizeof(wifiProvConnectState));
Remarks
None