22#ifndef PROTOCORE_J2735_H
23#define PROTOCORE_J2735_H
27#if PROTOCORE_ENABLE_J2735
49void protocore_uper_writer_init(UperWriter *w, uint8_t *buf,
size_t cap);
51size_t protocore_uper_writer_finish(
const UperWriter *w);
54void protocore_uper_put_bits(UperWriter *w, uint32_t value,
unsigned nbits);
56void protocore_uper_put_bool(UperWriter *w, embed_bool v);
58void protocore_uper_put_cint(UperWriter *w, int64_t value, int64_t lo, int64_t hi);
60void protocore_uper_reader_init(UperReader *r,
const uint8_t *buf,
size_t nbits);
62uint32_t protocore_uper_get_bits(UperReader *r,
unsigned nbits);
63embed_bool protocore_uper_get_bool(UperReader *r);
65int64_t protocore_uper_get_cint(UperReader *r, int64_t lo, int64_t hi);
68unsigned protocore_uper_cint_bits(int64_t lo, int64_t hi);
89size_t protocore_j2735_bsm_core_encode(
const J2735BsmCore *c, uint8_t *out,
size_t cap);
92embed_bool protocore_j2735_bsm_core_decode(
const uint8_t *in,
size_t len, J2735BsmCore *c);
96 J2735_PHASE_UNAVAILABLE = 0,
98 J2735_PHASE_STOP_THEN_PROCEED = 2,
99 J2735_PHASE_STOP_AND_REMAIN = 3,
100 J2735_PHASE_PRE_MOVEMENT = 4,
101 J2735_PHASE_PERMISSIVE_MOVEMENT_ALLOWED = 5,
102 J2735_PHASE_PROTECTED_MOVEMENT_ALLOWED = 6,
103 J2735_PHASE_PERMISSIVE_CLEARANCE = 7,
104 J2735_PHASE_PROTECTED_CLEARANCE = 8,
105 J2735_PHASE_CAUTION_CONFLICTING_TRAFFIC = 9
111 uint8_t signal_group;
113 uint16_t min_end_time;
114 uint16_t max_end_time;
126size_t protocore_j2735_spat_encode(
const J2735MovementState *states,
size_t count, uint8_t *out,
size_t cap);
135embed_bool protocore_j2735_spat_decode(
const uint8_t *in,
size_t len, J2735MovementState *out_states,
size_t max_states,
142 embed_bool is_ingress;
150 uint16_t intersection_id;
153} J2735MapIntersection;
161size_t protocore_j2735_map_encode(
const J2735MapIntersection *isect,
const J2735Lane *lanes,
size_t count, uint8_t *out,
167embed_bool protocore_j2735_map_decode(
const uint8_t *in,
size_t len, J2735MapIntersection *isect, J2735Lane *out_lanes,
168 size_t max_lanes,
size_t *out_count);
EMBED_ENUM_BYTE(ProtoConn, PROTO_NONE=0, PROTO_HTTP=1, PROTO_TELNET=2, PROTO_SSH=3, PROTO_MODBUS=4, PROTO_OPCUA=5, PROTO_SSH_RFWD=6, PROTO_RELAY=7, PROTO_BRIDGE=8, PROTO_NTRIP_CASTER=9, PROTO_MESH=10, PROTO_UDP=11,)
Application protocol spoken on a listener port or connection slot.