17 #ifndef _SMING_CORE_WIFI_SNIFFER_H_ 18 #define _SMING_CORE_WIFI_SNIFFER_H_ 29 uint8_t bssid[ETH_MAC_LEN];
42 uint8_t bssid[ETH_MAC_LEN];
43 uint8_t station[ETH_MAC_LEN];
44 uint8_t ap[ETH_MAC_LEN];
57 int indexOf(
const uint8_t bssid[])
59 for(
unsigned i = 0; i < count(); ++i) {
60 if(memcmp(elementAt(i).bssid, bssid, ETH_MAC_LEN) == 0) {
75 int indexOf(
const uint8_t station[])
77 for(
unsigned i = 0; i < count(); ++i) {
78 if(memcmp(elementAt(i).station, station, ETH_MAC_LEN) == 0) {
87 typedef std::function<void(uint8_t* data, uint16_t length)> WifiSnifferCallback;
88 typedef std::function<void(const BeaconInfo& beacon)> WifiBeaconCallback;
89 typedef std::function<void(const ClientInfo& client)> WifiClientCallback;
103 beaconCallback = callback;
109 clientCallback = callback;
117 snifferCallback = callback;
125 wifi_set_channel(channel);
131 return wifi_get_channel();
136 void onSystemReady()
override;
139 static void parseData(uint8_t* buf, uint16_t len);
141 static WifiSnifferCallback snifferCallback;
142 static WifiBeaconCallback beaconCallback;
143 static WifiClientCallback clientCallback;
For applications to use to manage list of unique clients.
Definition: WifiSniffer.h:72
Decoded Wifi beacon (Access Point) information.
Definition: WifiSniffer.h:28
Definition: WifiSniffer.h:91
unsigned getChannel()
Get the current channel being listened on.
Definition: WifiSniffer.h:129
void onSniff(WifiSnifferCallback callback)
Register notification for all incoming data.
Definition: WifiSniffer.h:115
Decoded Wifi client information.
Definition: WifiSniffer.h:41
For applications to use to manage list of unique beacons.
Definition: WifiSniffer.h:54
void onBeacon(WifiBeaconCallback callback)
Register notification for beacon (AP) info.
Definition: WifiSniffer.h:101
void setChannel(unsigned channel)
Set the channel to listen on.
Definition: WifiSniffer.h:123
void onClient(WifiClientCallback callback)
Register notification for client info.
Definition: WifiSniffer.h:107