feat(F-043,F-044): redesign network.info and network.status command split
network.info now returns all addressing/identity fields needed by the console network panel: ip, subnet, gateway, dns, mac, hostname, ssid, connection_type. Previously only returned ip, gateway, dns. network.status slimmed to pure runtime/health data: connected, ap_mode, rssi, uptime_ms, state. Removed ip, mac, hostname, ssid, type — static facts now belong in network.info. Feature catalog updated with F-043 and F-044 detail sections. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -52,6 +52,8 @@ Every feature — user-facing or significant internal mechanism — is listed he
|
|||||||
| F-040 | Combined relay config command (`relay.set_config`) | v2.1.1 | Stable |
|
| F-040 | Combined relay config command (`relay.set_config`) | v2.1.1 | Stable |
|
||||||
| F-041 | Output numbering convention enforced — 1-based everywhere except raw chip pin | v2.1.1 | Stable |
|
| F-041 | Output numbering convention enforced — 1-based everywhere except raw chip pin | v2.1.1 | Stable |
|
||||||
| F-042 | Combined clock config commands (`clock.set_config` / `clock.set_alerts_config`) | v2.1.1 | Stable |
|
| F-042 | Combined clock config commands (`clock.set_config` / `clock.set_alerts_config`) | v2.1.1 | Stable |
|
||||||
|
| F-043 | `network.info` expanded — subnet, MAC, hostname, SSID, connection type | v2.1.1 | Stable |
|
||||||
|
| F-044 | `network.status` slimmed — pure runtime state (connected, state, RSSI, uptime, AP mode) | v2.1.1 | Stable |
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -566,3 +568,42 @@ Two batch commands that each collapse multiple individual clock commands into on
|
|||||||
All fields optional — at least one required. Single `saveClockConfig()` call per command regardless of how many fields are set.
|
All fields optional — at least one required. Single `saveClockConfig()` call per command regardless of how many fields are set.
|
||||||
|
|
||||||
Subsystem: `src/Communication/Handlers/ClockHandler/ClockHandler.cpp`
|
Subsystem: `src/Communication/Handlers/ClockHandler/ClockHandler.cpp`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### F-043 — `network.info` expanded
|
||||||
|
|
||||||
|
`network.info` now returns the full set of fields needed by the console network panel:
|
||||||
|
|
||||||
|
| Field | Source |
|
||||||
|
|---|---|
|
||||||
|
| `ip` | `WiFi.localIP()` |
|
||||||
|
| `subnet` | `WiFi.subnetMask()` |
|
||||||
|
| `gateway` | `WiFi.gatewayIP()` |
|
||||||
|
| `dns` | `WiFi.dnsIP()` |
|
||||||
|
| `mac` | `WiFi.macAddress()` |
|
||||||
|
| `hostname` | `NetworkConfig.hostname` |
|
||||||
|
| `ssid` | `WiFi.SSID()` |
|
||||||
|
| `connection_type` | `"WIFI"` / `"ETHERNET"` / `"AP"` |
|
||||||
|
|
||||||
|
Previously only returned `ip`, `gateway`, `dns`. Fields `mac`, `hostname`, `ssid` were spread across `network.status`.
|
||||||
|
|
||||||
|
Subsystem: `src/Communication/Handlers/NetworkHandler/NetworkHandler.cpp`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### F-044 — `network.status` slimmed to pure runtime state
|
||||||
|
|
||||||
|
`network.status` now returns only live/volatile data useful for health monitoring and polling:
|
||||||
|
|
||||||
|
| Field | Notes |
|
||||||
|
|---|---|
|
||||||
|
| `connected` | bool |
|
||||||
|
| `ap_mode` | bool |
|
||||||
|
| `rssi` | dBm, live WiFi signal strength |
|
||||||
|
| `uptime_ms` | `millis()` — time since last boot |
|
||||||
|
| `state` | Connection state machine: `DISCONNECTED` / `CONNECTING` / `CONNECTED_WIFI` / `CONNECTED_ETHERNET` / `RECONNECTING` / `AP_MODE` |
|
||||||
|
|
||||||
|
Removed from `network.status`: `ip`, `mac`, `hostname`, `ssid`, `type` — these are static addressing facts, now served by `network.info`.
|
||||||
|
|
||||||
|
Subsystem: `src/Communication/Handlers/NetworkHandler/NetworkHandler.cpp`
|
||||||
|
|||||||
@@ -23,20 +23,23 @@ CommandResult NetworkHandler::execute(const CommandEnvelope& envelope) {
|
|||||||
CommandResult NetworkHandler::handleInfo(const CommandEnvelope& e) {
|
CommandResult NetworkHandler::handleInfo(const CommandEnvelope& e) {
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
doc["ip"] = WiFi.localIP().toString();
|
doc["ip"] = WiFi.localIP().toString();
|
||||||
|
doc["subnet"] = WiFi.subnetMask().toString();
|
||||||
doc["gateway"] = WiFi.gatewayIP().toString();
|
doc["gateway"] = WiFi.gatewayIP().toString();
|
||||||
doc["dns"] = WiFi.dnsIP().toString();
|
doc["dns"] = WiFi.dnsIP().toString();
|
||||||
|
doc["mac"] = WiFi.macAddress();
|
||||||
|
doc["hostname"] = _configManager.getNetworkConfig().hostname;
|
||||||
|
doc["ssid"] = WiFi.SSID();
|
||||||
|
doc["connection_type"] = _networking.isInAPMode() ? "AP" :
|
||||||
|
(_networking.getActiveConnection() == ConnectionType::ETHERNET ? "ETHERNET" : "WIFI");
|
||||||
return CommandResult::ok("network.info", doc);
|
return CommandResult::ok("network.info", doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
CommandResult NetworkHandler::handleStatus(const CommandEnvelope& e) {
|
CommandResult NetworkHandler::handleStatus(const CommandEnvelope& e) {
|
||||||
JsonDocument doc;
|
JsonDocument doc;
|
||||||
doc["connected"] = _networking.isConnected();
|
doc["connected"] = _networking.isConnected();
|
||||||
doc["ip"] = _networking.getLocalIP();
|
|
||||||
doc["ap_mode"] = _networking.isInAPMode();
|
doc["ap_mode"] = _networking.isInAPMode();
|
||||||
doc["rssi"] = WiFi.RSSI();
|
doc["rssi"] = WiFi.RSSI();
|
||||||
doc["ssid"] = WiFi.SSID();
|
doc["uptime_ms"] = millis();
|
||||||
doc["mac"] = WiFi.macAddress();
|
|
||||||
doc["hostname"] = _configManager.getNetworkConfig().hostname;
|
|
||||||
|
|
||||||
const char* stateStr = "UNKNOWN";
|
const char* stateStr = "UNKNOWN";
|
||||||
switch (_networking.getState()) {
|
switch (_networking.getState()) {
|
||||||
@@ -50,15 +53,6 @@ CommandResult NetworkHandler::handleStatus(const CommandEnvelope& e) {
|
|||||||
}
|
}
|
||||||
doc["state"] = stateStr;
|
doc["state"] = stateStr;
|
||||||
|
|
||||||
const char* typeStr = "NONE";
|
|
||||||
switch (_networking.getActiveConnection()) {
|
|
||||||
case ConnectionType::WIFI: typeStr = "WIFI"; break;
|
|
||||||
case ConnectionType::ETHERNET: typeStr = "ETHERNET"; break;
|
|
||||||
case ConnectionType::AP: typeStr = "AP"; break;
|
|
||||||
default: break;
|
|
||||||
}
|
|
||||||
doc["type"] = typeStr;
|
|
||||||
|
|
||||||
return CommandResult::ok("network.status", doc);
|
return CommandResult::ok("network.status", doc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user