4#ifndef PROTOCORE_PROVISIONING_H
5#define PROTOCORE_PROVISIONING_H
35 proto_bool (*form_field)(uint8_t *,
const char *,
const char *,
char *, size_t);
36 proto_bool (*load)(uint8_t *,
char *, size_t,
char *, size_t);
37 void (*begin)(uint8_t *,
const char *);
38 void (*clear)(uint8_t *);
#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(uint8_t *work)
Erase stored credentials (forces re-provisioning on next boot).
void protocore_prov_begin(uint8_t *work, const char *ap_ssid)
Start the captive portal: softAP ap_ssid + catch-all DNS + form .
proto_bool protocore_prov_form_field(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. .
uint8_t * protocore_provisioning_service_span(void)
The PROTOCORE_PROVISIONING_BORROW bytes this module's state lives in.
proto_bool protocore_prov_load(uint8_t *work, char *ssid, size_t ssid_cap, char *psk, size_t psk_cap)
Load stored WiFi credentials from NVS.
PROTOCORE_NS ProvNs Prov PROTOCORE_UNUSED
Module namespace.
Dispatch table. Addressed by offset, so the layout is asserted below.
proto_bool(* form_field)(uint8_t *, const char *, const char *, char *, size_t)
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS