26#ifndef DETERMINISTICESPASYNCWEBSERVER_ESPNOW_H
27#define DETERMINISTICESPASYNCWEBSERVER_ESPNOW_H
33#if DETWS_ENABLE_ESPNOW
36#define DETWS_ESPNOW_HDR 3
38#define DETWS_ESPNOW_MAGIC 0xE5
40#define DETWS_ESPNOW_MAX_PAYLOAD 247
43extern const uint8_t DETWS_ESPNOW_BROADCAST[6];
53size_t detws_espnow_encode(uint8_t type,
const uint8_t *payload,
size_t len, uint8_t *out,
size_t cap);
62bool detws_espnow_decode(
const uint8_t *buf,
size_t len, uint8_t *type,
const uint8_t **payload,
size_t *plen);
69void detws_espnow_peers_reset(
void);
71bool detws_espnow_peer_add(
const uint8_t mac[6]);
73bool detws_espnow_peer_has(
const uint8_t mac[6]);
75bool detws_espnow_peer_remove(
const uint8_t mac[6]);
77int detws_espnow_peer_count(
void);
84typedef void (*detws_espnow_recv_fn)(
const uint8_t mac[6], uint8_t type,
const uint8_t *payload,
size_t len);
92bool detws_espnow_begin(uint8_t channel, detws_espnow_recv_fn cb);
95bool detws_espnow_add_peer(
const uint8_t mac[6]);
98bool detws_espnow_send(
const uint8_t mac[6], uint8_t type,
const uint8_t *payload,
size_t len);
101bool detws_espnow_broadcast(uint8_t type,
const uint8_t *payload,
size_t len);
User-facing configuration for DeterministicESPAsyncWebServer.