-
-
Notifications
You must be signed in to change notification settings - Fork 345
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor/abstract Wifi classes (#1802)
The `StationClass`, `WifiEventsClass` and `AccessPointClass` classes are now virtual base classes. The actual arch-specific implementations are `StationImpl`, `WifiEventsImpl` and `AccessPointImpl`. Looking at Basic_SmartConfig sample it needs more work, the callback should be architecture-independent. (That'll be another breaking change.) Breaking changes: * `StationClass::getConnectionStatusName()` returns String instead of `const char*`. Esp8266 'StationImpl': * Use `addElement(BssInfo*)` instead of `add(BssInfo&)` to avoid additional copy operation * Simplify config() logic, should be a little easier to follow * Add `getMacAddr` method to retrieve raw MAC address Added dependencies: * ENABLE_WPS=1 requires ENABLE_ESPCONN=1 * ENABLE_SMART_CONFIG has been added as it too has dependencies Host updates: * Provides fixed list of AP's * Neither WPS nor SmartConfig are supported and will generate a warning. (Was an error, but this causes dist-clean to fail.)
- Loading branch information
Showing
59 changed files
with
2,007 additions
and
1,642 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/**** | ||
* Sming Framework Project - Open Source framework for high efficiency native ESP8266 development. | ||
* Created 2015 by Skurydin Alexey | ||
* http://github.com/SmingHub/Sming | ||
* All files of the Sming Core are provided under the LGPL v3 license. | ||
* | ||
* AccessPointImpl.h - Esp8266 WiFi Access Point | ||
* | ||
****/ | ||
|
||
#pragma once | ||
|
||
#include <Platform/AccessPoint.h> | ||
#include <Platform/System.h> | ||
|
||
class AccessPointImpl : public AccessPointClass, protected ISystemReadyHandler | ||
{ | ||
public: | ||
AccessPointImpl() | ||
{ | ||
System.onReady(this); | ||
} | ||
|
||
void enable(bool enabled, bool save) override; | ||
bool isEnabled() const override; | ||
bool config(const String& ssid, String password, AUTH_MODE mode, bool hidden, int channel, | ||
int beaconInterval) override; | ||
IPAddress getIP() const override; | ||
bool setIP(IPAddress address) override; | ||
MACAddress getMacAddr() const override; | ||
IPAddress getNetworkMask() const override; | ||
IPAddress getNetworkGateway() const override; | ||
IPAddress getNetworkBroadcast() const override; | ||
String getSSID() const override; | ||
String getPassword() const override; | ||
|
||
protected: | ||
void onSystemReady() override; | ||
|
||
private: | ||
softap_config* runConfig = nullptr; | ||
}; |
Oops, something went wrong.