OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
can_tx_message_handler.h
Go to the documentation of this file.
1
33#ifndef __DRIVERS_CANBUS_CAN_TX_MESSAGE_HANDLER__
34#define __DRIVERS_CANBUS_CAN_TX_MESSAGE_HANDLER__
35
36#include <stdbool.h>
37#include <stdint.h>
38
39#include "can_types.h"
41
50typedef struct {
51
63 bool (*transmit_can_frame)(can_msg_t *can_msg);
64
71 void (*on_transmit)(can_msg_t *can_msg);
72
74
75#ifdef __cplusplus
76extern "C" {
77#endif /* __cplusplus */
78
91 extern void CanTxMessageHandler_initialize(const interface_can_tx_message_handler_t *interface_can_tx_message_handler);
92
108 extern bool CanTxMessageHandler_addressed_msg_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
109
125 extern bool CanTxMessageHandler_unaddressed_msg_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
126
142 extern bool CanTxMessageHandler_datagram_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
143
155 extern bool CanTxMessageHandler_stream_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index);
156
171 extern bool CanTxMessageHandler_can_frame(can_msg_t *can_msg);
172
173#ifdef __cplusplus
174}
175#endif /* __cplusplus */
176
177#endif /* __DRIVERS_CANBUS_CAN_TX_MESSAGE_HANDLER__ */
bool CanTxMessageHandler_unaddressed_msg_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index)
Transmits one CAN frame for an unaddressed (broadcast) openlcb_msg_t.
Definition can_tx_message_handler.c:293
bool CanTxMessageHandler_stream_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index)
Placeholder for stream protocol transmit (not yet implemented).
Definition can_tx_message_handler.c:381
void CanTxMessageHandler_initialize(const interface_can_tx_message_handler_t *interface_can_tx_message_handler)
Registers the dependency-injection interface for this module.
Definition can_tx_message_handler.c:70
bool CanTxMessageHandler_addressed_msg_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index)
Transmits one CAN frame for an addressed openlcb_msg_t.
Definition can_tx_message_handler.c:343
bool CanTxMessageHandler_datagram_frame(openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index)
Transmits one CAN frame for a datagram openlcb_msg_t (up to 72 bytes total).
Definition can_tx_message_handler.c:242
bool CanTxMessageHandler_can_frame(can_msg_t *can_msg)
Transmits a pre-built raw can_msg_t directly to the hardware.
Definition can_tx_message_handler.c:388
Type definitions and constants for the CAN transport layer.
Core type definitions, structures, and configuration constants for the OpenLCB library.
Definition can_types.h:118
Dependency-injection interface for the CAN transmit message handlers.
Definition can_tx_message_handler.h:50
Core OpenLCB message structure.
Definition openlcb_types.h:480

Copyright (c) 2026 Jim Kueneman all rights reserved. See the License