|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Implementation of message handlers for CAN transmit operations. More...
Functions | |
| void | CanTxMessageHandler_initialize (const interface_can_tx_message_handler_t *interface_can_tx_message_handler) |
| Stores the dependency-injection interface pointer. | |
| bool | CanTxMessageHandler_datagram_frame (openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index) |
| Transmits one datagram CAN frame, selecting ONLY/FIRST/MIDDLE/LAST automatically. | |
| bool | CanTxMessageHandler_unaddressed_msg_frame (openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index) |
| Transmits one unaddressed (broadcast) OpenLCB CAN frame. | |
| bool | CanTxMessageHandler_addressed_msg_frame (openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index) |
| Transmits one addressed OpenLCB CAN frame, selecting ONLY/FIRST/MIDDLE/LAST automatically. | |
| bool | CanTxMessageHandler_stream_frame (openlcb_msg_t *openlcb_msg, can_msg_t *can_msg_worker, uint16_t *openlcb_start_index) |
| Stream transmit handler — not yet implemented, returns true as placeholder. | |
| bool | CanTxMessageHandler_can_frame (can_msg_t *can_msg) |
| Transmits a pre-built raw can_msg_t directly to the hardware. | |
Implementation of message handlers for CAN transmit operations.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Converts OpenLCB messages to CAN frames with proper fragmentation and framing-bit encoding per the OpenLCB CAN Frame Transfer Standard.
| void CanTxMessageHandler_initialize | ( | const interface_can_tx_message_handler_t * | interface_can_tx_message_handler | ) |
Stores the dependency-injection interface pointer.
Registers the dependency-injection interface for this module.
| bool CanTxMessageHandler_datagram_frame | ( | openlcb_msg_t * | openlcb_msg, |
| can_msg_t * | can_msg_worker, | ||
| uint16_t * | openlcb_start_index ) |
Transmits one datagram CAN frame, selecting ONLY/FIRST/MIDDLE/LAST automatically.
Transmits one CAN frame for a datagram openlcb_msg_t (up to 72 bytes total).
Algorithm:
* @param openlcb_msg Source datagram message (max 72 bytes). * @param can_msg_worker Scratch CAN frame buffer. * @param openlcb_start_index Current payload position; updated on success. *
| bool CanTxMessageHandler_unaddressed_msg_frame | ( | openlcb_msg_t * | openlcb_msg, |
| can_msg_t * | can_msg_worker, | ||
| uint16_t * | openlcb_start_index ) |
Transmits one unaddressed (broadcast) OpenLCB CAN frame.
Transmits one CAN frame for an unaddressed (broadcast) openlcb_msg_t.
Algorithm:
* @param openlcb_msg Source message (no dest_alias needed). * @param can_msg_worker Scratch CAN frame buffer. * @param openlcb_start_index Current payload position; updated on success. *
| bool CanTxMessageHandler_addressed_msg_frame | ( | openlcb_msg_t * | openlcb_msg, |
| can_msg_t * | can_msg_worker, | ||
| uint16_t * | openlcb_start_index ) |
Transmits one addressed OpenLCB CAN frame, selecting ONLY/FIRST/MIDDLE/LAST automatically.
Transmits one CAN frame for an addressed openlcb_msg_t.
Algorithm:
* @param openlcb_msg Source message (dest_alias must be valid). * @param can_msg_worker Scratch CAN frame buffer. * @param openlcb_start_index Current payload position; updated on success. *
| bool CanTxMessageHandler_stream_frame | ( | openlcb_msg_t * | openlcb_msg, |
| can_msg_t * | can_msg_worker, | ||
| uint16_t * | openlcb_start_index ) |
Stream transmit handler — not yet implemented, returns true as placeholder.
Placeholder for stream protocol transmit (not yet implemented).
| bool CanTxMessageHandler_can_frame | ( | can_msg_t * | can_msg | ) |
Transmits a pre-built raw can_msg_t directly to the hardware.
No OpenLCB processing — frame must be fully constructed before calling. Used for CAN control frames (CID, RID, AMD) during alias allocation.
| can_msg | Fully-constructed CAN frame to transmit. |
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License