diff --git a/Drivers/Esp8266/Esp8266.cpp b/Drivers/Esp8266/Esp8266.cpp index 5a30d031..f2c5bc72 100644 --- a/Drivers/Esp8266/Esp8266.cpp +++ b/Drivers/Esp8266/Esp8266.cpp @@ -254,7 +254,7 @@ bool Esp8266::OnLink(uint retry) } // 配置网络参数 -void Esp8266::Config() +bool Esp8266::Config() { // 设置多连接 SetMux(true); @@ -268,6 +268,8 @@ void Esp8266::Config() SetMAC(false, mac); //SetAutoConn(AutoConn); + + return true; } Socket* Esp8266::CreateSocket(NetType type) diff --git a/Drivers/Esp8266/Esp8266.h b/Drivers/Esp8266/Esp8266.h index 7537a8bc..efe48fa5 100644 --- a/Drivers/Esp8266/Esp8266.h +++ b/Drivers/Esp8266/Esp8266.h @@ -30,7 +30,7 @@ public: void Init(ITransport* port, Pin power = P0, Pin rst = P0); - virtual void Config(); + virtual bool Config(); void SetLed(Pin led); void SetLed(OutputPort& led); void RemoveLed(); diff --git a/Drivers/W5500.cpp b/Drivers/W5500.cpp index e8fb2d9c..4df6e49c 100644 --- a/Drivers/W5500.cpp +++ b/Drivers/W5500.cpp @@ -514,7 +514,7 @@ bool W5500::OnLink(uint retry) return true; } -void W5500::Config() +bool W5500::Config() { ShowConfig(); @@ -555,6 +555,8 @@ void W5500::Config() // 一次性全部写入 WriteFrame(0, bs); + + return true; } void W5500::ChangePower(int level) diff --git a/Drivers/W5500.h b/Drivers/W5500.h index 02d12459..57c028b4 100644 --- a/Drivers/W5500.h +++ b/Drivers/W5500.h @@ -29,7 +29,7 @@ public: void SetLed(Pin led); void SetLed(OutputPort& led); - virtual void Config(); + virtual bool Config(); // 读写帧,帧本身由外部构造 (包括帧数据内部的读写标志) bool WriteFrame(ushort addr, const Buffer& bs, byte socket = 0 ,byte block = 0); diff --git a/Net/NetworkInterface.h b/Net/NetworkInterface.h index d606769e..9d5f2f78 100644 --- a/Net/NetworkInterface.h +++ b/Net/NetworkInterface.h @@ -60,7 +60,7 @@ public: bool Active() const; // 应用配置 - virtual void Config() = 0; + virtual bool Config() = 0; // 保存和加载网络配置 void InitConfig(); diff --git a/TinyIP/TinyIP.cpp b/TinyIP/TinyIP.cpp index 4313ce21..5fc3215b 100644 --- a/TinyIP/TinyIP.cpp +++ b/TinyIP/TinyIP.cpp @@ -237,9 +237,10 @@ void TinyIP::OnClose() _port->Close(); } -void TinyIP::Config() +bool TinyIP::Config() { //ShowConfig(); + return true; } bool TinyIP::SendEthernet(ETH_TYPE type, const MacAddress& remote, const byte* buf, uint len) diff --git a/TinyIP/TinyIP.h b/TinyIP/TinyIP.h index 460f5ed0..105d4b96 100644 --- a/TinyIP/TinyIP.h +++ b/TinyIP/TinyIP.h @@ -59,7 +59,7 @@ public: virtual ~TinyIP(); void Init(ITransport* port); - virtual void Config(); + virtual bool Config(); ushort CheckSum(IPAddress* remote, const byte* buf, uint len, byte type); bool SendEthernet(ETH_TYPE type, const MacAddress& remote, const byte* buf, uint len);