diff options
| author | Your Name <you@example.com> | 2026-05-20 02:10:01 +0530 |
|---|---|---|
| committer | Your Name <you@example.com> | 2026-05-20 02:10:01 +0530 |
| commit | 82f1fc0d5535eda3fc9eab799d81b3e220dbe4ef (patch) | |
| tree | 341dcecb0a87a6219bc51d424316dfadcf69bf65 /components/tollgate_core/include | |
| parent | 2c12c4281c47aa87a1c7bb82abe09bf9dbc788c3 (diff) | |
feat: add tollgate_core component + market config wiring
- Add tollgate_core ESP-IDF component (skeleton: cashu, dns, firewall, session)
- Add tollgate_platform.c with SPIFFS config backend
- Wire market_enabled, market_scan_interval_s, client_auto_switch in config.c
- Add lwip_tollgate_hooks.h (updated from feature branch)
- Add E2E fix plan, tollgate_core design doc, WPA autodetect plan
- Add integration test network helpers
- Add CONSOLIDATION.md plan
Reverts the broken merge (be4788b) that gutted config.c/tollgate_main.c/tollgate_api.c
and replaces it with a clean addition on top of intact master.
Diffstat (limited to 'components/tollgate_core/include')
| -rw-r--r-- | components/tollgate_core/include/tollgate_core.h | 34 | ||||
| -rw-r--r-- | components/tollgate_core/include/tollgate_platform.h | 17 |
2 files changed, 51 insertions, 0 deletions
diff --git a/components/tollgate_core/include/tollgate_core.h b/components/tollgate_core/include/tollgate_core.h new file mode 100644 index 0000000..c47ebeb --- /dev/null +++ b/components/tollgate_core/include/tollgate_core.h | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | #ifndef TOLLGATE_CORE_H | ||
| 2 | #define TOLLGATE_CORE_H | ||
| 3 | |||
| 4 | #include "tollgate_platform.h" | ||
| 5 | #include "esp_err.h" | ||
| 6 | #include "esp_netif.h" | ||
| 7 | #include <stdbool.h> | ||
| 8 | #include <stdint.h> | ||
| 9 | |||
| 10 | esp_err_t tollgate_core_init(const tollgate_platform_t *platform, esp_ip4_addr_t ap_ip); | ||
| 11 | |||
| 12 | esp_err_t tollgate_core_dns_start(esp_ip4_addr_t upstream_dns); | ||
| 13 | void tollgate_core_dns_stop(void); | ||
| 14 | |||
| 15 | esp_err_t tollgate_core_process_payment(uint32_t client_ip, const char *token_str); | ||
| 16 | |||
| 17 | void tollgate_core_client_connected(const uint8_t *mac, uint32_t client_ip); | ||
| 18 | void tollgate_core_client_disconnected(const uint8_t *mac); | ||
| 19 | |||
| 20 | void tollgate_core_tick(void); | ||
| 21 | |||
| 22 | bool tollgate_core_is_client_allowed(uint32_t client_ip); | ||
| 23 | bool tollgate_core_is_dns_running(void); | ||
| 24 | |||
| 25 | char *tollgate_core_get_status_json(void); | ||
| 26 | char *tollgate_core_get_config_json(void); | ||
| 27 | |||
| 28 | int tollgate_core_active_session_count(void); | ||
| 29 | int tollgate_core_allowed_client_count(void); | ||
| 30 | |||
| 31 | bool tollgate_core_is_owner(uint32_t client_ip); | ||
| 32 | bool tollgate_core_is_owner_connected(void); | ||
| 33 | |||
| 34 | #endif | ||
diff --git a/components/tollgate_core/include/tollgate_platform.h b/components/tollgate_core/include/tollgate_platform.h new file mode 100644 index 0000000..f60f1f9 --- /dev/null +++ b/components/tollgate_core/include/tollgate_platform.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #ifndef TOLLGATE_PLATFORM_H | ||
| 2 | #define TOLLGATE_PLATFORM_H | ||
| 3 | |||
| 4 | #include <stdint.h> | ||
| 5 | #include <stdbool.h> | ||
| 6 | |||
| 7 | typedef struct { | ||
| 8 | uint16_t (*get_price_sats)(void); | ||
| 9 | int32_t (*get_step_ms)(void); | ||
| 10 | const char * (*get_mint_url)(void); | ||
| 11 | const char * (*get_metric)(void); | ||
| 12 | int32_t (*get_step_bytes)(void); | ||
| 13 | int64_t (*get_time_ms)(void); | ||
| 14 | bool (*spend_proofs)(const char *raw_token_json); | ||
| 15 | } tollgate_platform_t; | ||
| 16 | |||
| 17 | #endif | ||