BssInfo.h
Go to the documentation of this file.
1 /****
2  * Sming Framework Project - Open Source framework for high efficiency native ESP8266 development.
3  * Created 2015 by Skurydin Alexey
4  * http://github.com/SmingHub/Sming
5  * All files of the Sming Core are provided under the LGPL v3 license.
6  *
7  * BssInfo.h - WiFi Basic Service Set Information
8  *
9  ****/
10 
11 #pragma once
12 
13 #include <WString.h>
14 #include <WVector.h>
15 #include <MacAddress.h>
16 
17 #ifndef ARCH_ESP8266
19  AUTH_OPEN = 0,
20  AUTH_WEP,
24  AUTH_MAX,
25 };
26 #else
27 #include <esp_systemapi.h>
28 using WifiAuthMode = AUTH_MODE;
29 #endif
30 
32 
33 class BssInfo
34 {
35 public:
39  bool isOpen() const
40  {
41  return authorization == AUTH_OPEN;
42  }
43 
48  {
49  return toString(authorization);
50  }
51 
55  uint32_t getHashId() const
56  {
57  return bssid.getHash();
58  }
59 
60 public:
65  int16_t rssi;
66  bool hidden;
67 };
68 
@ AUTH_MAX
Definition: BssInfo.h:32
The String class.
Definition: WString.h:136
Definition: BssInfo.h:33
@ AUTH_WPA_PSK
Definition: BssInfo.h:29
bool isOpen() const
Get BSS open status.
Definition: BssInfo.h:39
uint32_t getHash() const
Generate a simple 32-bit hash from the MAC address.
WifiAuthMode
Definition: BssInfo.h:18
String getAuthorizationMethodName() const
Get BSS authorisation method name.
Definition: BssInfo.h:47
WifiAuthMode authorization
Authorisation mode.
Definition: BssInfo.h:63
int16_t rssi
RSSI level.
Definition: BssInfo.h:65
@ AUTH_OPEN
Definition: BssInfo.h:27
@ AUTH_WPA2_PSK
Definition: BssInfo.h:30
@ AUTH_WEP
Definition: BssInfo.h:28
bool hidden
True if AP is hidden.
Definition: BssInfo.h:66
uint32_t getHashId() const
Get BSS hash ID.
Definition: BssInfo.h:55
A network hardware (MAC) address.
Definition: MacAddress.h:38
String toString(WifiAuthMode mode)
uint8_t channel
Channel number.
Definition: BssInfo.h:64
@ AUTH_WPA_WPA2_PSK
Definition: BssInfo.h:31
Vector class template.
Definition: WVector.h:31
String ssid
SSID.
Definition: BssInfo.h:61
MacAddress bssid
BSS ID.
Definition: BssInfo.h:62