1.4.3.15 SYS_WIFI_GetStatus Function

C

uint8_t SYS_WIFI_GetStatus ( SYS_MODULE_OBJ object)

Summary

Returns Wi-Fi system service status.

Description

This function returns the current status of the System Wi-Fi service.

This function help user to perform synchronize functionality with Wi-Fi service.

Precondition

The SYS_WIFI_Initialize function should have been called before calling this function.

Parameters

ParamDescription
objectSYS WIFI object handle, returned from SYS_WIFI_Initialize

Returns

return SYS_WIFI_STATUS if client provided object is valid, else return SYS_WIFI_OBJ_INVALID.

Example

// For example,User want to perform the Scan request when auto connect is disabled.
// So user has to make sure service is in right state,
// where Wi-Fi service has started and waiting in the Auto connect
// state(SYS_WIFI_STATUS_AUTOCONNECT_WAIT) before making scan request.

if (SYS_WIFI_STATUS_AUTOCONNECT_WAIT == SYS_WIFI_GetStatus (sysObj.syswifi))
{
// Enable Wi-Fi Scanning in MHC
// Get Wi-Fi Scan Configuration using control message request.
// The information of configuration is updated in the wifiSrvcScanConfig.

SYS_WIFI_SCAN_CONFIG wifiSrvcScanConfig;
if(SYS_WIFI_SUCCESS == SYS_WIFI_CtrlMsg(sysObj.syswifi, SYS_WIFI_GETSCANCONFIG, &wifiSrvcScanConfig, sizeof(SYS_WIFI_SCAN_CONFIG)))
{
//Received the wifiSrvcScanConfig data
}

// update desired parameters
char myAPlist[] = "openAP,SecuredAP,DEMO_AP,my_cell_hotspot";
char delimiter = ',';
wifiSrvcScanConfig.channel = 6;
wifiSrvcScanConfig.mode = SYS_WIFI_SCAN_MODE_ACTIVE;
wifiSrvcScanConfig.pSsidList = myAPlist;
wifiSrvcScanConfig.delimChar = delimiter;
// pass structure in scan request
SYS_WIFI_CtrlMsg(sysObj.syswifi, SYS_WIFI_SCANREQ, &wifiSrvcScanConfig, sizeof(SYS_WIFI_SCAN_CONFIG));

}

//Wi-Fi system service is in TCPIP ready status, waiting for client request.
if (SYS_WIFI_STATUS_TCPIP_READY == SYS_WIFI_GetStatus (sysObj.syswifi))
{
// when the SYS WIFI module in TCPIP ready STATUS
}

Remarks

None