|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Dependency-injection interface for the CAN receive state machine. More...
Data Fields | |
| void(* | handle_can_legacy_snip )(can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
| REQUIRED. Legacy SNIP handler (NULL-count based completion). Typical: CanRxMessageHandler_can_legacy_snip. | |
| void(* | handle_single_frame )(can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
| REQUIRED. Single-frame OpenLCB message handler. Typical: CanRxMessageHandler_single_frame. | |
| void(* | handle_first_frame )(can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
| REQUIRED. First frame of a multi-frame message. Typical: CanRxMessageHandler_first_frame. | |
| void(* | handle_middle_frame )(can_msg_t *can_msg, uint8_t can_buffer_start_index) |
| REQUIRED. Middle frame of a multi-frame message. Typical: CanRxMessageHandler_middle_frame. | |
| void(* | handle_last_frame )(can_msg_t *can_msg, uint8_t can_buffer_start_index) |
| REQUIRED. Last frame of a multi-frame message. Typical: CanRxMessageHandler_last_frame. | |
| void(* | handle_stream_frame )(can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
| REQUIRED. Stream frame handler (placeholder). Typical: CanRxMessageHandler_stream_frame. | |
| void(* | handle_rid_frame )(can_msg_t *can_msg) |
| REQUIRED. RID (Reserve ID) control frame. Typical: CanRxMessageHandler_rid_frame. | |
| void(* | handle_amd_frame )(can_msg_t *can_msg) |
| REQUIRED. AMD (Alias Map Definition) control frame. Typical: CanRxMessageHandler_amd_frame. | |
| void(* | handle_ame_frame )(can_msg_t *can_msg) |
| REQUIRED. AME (Alias Map Enquiry) control frame. Typical: CanRxMessageHandler_ame_frame. | |
| void(* | handle_amr_frame )(can_msg_t *can_msg) |
| REQUIRED. AMR (Alias Map Reset) control frame. Typical: CanRxMessageHandler_amr_frame. | |
| void(* | handle_error_info_report_frame )(can_msg_t *can_msg) |
| REQUIRED. Error Information Report control frame. Typical: CanRxMessageHandler_error_info_report_frame. | |
| void(* | handle_cid_frame )(can_msg_t *can_msg) |
| REQUIRED. CID (Check ID) control frame. Typical: CanRxMessageHandler_cid_frame. | |
| alias_mapping_t *(* | alias_mapping_find_mapping_by_alias )(uint16_t alias) |
| REQUIRED. Find alias mapping by 12-bit alias (validates addressed-message destination). Typical: AliasMappings_find_mapping_by_alias. | |
| void(* | on_receive )(can_msg_t *can_msg) |
| OPTIONAL. Called immediately when a frame arrives, before any routing. Good for counters/LEDs. May be NULL. | |
Dependency-injection interface for the CAN receive state machine.
Provides 12 REQUIRED frame-handler callbacks plus 1 REQUIRED alias lookup and 1 OPTIONAL receive-notification callback. All REQUIRED pointers must be non-NULL.
Frame dispatch rules:
| void(* handle_can_legacy_snip) (can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
REQUIRED. Legacy SNIP handler (NULL-count based completion). Typical: CanRxMessageHandler_can_legacy_snip.
| void(* handle_single_frame) (can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
REQUIRED. Single-frame OpenLCB message handler. Typical: CanRxMessageHandler_single_frame.
| void(* handle_first_frame) (can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
REQUIRED. First frame of a multi-frame message. Typical: CanRxMessageHandler_first_frame.
| void(* handle_middle_frame) (can_msg_t *can_msg, uint8_t can_buffer_start_index) |
REQUIRED. Middle frame of a multi-frame message. Typical: CanRxMessageHandler_middle_frame.
| void(* handle_last_frame) (can_msg_t *can_msg, uint8_t can_buffer_start_index) |
REQUIRED. Last frame of a multi-frame message. Typical: CanRxMessageHandler_last_frame.
| void(* handle_stream_frame) (can_msg_t *can_msg, uint8_t can_buffer_start_index, payload_type_enum data_type) |
REQUIRED. Stream frame handler (placeholder). Typical: CanRxMessageHandler_stream_frame.
| void(* handle_rid_frame) (can_msg_t *can_msg) |
REQUIRED. RID (Reserve ID) control frame. Typical: CanRxMessageHandler_rid_frame.
| void(* handle_amd_frame) (can_msg_t *can_msg) |
REQUIRED. AMD (Alias Map Definition) control frame. Typical: CanRxMessageHandler_amd_frame.
| void(* handle_ame_frame) (can_msg_t *can_msg) |
REQUIRED. AME (Alias Map Enquiry) control frame. Typical: CanRxMessageHandler_ame_frame.
| void(* handle_amr_frame) (can_msg_t *can_msg) |
REQUIRED. AMR (Alias Map Reset) control frame. Typical: CanRxMessageHandler_amr_frame.
| void(* handle_error_info_report_frame) (can_msg_t *can_msg) |
REQUIRED. Error Information Report control frame. Typical: CanRxMessageHandler_error_info_report_frame.
| void(* handle_cid_frame) (can_msg_t *can_msg) |
REQUIRED. CID (Check ID) control frame. Typical: CanRxMessageHandler_cid_frame.
| alias_mapping_t *(* alias_mapping_find_mapping_by_alias) (uint16_t alias) |
REQUIRED. Find alias mapping by 12-bit alias (validates addressed-message destination). Typical: AliasMappings_find_mapping_by_alias.
| void(* on_receive) (can_msg_t *can_msg) |
OPTIONAL. Called immediately when a frame arrives, before any routing. Good for counters/LEDs. May be NULL.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License