Asynchronous request for the current RSSI of the connected AP. The response received in through the M2M_WIFI_RESP_CURRENT_RSSI event.
◆ m2m_wifi_req_curr_rssi()
- Precondition
- - A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered before intialization. Registering the callback is done through passing it to the m2m_wifi_init through the tstrWifiInitParam intialization structure.
- Returns
- The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Example
The code snippet demonstrates how the rssi request is called in the application's main function and the handling of event received in the callback.
#include "m2m_wifi.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
{
M2M_INFO("ch rssi %d\n",*rssi);
}
break;
default:
break;
}
}
int main()
{
{
while(1)
{
}
}
}