minor renaming

This commit is contained in:
Proddy
2022-12-04 10:32:37 +01:00
parent e3c94cc1f7
commit 9053e7ac88

View File

@@ -552,7 +552,7 @@ void System::send_info_mqtt(const char * event_str, bool send_ntp) {
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
if (EMSESP::system_.ethernet_connected()) { if (EMSESP::system_.ethernet_connected()) {
doc["connection"] = "ethernet"; doc["network"] = "ethernet";
doc["hostname"] = ETH.getHostname(); doc["hostname"] = ETH.getHostname();
doc["MAC"] = ETH.macAddress(); doc["MAC"] = ETH.macAddress();
doc["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask()); doc["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask());
@@ -562,7 +562,7 @@ void System::send_info_mqtt(const char * event_str, bool send_ntp) {
doc["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6()); doc["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6());
} }
} else if (WiFi.status() == WL_CONNECTED) { } else if (WiFi.status() == WL_CONNECTED) {
doc["connection"] = "wifi"; doc["network"] = "wifi";
doc["hostname"] = WiFi.getHostname(); doc["hostname"] = WiFi.getHostname();
doc["SSID"] = WiFi.SSID(); doc["SSID"] = WiFi.SSID();
doc["BSSID"] = WiFi.BSSIDstr(); doc["BSSID"] = WiFi.BSSIDstr();
@@ -896,19 +896,19 @@ void System::show_system(uuid::console::Shell & shell) {
shell.println("Network:"); shell.println("Network:");
switch (WiFi.status()) { switch (WiFi.status()) {
case WL_IDLE_STATUS: case WL_IDLE_STATUS:
shell.printfln(" Network: Idle"); shell.printfln(" Status: Idle");
break; break;
case WL_NO_SSID_AVAIL: case WL_NO_SSID_AVAIL:
shell.printfln(" Network: Network not found"); shell.printfln(" Status: Network not found");
break; break;
case WL_SCAN_COMPLETED: case WL_SCAN_COMPLETED:
shell.printfln(" Network: Network scan complete"); shell.printfln(" Status: Network scan complete");
break; break;
case WL_CONNECTED: case WL_CONNECTED:
shell.printfln(" Network: connected"); shell.printfln(" Status: connected");
shell.printfln(" SSID: %s", WiFi.SSID().c_str()); shell.printfln(" SSID: %s", WiFi.SSID().c_str());
shell.printfln(" BSSID: %s", WiFi.BSSIDstr().c_str()); shell.printfln(" BSSID: %s", WiFi.BSSIDstr().c_str());
shell.printfln(" RSSI: %d dBm (%d %%)", WiFi.RSSI(), wifi_quality(WiFi.RSSI())); shell.printfln(" RSSI: %d dBm (%d %%)", WiFi.RSSI(), wifi_quality(WiFi.RSSI()));
@@ -943,7 +943,7 @@ void System::show_system(uuid::console::Shell & shell) {
// show Ethernet if connected // show Ethernet if connected
if (ethernet_connected_) { if (ethernet_connected_) {
shell.println(); shell.println();
shell.printfln(" Ethernet Network: connected"); shell.printfln(" Status: Ethernet connected");
shell.printfln(" MAC address: %s", ETH.macAddress().c_str()); shell.printfln(" MAC address: %s", ETH.macAddress().c_str());
shell.printfln(" Hostname: %s", ETH.getHostname()); shell.printfln(" Hostname: %s", ETH.getHostname());
shell.printfln(" IPv4 address: %s/%s", uuid::printable_to_string(ETH.localIP()).c_str(), uuid::printable_to_string(ETH.subnetMask()).c_str()); shell.printfln(" IPv4 address: %s/%s", uuid::printable_to_string(ETH.localIP()).c_str(), uuid::printable_to_string(ETH.subnetMask()).c_str());
@@ -1072,7 +1072,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
// node["uptime (seconds)"] = uuid::get_uptime_sec(); // node["uptime (seconds)"] = uuid::get_uptime_sec();
#ifndef EMSESP_STANDALONE #ifndef EMSESP_STANDALONE
node["free mem"] = ESP.getFreeHeap() / 1024; // kilobytes node["free mem"] = ESP.getFreeHeap() / 1024; // kilobytes
node["maxalloc"] = ESP.getMaxAllocHeap() / 1024; // kilobytes node["max alloc"] = ESP.getMaxAllocHeap() / 1024; // kilobytes
node["free app"] = EMSESP::system_.appFree(); // kilobytes node["free app"] = EMSESP::system_.appFree(); // kilobytes
#endif #endif
node["reset reason"] = EMSESP::system_.reset_reason(0) + " / " + EMSESP::system_.reset_reason(1); node["reset reason"] = EMSESP::system_.reset_reason(0) + " / " + EMSESP::system_.reset_reason(1);
@@ -1081,7 +1081,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
// Network Status // Network Status
node = output.createNestedObject("Network Info"); node = output.createNestedObject("Network Info");
if (EMSESP::system_.ethernet_connected()) { if (EMSESP::system_.ethernet_connected()) {
node["connection"] = "Ethernet"; node["network"] = "Ethernet";
node["hostname"] = ETH.getHostname(); node["hostname"] = ETH.getHostname();
node["MAC"] = ETH.macAddress(); node["MAC"] = ETH.macAddress();
node["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask()); node["IPv4 address"] = uuid::printable_to_string(ETH.localIP()) + "/" + uuid::printable_to_string(ETH.subnetMask());
@@ -1091,7 +1091,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
node["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6()); node["IPv6 address"] = uuid::printable_to_string(ETH.localIPv6());
} }
} else if (WiFi.status() == WL_CONNECTED) { } else if (WiFi.status() == WL_CONNECTED) {
node["connection"] = "WiFi"; node["network"] = "WiFi";
node["hostname"] = WiFi.getHostname(); node["hostname"] = WiFi.getHostname();
// node["SSID"] = WiFi.SSID(); // node["SSID"] = WiFi.SSID();
// node["BSSID"] = WiFi.BSSIDstr(); // node["BSSID"] = WiFi.BSSIDstr();
@@ -1150,7 +1150,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
} }
EMSESP::esp8266React.getMqttSettingsService()->read([&](MqttSettings & settings) { EMSESP::esp8266React.getMqttSettingsService()->read([&](MqttSettings & settings) {
node["enabled"] = settings.enabled; node["enabled"] = settings.enabled;
node["client_id"] = settings.clientId; node["client id"] = settings.clientId;
node["keep alive"] = settings.keepAlive; node["keep alive"] = settings.keepAlive;
node["clean session"] = settings.cleanSession; node["clean session"] = settings.cleanSession;
node["base"] = settings.base; node["base"] = settings.base;
@@ -1245,7 +1245,7 @@ bool System::command_info(const char * value, const int8_t id, JsonObject & outp
node["phy type"] = settings.phy_type; node["phy type"] = settings.phy_type;
if (settings.phy_type != PHY_type::PHY_TYPE_NONE) { if (settings.phy_type != PHY_type::PHY_TYPE_NONE) {
node["eth power"] = settings.eth_power; node["eth power"] = settings.eth_power;
node["eth phy_addr"] = settings.eth_phy_addr; node["eth phy addr"] = settings.eth_phy_addr;
node["eth clock_mode"] = settings.eth_clock_mode; node["eth clock_mode"] = settings.eth_clock_mode;
} }
node["rx gpio"] = settings.rx_gpio; node["rx gpio"] = settings.rx_gpio;