WINC1500 IoT Software APIs: m2m_wifi_req_curr_rssi

WINC1500 IoT Software API

WINC1500 IoT Software APIs  19.5.2
WINC Software API Reference Manual
m2m_wifi_req_curr_rssi

Functions

NMI_API sint8 m2m_wifi_req_curr_rssi (void)
 

Detailed Description

Asynchronous request for the current RSSI of the connected AP. The response received in through the M2M_WIFI_RESP_CURRENT_RSSI event.

Function Documentation

◆ m2m_wifi_req_curr_rssi()

NMI_API sint8 m2m_wifi_req_curr_rssi ( void  )
Precondition
- A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered before initialization. Registering the callback is done through passing it to the m2m_wifi_init through the tstrWifiInitParam initialization 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 the event received in the callback.

#include "m2m_wifi.h"
#include "m2m_types.h"
void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg)
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
{
sint8 *rssi = (sint8*)pvMsg;
M2M_INFO("ch rssi %d\n",*rssi);
}
break;
default:
break;
}
}
int main()
{
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(&param))
{
// Scan all channels
while(1)
{
}
}
}
Generated on Thu Jan 26 2017 22:15:21 for WINC1500 IoT Software APIs by   doxygen 1.8.13