feat: add support for W5500 SPI Ethernet in gateway
- Introduced configuration options for wired Ethernet support in Kconfig and sdkconfig. - Implemented Ethernet initialization and event handling in GatewayNetworkService. - Enhanced app_main to manage Ethernet alongside Wi-Fi. - Updated GatewayRuntime to store Ethernet information. - Modified CMakeLists and include files to accommodate new Ethernet dependencies. - Ensured backward compatibility by allowing Ethernet initialization failures to be ignored. Signed-off-by: Tony <tonylu@tony-cloud.com>
This commit is contained in:
@@ -450,6 +450,23 @@ bool GatewayRuntime::clearWirelessInfo() {
|
||||
return settings_.clearWifiCredentials();
|
||||
}
|
||||
|
||||
void GatewayRuntime::setEthernetInfo(EthernetInfo info) {
|
||||
LockGuard guard(command_lock_);
|
||||
ethernet_info_ = std::move(info);
|
||||
}
|
||||
|
||||
void GatewayRuntime::clearEthernetInfo() {
|
||||
LockGuard guard(command_lock_);
|
||||
ethernet_info_.reset();
|
||||
}
|
||||
|
||||
void GatewayRuntime::clearEthernetIp() {
|
||||
LockGuard guard(command_lock_);
|
||||
if (ethernet_info_.has_value()) {
|
||||
ethernet_info_->ip.clear();
|
||||
}
|
||||
}
|
||||
|
||||
void GatewayRuntime::setCommandAddressResolver(
|
||||
std::function<uint8_t(uint8_t gw, uint8_t raw_addr)> resolver) {
|
||||
LockGuard guard(command_lock_);
|
||||
@@ -470,6 +487,7 @@ GatewayDeviceInfo GatewayRuntime::deviceInfo() const {
|
||||
info.dali_gateway_count = gateway_count_;
|
||||
info.ble_enabled = ble_enabled_;
|
||||
info.wlan = wireless_info_;
|
||||
info.eth = ethernet_info_;
|
||||
return info;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user