23#ifndef DETERMINISTICESPASYNCWEBSERVER_HART_H
24#define DETERMINISTICESPASYNCWEBSERVER_HART_H
36 static constexpr uint8_t HART_DELIM_BACK = 0x01;
37 static constexpr uint8_t HART_DELIM_STX = 0x02;
38 static constexpr uint8_t HART_DELIM_ACK = 0x06;
39 static constexpr uint8_t HART_DELIM_LONG_ADDR = 0x80;
45 static constexpr uint8_t HARTIP_MSG_REQUEST = 0;
46 static constexpr uint8_t HARTIP_MSG_RESPONSE = 1;
47 static constexpr uint8_t HARTIP_MSG_PUBLISH = 2;
48 static constexpr uint8_t HARTIP_ID_SESSION_INIT = 0;
49 static constexpr uint8_t HARTIP_ID_SESSION_CLOSE = 1;
50 static constexpr uint8_t HARTIP_ID_KEEPALIVE = 2;
51 static constexpr uint8_t HARTIP_ID_TOKEN_PDU = 3;
52 static constexpr uint8_t HARTIP_HEADER_LEN = 8;
56uint8_t detws_hart_checksum(
const uint8_t *bytes,
size_t len);
70size_t detws_hart_build(uint8_t delimiter,
const uint8_t *addr,
size_t addr_len, uint8_t command,
const uint8_t *data,
71 size_t data_len, uint8_t *out,
size_t cap);
89bool detws_hart_parse(
const uint8_t *frame,
size_t len, HartFrame *out);
100size_t detws_hartip_build_header(uint8_t msg_type, uint8_t msg_id, uint8_t status, uint16_t seq, uint16_t total_len,
101 uint8_t *out,
size_t cap);
User-facing configuration for DeterministicESPAsyncWebServer.