-
-
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.
- Loading branch information
Showing
4 changed files
with
118 additions
and
75 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#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; | ||
bool getMacAddr(uint8_t hwaddr[6]) 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; | ||
}; |
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,12 @@ | ||
#include "AccessPoint.h" | ||
#include <Data/HexString.h> | ||
|
||
String AccessPointClass::getMAC(char sep) const | ||
{ | ||
uint8 hwaddr[6]; | ||
if(getMacAddr(hwaddr)) { | ||
return makeHexString(hwaddr, sizeof(hwaddr), sep); | ||
} else { | ||
return nullptr; | ||
} | ||
} |
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