upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/tollgate_api.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-18 19:58:12 +0530
committerYour Name <you@example.com>2026-05-18 19:58:12 +0530
commit7820837d79ebc8e00221b5206bdd8e3ca0ae4c15 (patch)
tree98070e83e4e8bfa0b46009d202e7b81410c960f6 /main/tollgate_api.c
parent7dd532cee475d486552e886dd7173c8853f80b60 (diff)
Sync display with live TollGate state
- Periodic refresh: wallet balance + client count every 5s from main loop - display_notify_payment() API: passes payment amount and time allotment - tollgate_api.c: triggers PAYMENT_RECEIVED state after wallet receive - AP station events update client count in real-time - Config data (price, mint) passed to display during boot phase - Payment screen shows actual sats paid and time purchased - Updated DISPLAY_UI_PLAN.md with state-sync audit and checklist
Diffstat (limited to 'main/tollgate_api.c')
-rw-r--r--main/tollgate_api.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main/tollgate_api.c b/main/tollgate_api.c
index 650b0f3..7ddfb9e 100644
--- a/main/tollgate_api.c
+++ b/main/tollgate_api.c
@@ -4,6 +4,7 @@
4#include "session.h" 4#include "session.h"
5#include "firewall.h" 5#include "firewall.h"
6#include "nucula_wallet.h" 6#include "nucula_wallet.h"
7#include "display.h"
7#include "esp_log.h" 8#include "esp_log.h"
8#include "cJSON.h" 9#include "cJSON.h"
9#include "lwip/sockets.h" 10#include "lwip/sockets.h"
@@ -313,6 +314,8 @@ static esp_err_t api_post_payment(httpd_req_t *req)
313 314
314 nucula_wallet_receive(body_copy); 315 nucula_wallet_receive(body_copy);
315 316
317 display_notify_payment(token->total_amount, allotment);
318
316 free(states); 319 free(states);
317 free(token); 320 free(token);
318 return ESP_OK; 321 return ESP_OK;