upleb.uk

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

summaryrefslogtreecommitdiff
path: root/main/identity.h
blob: 299045510a87a96bca69a95677fb5dba159474de (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef IDENTITY_H
#define IDENTITY_H

#include "esp_err.h"
#include "esp_wifi.h"
#include "esp_netif.h"
#include <stdint.h>
#include <stdbool.h>

typedef struct {
    uint8_t nsec[32];
    char nsec_hex[65];
    char npub_hex[65];

    uint8_t sta_mac[6];
    uint8_t ap_mac[6];

    char ap_ssid[32];
    esp_ip4_addr_t ap_ip;
    char ap_ip_str[16];

    bool initialized;
} tollgate_identity_t;

esp_err_t identity_init(const char *nsec_hex);

const tollgate_identity_t *identity_get(void);

#endif