Hi Guys,
What a nice board this MKR1000. Do you know this board has a Wi-Fi Sniffer Mode? You just have to call m2m_wifi_enable_monitoring_mode(...). But that my problem. I receive a loader error:
"TestMKR.ino:34: undefined reference to `m2m_wifi_enable_monitoring_mode'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino MKR1000."
My Code is here:
#define CONF_MGMT // need for tenum type
#include <WiFi101.h>
extern "C" {
#include "driver/include/m2m_wifi.h"
#include "driver/include/m2m_types.h"
}
/* Declare receive buffer /
uint8 gmgmt[1600];
/ Callback functions /
static void wifi_event_cb(uint8 u8WiFiEvent, void * pvMsg) {
// Soemthing here to do
}
/ Call back monitoring */
static void wifi_monitoring_cb(tstrM2MWifiRxPacketInfo *pstrWifiRxPacket,
uint8 *pu8Payload,
uint16 u16PayloadSize) {
// Something here to do
}
void setup() {
Serial.begin(9600);
while (!Serial) delay(10);
// Mon Call Back
tstrWifiInitParam param = tstrWifiInitParam();
param.pfAppWifiCb = wifi_event_cb;
param.pfAppMonCb = wifi_monitoring_cb;
if(!m2m_wifi_init(¶m)) {
tstrM2MWifiMonitorModeCtrl strMonitorCtrl = tstrM2MWifiMonitorModeCtrl();
/* Enable Monitor Mode with filter to receive all data frames on channel 1 */
strMonitorCtrl.u8ChannelID = 1;
strMonitorCtrl.u8FrameType = DATA_BASICTYPE;
strMonitorCtrl.u8FrameSubtype = M2M_WIFI_FRAME_SUB_TYPE_ANY;
sint8 rsl = m2m_wifi_enable_monitoring_mode(&strMonitorCtrl, gmgmt, sizeof(gmgmt), 0);
Serial.println(rsl);
}
}
void loop() {
Serial.println("Waiting");
delay(1000);
}
It seems that something is missing on a WiFi101 Winc1500 module to link this function with my code.
If I change: m2m_wifi_enable_monitoring_mode(&strMonitorCtrl, gmgmt, sizeof(gmgmt), 0); for
m2m_wifi_enable_monitoring_mode();
I received a compilation error saying to less parameters.
If I replace m2m_wifi_enable_monitoring_mode(&strMonitorCtrl, gmgmt, sizeof(gmgmt), 0); with
m2m_wifi_stop_provision_mode()
I do not received any link(ld) error.
This function m2m_wifi_disable_monitoring_mode() is also missing.
I was able to run every example we get with WiFi101 library. Is there an other library like Winc1500 I should use?
This function m2m_wifi_send_wlan_pkt(...) also is missing.
In m2m_wifi.c Line 60, I uncommitted #define CONF_MGMT and it seems ok now.
Any Idea?