Refactor notification system to use HTTP POST for buzz events, updating configuration and documentation accordingly.
This commit is contained in:
+5
-5
@@ -139,9 +139,9 @@ static int cmd_status(int argc, char **argv)
|
||||
(unsigned long)ps.proc_max_us, HOP_LEN * 1000000 / FS_HZ);
|
||||
printf("wifi: %s%s%s\n", ns.wifi_configured ? (ns.wifi_connected ? "connected " : "DISCONNECTED") : "not configured",
|
||||
ns.wifi_connected ? ns.ip : "", "");
|
||||
printf("notifications: ok %lu, failed %lu, dropped %lu, topic %s%s\n", (unsigned long)ns.sent_ok,
|
||||
(unsigned long)ns.sent_failed, (unsigned long)ns.dropped, CONFIG_BUZZ_NTFY_TOPIC,
|
||||
cfg.heartbeat_h ? " (heartbeat on)" : "");
|
||||
printf("event POST: %s, ok %lu, failed %lu, dropped %lu\n",
|
||||
ns.endpoint_configured ? "endpoint configured" : "endpoint not configured",
|
||||
(unsigned long)ns.sent_ok, (unsigned long)ns.sent_failed, (unsigned long)ns.dropped);
|
||||
printf("heap free: %lu bytes\n", (unsigned long)esp_get_free_heap_size());
|
||||
return 0;
|
||||
}
|
||||
@@ -161,7 +161,7 @@ static int cmd_fingerprint(int argc, char **argv)
|
||||
|
||||
static int cmd_alert(int argc, char **argv)
|
||||
{
|
||||
printf(notifier_send(NOTIF_TEST, "Test notification") ? "queued\n" : "queue full\n");
|
||||
printf(notifier_send(42) ? "queued test event (delay_ms=42)\n" : "queue full\n");
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -219,7 +219,7 @@ esp_err_t console_start(void)
|
||||
reg("get", "show parameters", "[param]", cmd_get);
|
||||
reg("status", "template source, detector state, timing, Wi-Fi", NULL, cmd_status);
|
||||
reg("fingerprint", "print live fingerprint and active template", NULL, cmd_fingerprint);
|
||||
reg("alert", "send a test notification", NULL, cmd_alert);
|
||||
reg("alert", "send a test event POST", NULL, cmd_alert);
|
||||
reg("reboot", "restart", NULL, cmd_reboot);
|
||||
|
||||
err = esp_console_start_repl(repl);
|
||||
|
||||
Reference in New Issue
Block a user