网络接口Config方法支持返回成功失败
This commit is contained in:
parent
6841c6ae64
commit
cac3f2ddac
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -60,7 +60,7 @@ public:
|
|||
bool Active() const;
|
||||
|
||||
// 应用配置
|
||||
virtual void Config() = 0;
|
||||
virtual bool Config() = 0;
|
||||
|
||||
// 保存和加载网络配置
|
||||
void InitConfig();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue