MCPcopy Create free account
hub / github.com/UtilitechAS/amsreader-firmware / print

Method print

lib/AmsConfiguration/src/AmsConfiguration.cpp:1235–1447  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1233}
1234
1235void AmsConfiguration::print(Print* debugger)
1236{
1237 debugger->println(F("-----------------------------------------------"));
1238 NetworkConfig network;
1239 if(getNetworkConfig(network)) {
1240 debugger->println(F("--Network configuration--"));
1241 switch(network.mode) {
1242 case 1:
1243 debugger->printf_P(PSTR("Mode: 'WiFi client'\r\n"));
1244 break;
1245 case 2:
1246 debugger->printf_P(PSTR("Mode: 'WiFi AP'\r\n"));
1247 break;
1248 case 3:
1249 debugger->printf_P(PSTR("Mode: 'Ethernet'\r\n"));
1250 break;
1251 }
1252 debugger->printf_P(PSTR("SSID: '%s'\r\n"), network.ssid);
1253 debugger->printf_P(PSTR("Psk: '%s'\r\n"), network.psk);
1254 if(strlen(network.ip) > 0) {
1255 debugger->printf_P(PSTR("IP: '%s'\r\n"), network.ip);
1256 debugger->printf_P(PSTR("Gateway: '%s'\r\n"), network.gateway);
1257 debugger->printf_P(PSTR("Subnet: '%s'\r\n"), network.subnet);
1258 debugger->printf_P(PSTR("DNS1: '%s'\r\n"), network.dns1);
1259 debugger->printf_P(PSTR("DNS2: '%s'\r\n"), network.dns2);
1260 }
1261 debugger->printf_P(PSTR("Hostname: '%s'\r\n"), network.hostname);
1262 debugger->printf_P(PSTR("IPv6: '%s'\r\n"), network.ipv6 ? "Yes" : "No");
1263 debugger->printf_P(PSTR("mDNS: '%s'\r\n"), network.mdns ? "Yes" : "No");
1264 debugger->printf_P(PSTR("802.11b: '%s'\r\n"), network.use11b ? "Yes" : "No");
1265 debugger->println(F(""));
1266 delay(10);
1267 debugger->flush();
1268 }
1269
1270 MqttConfig mqtt;
1271 if(getMqttConfig(mqtt)) {
1272 debugger->println(F("--MQTT configuration--"));
1273 if(strlen(mqtt.host) > 0) {
1274 debugger->printf_P(PSTR("Enabled: Yes\r\n"));
1275 debugger->printf_P(PSTR("Host: '%s'\r\n"), mqtt.host);
1276 debugger->printf_P(PSTR("Port: %i\r\n"), mqtt.port);
1277 debugger->printf_P(PSTR("Client ID: '%s'\r\n"), mqtt.clientId);
1278 debugger->printf_P(PSTR("Publish topic: '%s'\r\n"), mqtt.publishTopic);
1279 debugger->printf_P(PSTR("Subscribe topic: '%s'\r\n"), mqtt.subscribeTopic);
1280 if (strlen(mqtt.username) > 0) {
1281 debugger->printf_P(PSTR("Username: '%s'\r\n"), mqtt.username);
1282 debugger->printf_P(PSTR("Password: '%s'\r\n"), mqtt.password);
1283 }
1284 debugger->printf_P(PSTR("Payload format: %i\r\n"), mqtt.payloadFormat);
1285 debugger->printf_P(PSTR("SSL: %s\r\n"), mqtt.ssl ? "Yes" : "No");
1286 debugger->printf_P(PSTR("Timeout: %i\r\n"), mqtt.timeout);
1287 debugger->printf_P(PSTR("Keep-alive: %i\r\n"), mqtt.keepalive);
1288 debugger->printf_P(PSTR("Auto reboot minutes: %i\r\n"), mqtt.rebootMinutes);
1289 } else {
1290 debugger->printf_P(PSTR("Enabled: No\r\n"));
1291 }
1292 debugger->println(F(""));

Callers 2

debugPrintFunction · 0.80
setupFunction · 0.80

Calls 1

flushMethod · 0.45

Tested by

no test coverage detected