![]() |
WINC1500 IoT Software APIs
19.5.2
WINC Software API Reference Manual
|
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()
- 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.
- The event M2M_WIFI_RESP_CURRENT_RSSI must be handled in the callback to receive the requested Rssi information.
- 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"
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
{
M2M_INFO("ch rssi %d\n",*rssi);
}
break;
default:
break;
}
}
int main()
{
tstrWifiInitParam param;
param.pfAppWifiCb = wifi_event_cb;
if(!m2m_wifi_init(¶m))
{
// Scan all channels
while(1)
{
}
}
}
Generated on Thu Jan 26 2017 22:15:21 for WINC1500 IoT Software APIs by
