upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/tollgate_client.h
diff options
context:
space:
mode:
Diffstat (limited to 'main/tollgate_client.h')
-rw-r--r--main/tollgate_client.h27
1 files changed, 1 insertions, 26 deletions
diff --git a/main/tollgate_client.h b/main/tollgate_client.h
index ccee624..463cf63 100644
--- a/main/tollgate_client.h
+++ b/main/tollgate_client.h
@@ -1,36 +1,11 @@
1#ifndef TOLLGATE_CLIENT_H 1#ifndef TOLLGATE_CLIENT_H
2#define TOLLGATE_CLIENT_H 2#define TOLLGATE_CLIENT_H
3 3
4#include "tollgate_core_client.h"
4#include "esp_err.h" 5#include "esp_err.h"
5#include <stdint.h> 6#include <stdint.h>
6#include <stdbool.h> 7#include <stdbool.h>
7 8
8#define TG_CLIENT_MAX_GW_IP_LEN 16
9#define TG_CLIENT_MAX_MINT_URL 256
10#define TG_CLIENT_MAX_METRIC 32
11
12typedef enum {
13 TG_CLIENT_IDLE,
14 TG_CLIENT_DETECTING,
15 TG_CLIENT_NO_TOLLGATE,
16 TG_CLIENT_NEEDS_PAY,
17 TG_CLIENT_PAYING,
18 TG_CLIENT_PAID,
19 TG_CLIENT_RENEWING,
20 TG_CLIENT_MINING,
21 TG_CLIENT_ERROR
22} tollgate_client_state_t;
23
24typedef struct {
25 bool is_tollgate;
26 int price_per_step;
27 int step_size_ms;
28 char mint_url[TG_CLIENT_MAX_MINT_URL];
29 char metric[TG_CLIENT_MAX_METRIC];
30 bool mining_available;
31 uint16_t mining_port;
32} tollgate_discovery_t;
33
34esp_err_t tollgate_client_init(void); 9esp_err_t tollgate_client_init(void);
35 10
36esp_err_t tollgate_client_on_sta_connected(const char *gw_ip_str); 11esp_err_t tollgate_client_on_sta_connected(const char *gw_ip_str);