WiFi Sniffer¶
See WiFi Sniffer for an example of how to use this.
API Documentation¶
-
group
wifi_sniffer
WiFi promiscuous mode sniffer support.
Defines
-
ETH_MAC_LEN
¶
Typedefs
-
typedef Delegate<void(uint8_t *data, uint16_t length)>
WifiSnifferCallback
¶
-
typedef Delegate<void(const BeaconInfo &beacon)>
WifiBeaconCallback
¶
-
typedef Delegate<void(const ClientInfo &client)>
WifiClientCallback
¶
-
struct
BeaconInfo
¶ - #include <WifiSniffer.h>
Decoded Wifi beacon (Access Point) information.
-
struct
ClientInfo
¶ - #include <WifiSniffer.h>
Decoded Wifi client information.
-
class
BeaconInfoList
: public Vector<BeaconInfo>¶ - #include <WifiSniffer.h>
For applications to use to manage list of unique beacons.
Public Types
-
template<>
typedef int (*Comparer
)(const BeaconInfo &lhs, const BeaconInfo &rhs)¶
Public Functions
-
int
indexOf
(const uint8_t bssid[])¶
-
unsigned int
capacity
() const
-
bool
contains
(const BeaconInfo &elem) const¶
-
const BeaconInfo &
firstElement
() const
-
int
indexOf
(const BeaconInfo &elem) const¶
-
bool
isEmpty
() const
-
const BeaconInfo &
lastElement
() const
-
int
lastIndexOf
(const BeaconInfo &elem) const¶
-
unsigned int
count
() const
-
unsigned int
size
() const
-
void
copyInto
(BeaconInfo *array) const¶
-
bool
add
(const BeaconInfo &obj)¶
-
bool
addElement
(const BeaconInfo &obj)¶
-
bool
addElement
(BeaconInfo *objp)¶
-
void
clear
()
-
bool
ensureCapacity
(unsigned int minCapacity)
-
void
removeAllElements
()
-
bool
removeElement
(const BeaconInfo &obj)¶
-
bool
setSize
(unsigned int newSize)
-
void
trimToSize
()
-
const BeaconInfo &
elementAt
(unsigned int index) const
-
bool
insertElementAt
(const BeaconInfo &obj, unsigned int index)¶
-
const void
remove
(unsigned int index)
-
void
removeElementAt
(unsigned int index)
-
bool
setElementAt
(const BeaconInfo &obj, unsigned int index)¶
-
const BeaconInfo &
get
(unsigned int index) const
-
const BeaconInfo &
operator[]
(unsigned int index) const
-
BeaconInfo &
operator[]
(unsigned int index)
-
void
sort
(Comparer compareFunction)
-
const BeaconInfo &
at
(unsigned int i) const
-
template<>
-
class
ClientInfoList
: public Vector<ClientInfo>¶ - #include <WifiSniffer.h>
For applications to use to manage list of unique clients.
Public Types
-
template<>
typedef int (*Comparer
)(const ClientInfo &lhs, const ClientInfo &rhs)¶
Public Functions
-
int
indexOf
(const uint8_t station[])¶
-
unsigned int
capacity
() const
-
bool
contains
(const ClientInfo &elem) const¶
-
const ClientInfo &
firstElement
() const
-
int
indexOf
(const ClientInfo &elem) const¶
-
bool
isEmpty
() const
-
const ClientInfo &
lastElement
() const
-
int
lastIndexOf
(const ClientInfo &elem) const¶
-
unsigned int
count
() const
-
unsigned int
size
() const
-
void
copyInto
(ClientInfo *array) const¶
-
bool
add
(const ClientInfo &obj)¶
-
bool
addElement
(const ClientInfo &obj)¶
-
bool
addElement
(ClientInfo *objp)¶
-
void
clear
()
-
bool
ensureCapacity
(unsigned int minCapacity)
-
void
removeAllElements
()
-
bool
removeElement
(const ClientInfo &obj)¶
-
bool
setSize
(unsigned int newSize)
-
void
trimToSize
()
-
const ClientInfo &
elementAt
(unsigned int index) const
-
bool
insertElementAt
(const ClientInfo &obj, unsigned int index)¶
-
const void
remove
(unsigned int index)
-
void
removeElementAt
(unsigned int index)
-
bool
setElementAt
(const ClientInfo &obj, unsigned int index)¶
-
const ClientInfo &
get
(unsigned int index) const
-
const ClientInfo &
operator[]
(unsigned int index) const
-
ClientInfo &
operator[]
(unsigned int index)
-
void
sort
(Comparer compareFunction)
-
const ClientInfo &
at
(unsigned int i) const
-
template<>
-
class
WifiSniffer
: public ISystemReadyHandler¶ - #include <WifiSniffer.h>
Public Functions
-
void
begin
()¶ Initialise the sniffer.
-
void
end
()¶ Stop the sniffer.
-
void
onBeacon
(WifiBeaconCallback callback)¶ Register notification for beacon (AP) info.
-
void
onClient
(WifiClientCallback callback)¶ Register notification for client info.
-
void
onSniff
(WifiSnifferCallback callback)¶ Register notification for all incoming data.
- Note
- Callback invoked for all packet types, including beacon/client
-
void
setChannel
(unsigned channel)¶ Set the channel to listen on.
- Parameters
channel
:
-
unsigned
getChannel
()¶ Get the current channel being listened on.
-
void
-