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 /main/config.c | |
| 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 'main/config.c')
| -rw-r--r-- | main/config.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/main/config.c b/main/config.c index aa7da6d..43ab2a7 100644 --- a/main/config.c +++ b/main/config.c | |||
| @@ -46,6 +46,9 @@ esp_err_t tollgate_config_init(void) | |||
| 46 | g_config.stratum_port = 3333; | 46 | g_config.stratum_port = 3333; |
| 47 | g_config.mining_port = 3334; | 47 | g_config.mining_port = 3334; |
| 48 | g_config.mining_sandbox_mint_access = true; | 48 | g_config.mining_sandbox_mint_access = true; |
| 49 | g_config.market_enabled = true; | ||
| 50 | g_config.market_scan_interval_s = 30; | ||
| 51 | g_config.client_auto_switch = false; | ||
| 49 | 52 | ||
| 50 | esp_vfs_spiffs_conf_t conf = { | 53 | esp_vfs_spiffs_conf_t conf = { |
| 51 | .base_path = "/spiffs", | 54 | .base_path = "/spiffs", |
| @@ -361,6 +364,15 @@ esp_err_t tollgate_config_init(void) | |||
| 361 | if (m_sandbox && cJSON_IsBool(m_sandbox)) g_config.mining_sandbox_mint_access = cJSON_IsTrue(m_sandbox); | 364 | if (m_sandbox && cJSON_IsBool(m_sandbox)) g_config.mining_sandbox_mint_access = cJSON_IsTrue(m_sandbox); |
| 362 | } | 365 | } |
| 363 | 366 | ||
| 367 | cJSON *market_enabled = cJSON_GetObjectItem(root, "market_enabled"); | ||
| 368 | if (market_enabled && cJSON_IsBool(market_enabled)) g_config.market_enabled = cJSON_IsTrue(market_enabled); | ||
| 369 | |||
| 370 | cJSON *market_scan_interval = cJSON_GetObjectItem(root, "market_scan_interval_s"); | ||
| 371 | if (market_scan_interval) g_config.market_scan_interval_s = market_scan_interval->valueint; | ||
| 372 | |||
| 373 | cJSON *client_auto_switch = cJSON_GetObjectItem(root, "client_auto_switch"); | ||
| 374 | if (client_auto_switch && cJSON_IsBool(client_auto_switch)) g_config.client_auto_switch = cJSON_IsTrue(client_auto_switch); | ||
| 375 | |||
| 364 | cJSON_Delete(root); | 376 | cJSON_Delete(root); |
| 365 | 377 | ||
| 366 | if (g_config.payout.recipient_count == 0) { | 378 | if (g_config.payout.recipient_count == 0) { |