upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/tollgate_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main/tollgate_main.c')
-rw-r--r--main/tollgate_main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/main/tollgate_main.c b/main/tollgate_main.c
index 9eba61f..04f64b9 100644
--- a/main/tollgate_main.c
+++ b/main/tollgate_main.c
@@ -14,6 +14,8 @@
14#include "dns_server.h" 14#include "dns_server.h"
15#include "captive_portal.h" 15#include "captive_portal.h"
16#include "firewall.h" 16#include "firewall.h"
17#include "session.h"
18#include "tollgate_api.h"
17 19
18#define MAX_STA_RETRY 5 20#define MAX_STA_RETRY 5
19#define AP_IP_ADDR "192.168.4.1" 21#define AP_IP_ADDR "192.168.4.1"
@@ -105,9 +107,11 @@ static void start_services(void)
105 upstream_dns.addr = dns_addr->addr; 107 upstream_dns.addr = dns_addr->addr;
106 108
107 firewall_init(ap_ip_info.ip); 109 firewall_init(ap_ip_info.ip);
110 session_manager_init();
108 111
109 dns_server_start(ap_ip_info.ip, upstream_dns); 112 dns_server_start(ap_ip_info.ip, upstream_dns);
110 captive_portal_start(); 113 captive_portal_start();
114 tollgate_api_start();
111 115
112 s_services_running = true; 116 s_services_running = true;
113 if (s_services_mutex) xSemaphoreGive(s_services_mutex); 117 if (s_services_mutex) xSemaphoreGive(s_services_mutex);
@@ -123,6 +127,7 @@ static void stop_services(void)
123 } 127 }
124 128
125 captive_portal_stop(); 129 captive_portal_stop();
130 tollgate_api_stop();
126 dns_server_stop(); 131 dns_server_stop();
127 firewall_disable_nat(); 132 firewall_disable_nat();
128 firewall_revoke_all(); 133 firewall_revoke_all();
@@ -218,4 +223,9 @@ void app_main(void)
218 ESP_ERROR_CHECK(esp_wifi_start()); 223 ESP_ERROR_CHECK(esp_wifi_start());
219 224
220 ESP_LOGI(TAG, "WiFi AP+STA started, waiting for connection..."); 225 ESP_LOGI(TAG, "WiFi AP+STA started, waiting for connection...");
226
227 while (1) {
228 vTaskDelay(pdMS_TO_TICKS(1000));
229 session_tick();
230 }
221} 231}