32#ifndef DETERMINISTICESPASYNCWEBSERVER_COAPS_SERVER_H
33#define DETERMINISTICESPASYNCWEBSERVER_COAPS_SERVER_H
37#if DETWS_ENABLE_DTLS && DETWS_ENABLE_COAP
42#ifndef DETWS_COAPS_MAX_CONNS
43#define DETWS_COAPS_MAX_CONNS 2
45#ifndef DETWS_COAPS_INGEST_RING
46#define DETWS_COAPS_INGEST_RING 6
48#ifndef DETWS_COAPS_PORT
49#define DETWS_COAPS_PORT 5684
51#ifndef DETWS_COAPS_IDLE_MS
52#define DETWS_COAPS_IDLE_MS 60000
64struct CoapsServerConfig
66 const uint8_t *cert_der;
68 uint8_t ed25519_seed[32];
69 uint8_t cookie_key[32];
70 void (*rng)(uint8_t *out,
size_t len);
81bool coaps_server_begin(uint16_t port,
const CoapsServerConfig *cfg);
89void coaps_server_poll();
92uint8_t coaps_server_active_conns();
95void coaps_server_stop();
102using CoapsServerOutFn = void (*)(
void *ctx,
const uint8_t *datagram,
size_t len,
const char *ip, uint16_t port);
105void coaps_server_set_out_sink(CoapsServerOutFn fn,
void *ctx);
111bool coaps_server_ingest(
const uint8_t *datagram,
size_t len,
const char *ip, uint16_t port);
User-facing configuration for DeterministicESPAsyncWebServer.