23#ifndef PROTOCORE_BUS_CAPTURE_H
24#define PROTOCORE_BUS_CAPTURE_H
28#if PROTOCORE_ENABLE_BUS_CAPTURE
38#define PROTOCORE_SOCKETCAN_FRAME_LEN 16
40#define PROTOCORE_CAN_EFF_FLAG 0x80000000u
42#define PROTOCORE_CAN_RTR_FLAG 0x40000000u
44#define PROTOCORE_CAN_ERR_FLAG 0x20000000u
47typedef void (*bus_capture_sink_fn)(
const CanFrame *frame);
55} BusCaptureCanToSocketcanArgs;
63 bus_capture_sink_fn sink;
92 BusCaptureCanToSocketcanArgs can_to_socketcan_args;
93 BusCaptureBeginArgs begin_args;
99extern BusCaptureVars BusCaptureV;
104 void (*
const can_to_socketcan)(uint8_t *work);
105 void (*
const begin)(uint8_t *work);
106 void (*
const poll)(uint8_t *work);
107 void (*
const end)(uint8_t *work);
112void protocore_bus_capture_can_to_socketcan(uint8_t *work);
113void protocore_bus_capture_begin(uint8_t *work);
114void protocore_bus_capture_poll(uint8_t *work);
115void protocore_bus_capture_end(uint8_t *work);
121static const BusCaptureNs BusCapture __attribute__((unused)) = {
122 .can_to_socketcan = protocore_bus_capture_can_to_socketcan,
123 .begin = protocore_bus_capture_begin,
124 .poll = protocore_bus_capture_poll,
125 .end = protocore_bus_capture_end,
137uint8_t *protocore_bus_capture_span(
void);
Shared CAN 2.0 frame type for the CAN-based industrial codecs (one source of truth).
#define PROTOCORE_BEGIN_DECLS
Give a header's declarations C linkage, so their symbol names carry no parameter types.
_Bool proto_bool
The truth value.
#define PROTOCORE_END_DECLS