|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Memory-config operations dispatcher implementation. More...
Functions | |
| void | ProtocolConfigMemOperationsHandler_initialize (const interface_protocol_config_mem_operations_handler_t *interface_protocol_config_mem_operations_handler) |
| Stores the callback interface. Call once at startup. | |
| void | ProtocolConfigMemOperationsHandler_request_options_cmd (openlcb_statemachine_info_t *statemachine_info, config_mem_operations_request_info_t *config_mem_operations_request_info) |
| Build a Get Configuration Options reply datagram. | |
| void | ProtocolConfigMemOperationsHandler_request_get_address_space_info (openlcb_statemachine_info_t *statemachine_info, config_mem_operations_request_info_t *config_mem_operations_request_info) |
| Build a Get Address Space Info reply (present or not-present). | |
| void | ProtocolConfigMemOperationsHandler_request_reserve_lock (openlcb_statemachine_info_t *statemachine_info, config_mem_operations_request_info_t *config_mem_operations_request_info) |
| Handle Lock/Reserve command: grant, release, or report current holder. | |
| void | ProtocolConfigMemOperationsHandler_options_cmd (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Get Configuration Options command to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_options_reply (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Get Configuration Options reply to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_get_address_space_info (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Get Address Space Info command to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_get_address_space_info_reply_not_present (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Address Space Info Not Present reply to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_get_address_space_info_reply_present (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Address Space Info Present reply to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_reserve_lock (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Lock/Reserve command to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_reserve_lock_reply (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Lock/Reserve reply to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_get_unique_id (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Get Unique ID command to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_get_unique_id_reply (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Get Unique ID reply to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_unfreeze (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Unfreeze command to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_freeze (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Freeze command to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_update_complete (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Update Complete command to two-phase handler. | |
| void | ProtocolConfigMemOperationsHandler_reset_reboot (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Reset/Reboot command. | |
| void | ProtocolConfigMemOperationsHandler_factory_reset (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Factory Reset command to two-phase handler. | |
Memory-config operations dispatcher implementation.
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.
Two-phase ACK-then-execute handling for options, address-space info, lock, freeze, reset, and factory-reset sub-commands. Routes each operation to registered callbacks and sends appropriate replies.
| void ProtocolConfigMemOperationsHandler_initialize | ( | const interface_protocol_config_mem_operations_handler_t * | interface_protocol_config_mem_operations_handler | ) |
Stores the callback interface. Call once at startup.
* @param interface_protocol_config_mem_operations_handler Populated table. *
| void ProtocolConfigMemOperationsHandler_request_options_cmd | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_operations_request_info_t * | config_mem_operations_request_info ) |
Build a Get Configuration Options reply datagram.
Build outgoing Get Configuration Options command datagram.
Algorithm:
* @param statemachine_info Context. * @param config_mem_operations_request_info Request info. *
| void ProtocolConfigMemOperationsHandler_request_get_address_space_info | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_operations_request_info_t * | config_mem_operations_request_info ) |
Build a Get Address Space Info reply (present or not-present).
Build outgoing Get Address Space Info command datagram.
Algorithm:
* @param statemachine_info Context. * @param config_mem_operations_request_info Carries space_info pointer. *
| void ProtocolConfigMemOperationsHandler_request_reserve_lock | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_operations_request_info_t * | config_mem_operations_request_info ) |
Handle Lock/Reserve command: grant, release, or report current holder.
Build outgoing Lock/Reserve command datagram.
Algorithm:
* @param statemachine_info Context. * @param config_mem_operations_request_info Request info. *
| void ProtocolConfigMemOperationsHandler_options_cmd | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Get Configuration Options command to two-phase handler.
Handle incoming Get Configuration Options command.
| void ProtocolConfigMemOperationsHandler_options_reply | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Get Configuration Options reply to two-phase handler.
Handle incoming Get Configuration Options reply.
| void ProtocolConfigMemOperationsHandler_get_address_space_info | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Get Address Space Info command to two-phase handler.
Handle incoming Get Address Space Info command.
| void ProtocolConfigMemOperationsHandler_get_address_space_info_reply_not_present | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Address Space Info Not Present reply to two-phase handler.
Handle incoming Address Space Info Not Present reply.
| void ProtocolConfigMemOperationsHandler_get_address_space_info_reply_present | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Address Space Info Present reply to two-phase handler.
Handle incoming Address Space Info Present reply.
| void ProtocolConfigMemOperationsHandler_reserve_lock | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Lock/Reserve command to two-phase handler.
Handle incoming Lock/Reserve command.
| void ProtocolConfigMemOperationsHandler_reserve_lock_reply | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Lock/Reserve reply to two-phase handler.
Handle incoming Lock/Reserve reply.
| void ProtocolConfigMemOperationsHandler_get_unique_id | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Get Unique ID command to two-phase handler.
Handle incoming Get Unique ID command.
| void ProtocolConfigMemOperationsHandler_get_unique_id_reply | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Get Unique ID reply to two-phase handler.
Handle incoming Get Unique ID reply.
| void ProtocolConfigMemOperationsHandler_unfreeze | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Unfreeze command to two-phase handler.
Handle incoming Unfreeze command.
| void ProtocolConfigMemOperationsHandler_freeze | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Freeze command to two-phase handler.
Handle incoming Freeze command.
| void ProtocolConfigMemOperationsHandler_update_complete | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Update Complete command to two-phase handler.
Handle incoming Update Complete command.
| void ProtocolConfigMemOperationsHandler_reset_reboot | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Reset/Reboot command.
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.
| void ProtocolConfigMemOperationsHandler_factory_reset | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Factory Reset command to two-phase handler.
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.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License