4#ifndef PROTOCORE_PROVISIONING_H
5#define PROTOCORE_PROVISIONING_H
35 embed_bool (*
form_field)(
const uint8_t *,
const char *,
const char *,
char *, size_t);
36 embed_bool (*
load)(
const uint8_t *,
char *, size_t,
char *, size_t);
37 void (*
begin)(uint8_t *,
const char *);
61embed_bool
protocore_prov_load(
const uint8_t *work,
char *ssid,
size_t ssid_cap,
char *psk,
size_t psk_cap);
#define PROTOCORE_UNUSED
Suppress the unused warning. Every module ends in a namespace most callers only partly use.
#define PROTOCORE_NS_LAYOUT(T,...)
Pin every dispatch slot of a table that is nothing but function pointers.
#define PROTOCORE_NS
Storage for a dispatch table. The const is load bearing.
void protocore_prov_clear(const uint8_t *work)
Erase stored credentials (forces re-provisioning on next boot).
embed_bool protocore_prov_load(const uint8_t *work, char *ssid, size_t ssid_cap, char *psk, size_t psk_cap)
Load stored WiFi credentials from NVS.
embed_bool protocore_prov_form_field(const uint8_t *work, const char *body, const char *key, char *out, size_t cap)
Extract and URL-decode a field from an x-www-form-urlencoded body. .
void protocore_prov_begin(uint8_t *work, const char *ap_ssid)
Start the captive portal: softAP ap_ssid + catch-all DNS + form .
uint8_t * protocore_provisioning_service_span(void)
The PROTOCORE_PROVISIONING_BORROW bytes this module's state lives in.
Dispatch table. Addressed by offset, so the layout is asserted below.
void(* clear)(const uint8_t *)
embed_bool(* form_field)(const uint8_t *, const char *, const char *, char *, size_t)
embed_bool(* load)(const uint8_t *, char *, size_t, char *, size_t)
void(* begin)(uint8_t *, const char *)