|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Core message network protocol handler. More...
Go to the source code of this file.
Data Structures | |
| struct | interface_openlcb_protocol_message_network_t |
| Callback interface for message network protocol notifications. More... | |
Functions | |
| void | ProtocolMessageNetwork_initialize (const interface_openlcb_protocol_message_network_t *interface_openlcb_protocol_message_network) |
| Stores the callback interface. Call once at startup. | |
| void | ProtocolMessageNetwork_handle_initialization_complete (openlcb_statemachine_info_t *statemachine_info) |
| Handle Initialization Complete (full node). No automatic response. | |
| void | ProtocolMessageNetwork_handle_initialization_complete_simple (openlcb_statemachine_info_t *statemachine_info) |
| Handle Initialization Complete Simple. No automatic response. | |
| void | ProtocolMessageNetwork_handle_protocol_support_inquiry (openlcb_statemachine_info_t *statemachine_info) |
| Handle Protocol Support Inquiry — replies with this node’s PSI flags. | |
| void | ProtocolMessageNetwork_handle_protocol_support_reply (openlcb_statemachine_info_t *statemachine_info) |
| Handle Protocol Support Reply. No automatic response. | |
| void | ProtocolMessageNetwork_handle_verify_node_id_global (openlcb_statemachine_info_t *statemachine_info) |
| Handle global Verify Node ID — replies if payload matches or is empty. | |
| void | ProtocolMessageNetwork_handle_verify_node_id_addressed (openlcb_statemachine_info_t *statemachine_info) |
| Handle addressed Verify Node ID — always replies. | |
| void | ProtocolMessageNetwork_handle_verified_node_id (openlcb_statemachine_info_t *statemachine_info) |
| Handle Verified Node ID — checks for duplicate Node ID. | |
| void | ProtocolMessageNetwork_handle_optional_interaction_rejected (openlcb_statemachine_info_t *statemachine_info) |
| Handle Optional Interaction Rejected. No automatic response. | |
| void | ProtocolMessageNetwork_handle_terminate_due_to_error (openlcb_statemachine_info_t *statemachine_info) |
| Handle Terminate Due To Error. No automatic response. | |
Core message network protocol handler.
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.
Implements Verify Node ID (addressed and global), Protocol Support Inquiry/Reply, Initialization Complete, Optional Interaction Rejected, and Terminate Due To Error. Also detects duplicate Node IDs on the network.
|
extern |
Stores the callback interface. Call once at startup.
| interface_openlcb_protocol_message_network | Pointer to interface_openlcb_protocol_message_network_t (must remain valid for application lifetime). |
* @param interface_openlcb_protocol_message_network Populated table. *
|
extern |
Handle Initialization Complete (full node). No automatic response.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle Initialization Complete (full node). No automatic response.
|
extern |
Handle Initialization Complete Simple. No automatic response.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle Initialization Complete Simple. No automatic response.
|
extern |
Handle Protocol Support Inquiry — replies with this node’s PSI flags.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle Protocol Support Inquiry — replies with this node’s PSI flags.
Swaps PSI_FIRMWARE_UPGRADE → PSI_FIRMWARE_UPGRADE_ACTIVE when a firmware upgrade is in progress.
|
extern |
Handle Protocol Support Reply. No automatic response.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
|
extern |
Handle global Verify Node ID — replies if payload matches or is empty.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
|
extern |
Handle addressed Verify Node ID — always replies.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle addressed Verify Node ID — always replies.
|
extern |
Handle Verified Node ID — checks for duplicate Node ID.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle Verified Node ID — checks for duplicate Node ID.
|
extern |
Handle Optional Interaction Rejected. No automatic response.
Parses the 2-byte error code (payload bytes 0-1) and 2-byte rejected MTI (payload bytes 2-3). If the interface callback on_optional_interaction_rejected is non-NULL, it is invoked with the parsed values. Per MessageNetworkS Section 3.5.2.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle Optional Interaction Rejected. No automatic response.
Parses error code (bytes 0-1) and rejected MTI (bytes 2-3). Invokes the application callback if non-NULL. No automatic response.
|
extern |
Handle Terminate Due To Error. No automatic response.
Parses the 2-byte error code (payload bytes 0-1) and 2-byte rejected MTI (payload bytes 2-3). If the interface callback on_terminate_due_to_error is non-NULL, it is invoked with the parsed values. Per MessageNetworkS Section 3.5.2.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle Terminate Due To Error. No automatic response.
Parses error code (bytes 0-1) and rejected MTI (bytes 2-3). Invokes the application callback if non-NULL. No automatic response.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License