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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user