Asynchronous request for the current RSSI of the connected AP.
The response received in through the M2M_WIFI_RESP_CURRENT_RSSI event.
Request the current RSSI for the current connected AP, the response received in wifi_cb M2M_WIFI_RESP_CURRENT_RSSI.
Asynchronous API to request the current Receive Signal Strength (RSSI) of the current connection.
- See Also
- M2M_WIFI_RESP_CURRENT_RSSI
- Returns
- The function shall return M2M_SUCCESS for success and a negative value otherwise.
- 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"
#include "m2m_types.h"
void wifi_event_cb(
uint8 u8WiFiEvent,
void * pvMsg)
{
static uint8 u8ScanResultIdx = 0;
switch(u8WiFiEvent)
{
{
}
break;
default:
break;
}
}
{
{
while(1)
{
}
}
}
This function will result in the application receiving the RSSI via a
@ref M2M_WIFI_RESP_CURRENT_RSSI event.
- Precondition
- A Wi-Fi notification callback of type tpfAppWifiCb MUST be implemented and registered during initialization. Registration of the callback is done through passing it to m2m_wifi_init via 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 if the command has been successfully queued to the WINC 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)
{
{
}
break;
default:
break;
}
}
{
{
while(1)
{
}
}
}