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,
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 
String getAuthorizationMethodName() const
Get BSS authorisation method name.
Definition: BssInfo.h:47
uint8_t channel
Channel number.
Definition: BssInfo.h:64
String ssid
SSID.
Definition: BssInfo.h:61
uint32_t getHash() const
Generate a simple 32-bit hash from the MAC address.
Vector class template.
Definition: WVector.h:31
WifiAuthMode authorization
Authorisation mode.
Definition: BssInfo.h:63
WifiAuthMode
Definition: BssInfo.h:18
int16_t rssi
RSSI level.
Definition: BssInfo.h:65
The String class.
Definition: WString.h:136
A network hardware (MAC) address.
Definition: MacAddress.h:38
Definition: BssInfo.h:21
uint32_t getHashId() const
Get BSS hash ID.
Definition: BssInfo.h:55
MacAddress bssid
BSS ID.
Definition: BssInfo.h:62
Definition: BssInfo.h:19
Definition: BssInfo.h:20
bool isOpen() const
Get BSS open status.
Definition: BssInfo.h:39
Definition: BssInfo.h:22
bool hidden
True if AP is hidden.
Definition: BssInfo.h:66
Definition: BssInfo.h:24
Definition: BssInfo.h:33
String toString(WifiAuthMode mode)
Definition: BssInfo.h:23