25#ifndef DETERMINISTICESPASYNCWEBSERVER_BACNET_H
26#define DETERMINISTICESPASYNCWEBSERVER_BACNET_H
30#if DETWS_ENABLE_BACNET
35#define BVLC_TYPE_BIP 0x81
36#define BVLC_HEADER_SIZE 4
39#define BVLC_FUNC_RESULT 0x00
40#define BVLC_FUNC_WRITE_BDT 0x01
41#define BVLC_FUNC_FORWARDED_NPDU 0x04
42#define BVLC_FUNC_REGISTER_FD 0x05
43#define BVLC_FUNC_ORIGINAL_UNICAST 0x0A
44#define BVLC_FUNC_ORIGINAL_BROADCAST 0x0B
46#define NPDU_VERSION 0x01
49#define NPCI_NETWORK_MSG 0x80
50#define NPCI_DEST_PRESENT 0x20
51#define NPCI_SRC_PRESENT 0x08
52#define NPCI_EXPECTING_REPLY 0x04
53#define NPCI_PRIORITY_MASK 0x03
56#define NPDU_PRIO_NORMAL 0x00
57#define NPDU_PRIO_URGENT 0x01
58#define NPDU_PRIO_CRITICAL 0x02
59#define NPDU_PRIO_LIFE_SAFETY 0x03
64size_t bvlc_build(uint8_t *buf,
size_t cap, uint8_t function,
const uint8_t *npdu,
size_t npdu_len);
67bool bvlc_parse(
const uint8_t *buf,
size_t len, uint8_t *function,
const uint8_t **npdu,
size_t *npdu_len);
76size_t npdu_build(uint8_t *buf,
size_t cap,
bool expecting_reply, uint8_t priority,
bool has_dest, uint16_t dnet,
77 const uint8_t *dadr, uint8_t dadr_len, uint8_t hop_count,
const uint8_t *apdu,
size_t apdu_len);
94bool npdu_parse(
const uint8_t *buf,
size_t len, NpduInfo *out);
User-facing configuration for DeterministicESPAsyncWebServer.