25#ifndef PROTOCORE_COTP_H
26#define PROTOCORE_COTP_H
35#define TPKT_VERSION 0x03
36#define TPKT_HEADER_SIZE 4
48#define COTP_PARAM_TPDU_SIZE 0xC0
49#define COTP_DT_HEADER_LEN 3
54size_t pc_tpkt_build(uint8_t *buf,
size_t cap,
const uint8_t *payload,
size_t payload_len);
60bool pc_tpkt_parse(
const uint8_t *buf,
size_t len,
const uint8_t **payload,
size_t *payload_len,
size_t *consumed);
65size_t pc_cotp_build_dt(uint8_t *buf,
size_t cap,
const uint8_t *data,
size_t data_len,
bool eot);
72size_t pc_cotp_build_cr(uint8_t *buf,
size_t cap, uint16_t src_ref, uint8_t tpdu_size_code,
const uint8_t *extra_params,
82size_t pc_cotp_build_cc(uint8_t *buf,
size_t cap, uint16_t dst_ref, uint16_t src_ref, uint8_t tpdu_size_code,
83 const uint8_t *extra_params,
size_t extra_len);
97bool pc_cotp_parse(
const uint8_t *buf,
size_t len, CotpHeader *out);
User-facing configuration for ProtoCore.