WiFi接口析构时自动销毁ssid/pass
This commit is contained in:
parent
29202abaa7
commit
c156bc9d34
|
@ -50,8 +50,7 @@ Esp8266::Esp8266(COM idx, Pin power, Pin rst)
|
|||
|
||||
Esp8266::~Esp8266()
|
||||
{
|
||||
delete SSID;
|
||||
delete Pass;
|
||||
RemoveLed();
|
||||
}
|
||||
|
||||
void Esp8266::Init(ITransport* port, Pin power, Pin rst)
|
||||
|
@ -60,10 +59,10 @@ void Esp8266::Init(ITransport* port, Pin power, Pin rst)
|
|||
Speed = 54;
|
||||
|
||||
Port = port;
|
||||
if(Port)
|
||||
if (Port)
|
||||
{
|
||||
if(MinSize) MinSize = Port->MinSize;
|
||||
if(MaxSize) MaxSize = Port->MaxSize;
|
||||
if (MinSize) MinSize = Port->MinSize;
|
||||
if (MaxSize) MaxSize = Port->MaxSize;
|
||||
|
||||
Port->Register(OnPortReceive, this);
|
||||
}
|
||||
|
@ -80,7 +79,7 @@ void Esp8266::Init(ITransport* port, Pin power, Pin rst)
|
|||
Buffer(_sockets, 5 * 4).Clear();
|
||||
|
||||
Mode = NetworkType::STA_AP;
|
||||
WorkMode= NetworkType::STA_AP;
|
||||
WorkMode = NetworkType::STA_AP;
|
||||
|
||||
InitConfig();
|
||||
LoadConfig();
|
||||
|
|
|
@ -289,6 +289,12 @@ WiFiInterface::WiFiInterface() : NetworkInterface()
|
|||
Pass = nullptr;
|
||||
}
|
||||
|
||||
WiFiInterface::~WiFiInterface()
|
||||
{
|
||||
delete SSID;
|
||||
delete Pass;
|
||||
}
|
||||
|
||||
bool WiFiInterface::IsStation() const
|
||||
{
|
||||
return Mode == NetworkType::Station || Mode == NetworkType::STA_AP;
|
||||
|
|
|
@ -113,7 +113,7 @@ public:
|
|||
String* Pass; // 无线密码
|
||||
|
||||
WiFiInterface();
|
||||
virtual ~WiFiInterface() { }
|
||||
virtual ~WiFiInterface();
|
||||
|
||||
bool IsStation() const;
|
||||
bool IsAP() const;
|
||||
|
|
Loading…
Reference in New Issue