AccessPoint.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  * AccessPoint.h
8  *
9  ****/
10 
11 #pragma once
12 
13 #include <WString.h>
14 #include <IpAddress.h>
15 #include <MacAddress.h>
16 #include "BssInfo.h"
17 #include "StationList.h"
18 #include <memory>
19 
35 {
36 public:
38  {
39  }
40 
45  virtual void enable(bool enabled, bool save = false) = 0;
46 
50  virtual bool isEnabled() const = 0;
51 
61  virtual bool config(const String& ssid, String password, WifiAuthMode mode, bool hidden = false, int channel = 7,
62  int beaconInterval = 200) = 0;
63 
67  virtual IpAddress getIP() const = 0;
68 
73  virtual bool setIP(IpAddress address) = 0;
74 
78  virtual MacAddress getMacAddress() const = 0;
79 
84  String getMAC(char sep = '\0') const;
85 
98  virtual bool setMacAddress(const MacAddress& addr) const = 0;
99 
103  virtual IpAddress getNetworkMask() const = 0;
104 
108  virtual IpAddress getNetworkGateway() const = 0;
109 
113  virtual IpAddress getNetworkBroadcast() const = 0;
114 
120  bool isLocal(IpAddress address)
121  {
122  return address.compare(getIP(), getNetworkMask());
123  }
124 
128  virtual String getSSID() const = 0;
129 
133  virtual String getPassword() const = 0;
134 
139  virtual std::unique_ptr<StationList> getStations() const = 0;
140 };
141 
150 
virtual IpAddress getNetworkBroadcast() const =0
Get WiFi AP broadcast address.
virtual String getSSID() const =0
Get WiFi access point SSID.
virtual IpAddress getNetworkMask() const =0
Get WiFi AP network mask.
The String class.
Definition: WString.h:136
virtual std::unique_ptr< StationList > getStations() const =0
Gets a list of stations connected to the access point.
virtual bool setIP(IpAddress address)=0
Set WiFi AP IP address.
virtual void enable(bool enabled, bool save=false)=0
Enable or disable WiFi AP.
virtual bool isEnabled() const =0
Get WiFi AP enable status.
virtual IpAddress getNetworkGateway() const =0
Get WiFi AP default gateway.
Access point class.
Definition: AccessPoint.h:34
WifiAuthMode
Definition: BssInfo.h:18
AccessPointClass & WifiAccessPoint
Global instance of WiFi access point object.
virtual IpAddress getIP() const =0
Get WiFi AP IP address.
virtual bool config(const String &ssid, String password, WifiAuthMode mode, bool hidden=false, int channel=7, int beaconInterval=200)=0
Configure WiFi AP.
bool compare(const IpAddress &addr, const IpAddress &mask) const
Definition: IpAddress.h:151
String getMAC(char sep='\0') const
Get WiFi AP MAC address.
virtual String getPassword() const =0
Get WiFi access point password.
A class to make it easier to handle and pass around IP addresses.
Definition: IpAddress.h:44
virtual bool setMacAddress(const MacAddress &addr) const =0
Set Access Point MAC address.
virtual MacAddress getMacAddress() const =0
Get WiFi AP MAC address.
A network hardware (MAC) address.
Definition: MacAddress.h:38
bool isLocal(IpAddress address)
Determine if the given address is on the same subnet.
Definition: AccessPoint.h:120
virtual ~AccessPointClass()
Definition: AccessPoint.h:37