feat(gateway): enhance GatewayNetworkService with HTTP and UDP support, add status LED control

Co-authored-by: Copilot <copilot@github.com>
This commit is contained in:
Tony
2026-04-30 00:54:53 +08:00
parent 52aa2fc129
commit 3d8d00c3dd
10 changed files with 599 additions and 30 deletions
@@ -312,14 +312,23 @@ GatewayRuntime::CommandDropReason GatewayRuntime::lastEnqueueDropReason() const
}
void GatewayRuntime::setGatewayCount(size_t gateway_count) {
LockGuard guard(command_lock_);
gateway_count_ = gateway_count;
}
void GatewayRuntime::setWirelessInfo(WirelessInfo info) {
if (!info.ssid.empty() || !info.password.empty()) {
bool should_persist_credentials = false;
{
LockGuard guard(command_lock_);
should_persist_credentials = (!info.ssid.empty() || !info.password.empty()) &&
(!wireless_info_.has_value() ||
wireless_info_->ssid != info.ssid ||
wireless_info_->password != info.password);
wireless_info_ = info;
}
if (should_persist_credentials) {
settings_.setWifiCredentials(info.ssid, info.password);
}
wireless_info_ = std::move(info);
}
void GatewayRuntime::setCommandAddressResolver(
@@ -333,6 +342,7 @@ void GatewayRuntime::setCommandAddressResolver(
}
GatewayDeviceInfo GatewayRuntime::deviceInfo() const {
LockGuard guard(command_lock_);
GatewayDeviceInfo info;
info.serial_id = config_.serial_id;
info.type = GatewayCore::RoleToString(profile_.role);