diff options
Diffstat (limited to 'main/tollgate_main.c')
| -rw-r--r-- | main/tollgate_main.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/main/tollgate_main.c b/main/tollgate_main.c index 9d2c392..d4b29bc 100644 --- a/main/tollgate_main.c +++ b/main/tollgate_main.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include "firewall.h" | 16 | #include "firewall.h" |
| 17 | #include "session.h" | 17 | #include "session.h" |
| 18 | #include "tollgate_api.h" | 18 | #include "tollgate_api.h" |
| 19 | #include "wallet.h" | ||
| 19 | 20 | ||
| 20 | #define MAX_STA_RETRY 5 | 21 | #define MAX_STA_RETRY 5 |
| 21 | static const char *TAG = "tollgate_main"; | 22 | static const char *TAG = "tollgate_main"; |
| @@ -88,6 +89,14 @@ static void ip_event_handler(void *arg, esp_event_base_t event_base, | |||
| 88 | } | 89 | } |
| 89 | } | 90 | } |
| 90 | 91 | ||
| 92 | static void wallet_init_task(void *pvParameters) | ||
| 93 | { | ||
| 94 | const tollgate_config_t *cfg = tollgate_config_get(); | ||
| 95 | wallet_init(); | ||
| 96 | wallet_fetch_keysets(cfg->mint_url); | ||
| 97 | vTaskDelete(NULL); | ||
| 98 | } | ||
| 99 | |||
| 91 | static void start_services(void) | 100 | static void start_services(void) |
| 92 | { | 101 | { |
| 93 | if (s_services_mutex) xSemaphoreTake(s_services_mutex, portMAX_DELAY); | 102 | if (s_services_mutex) xSemaphoreTake(s_services_mutex, portMAX_DELAY); |
| @@ -107,6 +116,8 @@ static void start_services(void) | |||
| 107 | firewall_init(ap_ip_info.ip); | 116 | firewall_init(ap_ip_info.ip); |
| 108 | session_manager_init(); | 117 | session_manager_init(); |
| 109 | 118 | ||
| 119 | xTaskCreate(wallet_init_task, "wallet_init", 32768, NULL, 5, NULL); | ||
| 120 | |||
| 110 | const tollgate_config_t *cfg = tollgate_config_get(); | 121 | const tollgate_config_t *cfg = tollgate_config_get(); |
| 111 | dns_server_start(ap_ip_info.ip, upstream_dns); | 122 | dns_server_start(ap_ip_info.ip, upstream_dns); |
| 112 | captive_portal_start(cfg->ap_ip_str); | 123 | captive_portal_start(cfg->ap_ip_str); |