|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Configuration memory operations dispatcher. More...
Go to the source code of this file.
Data Structures | |
| struct | interface_protocol_config_mem_operations_handler_t |
| Callback interface for memory-config operations. More... | |
Configuration memory operations dispatcher.
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.
Routes memory-config datagram sub-commands (options, address-space info, lock, freeze, reset, factory-reset) to registered callbacks. Uses a two-phase ACK-then-execute pattern and supports optional per-command handler overrides.
|
extern |
Stores the callback interface. Call once at startup.
| interface_protocol_config_mem_operations_handler | Pointer to interface_protocol_config_mem_operations_handler_t (must remain valid for application lifetime). |
* @param interface_protocol_config_mem_operations_handler Populated table. *
|
extern |
Handle incoming Get Configuration Options command.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Get Configuration Options command.
|
extern |
Handle incoming Get Configuration Options reply.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Get Configuration Options reply.
|
extern |
Handle incoming Get Address Space Info command.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Get Address Space Info command.
|
extern |
Handle incoming Address Space Info Not Present reply.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Address Space Info Not Present reply.
|
extern |
Handle incoming Address Space Info Present reply.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Address Space Info Present reply.
|
extern |
Handle incoming Lock/Reserve command.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Lock/Reserve command.
|
extern |
Handle incoming Lock/Reserve reply.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Lock/Reserve reply.
|
extern |
Handle incoming Get Unique ID command.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Get Unique ID command.
|
extern |
Handle incoming Get Unique ID reply.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Get Unique ID reply.
|
extern |
Handle incoming Unfreeze command.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Unfreeze command.
|
extern |
Handle incoming Freeze command.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Freeze command.
|
extern |
Handle incoming Update Complete command.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Update Complete command.
|
extern |
Handle incoming Reset/Reboot command.
Per MemoryConfigurationS Section 4.24, the node acknowledges with Initialization Complete instead of Datagram Received OK.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Reset/Reboot command.
Per MemoryConfigurationS Section 4.24, the Reset/Reboot command is only [0x20, 0xA9] with no Node ID in the payload. Unlike Factory Reset (0xAA, Section 4.25) which requires a Node ID as a safety guard, Reset/Reboot applies unconditionally to the addressed node.
Per Section 4.24: "The receiving node may acknowledge this command with a Node Initialization Complete instead of a Datagram Received OK response." We skip the datagram ACK — the Initialization Complete from the reboot serves as acknowledgment.
|
extern |
Handle incoming Factory Reset command (destructive).
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
Handle incoming Factory Reset command (destructive).
Per MemoryConfigurationS Section 4.25, the Reinitialize/Factory Reset command includes a 6-byte Node ID (bytes 2-7) as a safety guard. The target Node ID must match or the command is silently ignored.
|
extern |
Build outgoing Get Configuration Options command datagram.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
| config_mem_operations_request_info | Pointer to config_mem_operations_request_info_t request. |
Build outgoing Get Configuration Options command datagram.
Algorithm:
* @param statemachine_info Context. * @param config_mem_operations_request_info Request info. *
|
extern |
Build outgoing Get Address Space Info command datagram.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
| config_mem_operations_request_info | Pointer to config_mem_operations_request_info_t request. |
Build outgoing Get Address Space Info command datagram.
Algorithm:
* @param statemachine_info Context. * @param config_mem_operations_request_info Carries space_info pointer. *
|
extern |
Build outgoing Lock/Reserve command datagram.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
| config_mem_operations_request_info | Pointer to config_mem_operations_request_info_t request. |
Build outgoing Lock/Reserve command datagram.
Algorithm:
* @param statemachine_info Context. * @param config_mem_operations_request_info Request info. *
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License