WINC1500 IoT Software APIs
19.5.2
WINC Software API Reference Manual
|
Functions | |
NMI_API sint8 | m2m_wifi_enable_monitoring_mode (tstrM2MWifiMonitorModeCtrl *pstrMtrCtrl, uint8 *pu8PayloadBuffer, uint16 u16BufferSize, uint16 u16DataOffset) |
Detailed Description
Asynchronous Wi-Fi monitoring mode (Promiscuous mode) enabling function. This function enables the monitoring mode, thus allowing two operations to be performed: 1) Transmission of manually configured frames, through using the m2m_wifi_send_wlan_pkt function. 2) Reception of frames based on a defined filtering criteria When the monitoring mode is enabled, reception of all frames that satisfy the filter criteria passed in as a parameter is allowed, on the current wireless channel
. All packets that meet the filtering criteria are passed to the application layer, to be handled by the assigned monitoring callback function
. The monitoring callback function must be implemented before starting the monitoring mode, in-order to handle the packets received
. Registering of the implemented callback function is through the callback pointer tpfAppMonCb in the tstrWifiInitParam structure
. passed to m2m_wifi_init function at initialization.
Function Documentation
◆ m2m_wifi_enable_monitoring_mode()
NMI_API sint8 m2m_wifi_enable_monitoring_mode | ( | tstrM2MWifiMonitorModeCtrl * | pstrMtrCtrl, |
uint8 * | pu8PayloadBuffer, | ||
uint16 | u16BufferSize, | ||
uint16 | u16DataOffset | ||
) |
- Parameters
-
[in] pstrMtrCtrl Pointer to tstrM2MWifiMonitorModeCtrl structure holding the filtering parameters. [in] pu8PayloadBuffer Pointer to a buffer allocated by the application. The buffer SHALL hold the Data field of the WIFI RX Packet (Or a part from it). If it is set to NULL, the WIFI data payload will be discarded by the monitoring driver. [in] u16BufferSize The total size of the pu8PayloadBuffer in bytes. [in] u16DataOffset Starting offset in the DATA FIELD of the received WIFI packet. The application may be interested in reading specific information from the received packet. It must assign the offset to the starting position of it relative to the DATA payload start.
Example, if the SSID is needed to be read from a PROBE REQ packet, the u16Offset MUST be set to 0.
- Warning
- When This mode is enabled, you can not be connected in any mode (Station, Access Point, or P2P).
- See also
- tstrM2MWifiMonitorModeCtrl tstrM2MWifiRxPacketInfo tstrWifiInitParam tenuM2mScanCh m2m_wifi_disable_monitoring_mode m2m_wifi_send_wlan_pkt m2m_wifi_send_ethernet_pkt
- Returns
- The function returns M2M_SUCCESS for successful operations and a negative value otherwise.
Example
The example demonstrates the main function where-by the monitoring enable function is called after the initialization of the driver and the packets are handled in the callback function.
Generated on Thu Jan 26 2017 22:15:21 for WINC1500 IoT Software APIs by 1.8.13