|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Configuration memory read handler implementation. More...
Functions | |
| void | ProtocolConfigMemReadHandler_initialize (const interface_protocol_config_mem_read_handler_t *interface_protocol_config_mem_read_handler) |
| Stores the callback interface. Call once at startup. | |
| void | ProtocolConfigMemReadHandler_read_request_config_definition_info (openlcb_statemachine_info_t *statemachine_info, config_mem_read_request_info_t *config_mem_read_request_info) |
| Read from CDI (0xFF): copy bytes from node->parameters->cdi[]. | |
| void | ProtocolConfigMemReadHandler_read_request_train_function_definition_info (openlcb_statemachine_info_t *statemachine_info, config_mem_read_request_info_t *config_mem_read_request_info) |
| Read from Train FDI (0xFA): copy bytes from node->parameters->fdi[]. | |
| void | ProtocolConfigMemReadHandler_read_request_train_function_config_memory (openlcb_statemachine_info_t *statemachine_info, config_mem_read_request_info_t *config_mem_read_request_info) |
| Read from Train Fn Config (0xF9): map flat byte address to functions[]. | |
| void | ProtocolConfigMemReadHandler_read_request_config_mem (openlcb_statemachine_info_t *statemachine_info, config_mem_read_request_info_t *config_mem_read_request_info) |
| Read from Config space (0xFD) via config_memory_read callback. | |
| void | ProtocolConfigMemReadHandler_read_request_acdi_manufacturer (openlcb_statemachine_info_t *statemachine_info, config_mem_read_request_info_t *config_mem_read_request_info) |
| Read from ACDI-Mfg (0xFC): dispatch to SNIP loaders by address. | |
| void | ProtocolConfigMemReadHandler_read_request_acdi_user (openlcb_statemachine_info_t *statemachine_info, config_mem_read_request_info_t *config_mem_read_request_info) |
| Read from ACDI-User (0xFB): dispatch to SNIP loaders by address. | |
| void | ProtocolConfigMemReadHandler_read_space_config_description_info (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch CDI (0xFF) read to two-phase handler. | |
| void | ProtocolConfigMemReadHandler_read_space_all (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch All (0xFE) read to two-phase handler. | |
| void | ProtocolConfigMemReadHandler_read_space_config_memory (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Config (0xFD) read to two-phase handler. | |
| void | ProtocolConfigMemReadHandler_read_space_acdi_manufacturer (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch ACDI-Mfg (0xFC) read to two-phase handler. | |
| void | ProtocolConfigMemReadHandler_read_space_acdi_user (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch ACDI-User (0xFB) read to two-phase handler. | |
| void | ProtocolConfigMemReadHandler_read_space_train_function_definition_info (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Train FDI (0xFA) read to two-phase handler. | |
| void | ProtocolConfigMemReadHandler_read_space_train_function_config_memory (openlcb_statemachine_info_t *statemachine_info) |
| Dispatch Train Fn Config (0xF9) read to two-phase handler. | |
| void | ProtocolConfigMemReadHandler_read_message (openlcb_statemachine_info_t *statemachine_info, uint8_t space, uint8_t return_msg_ok, uint8_t return_msg_fail) |
| Generic read message handler. Placeholder. | |
| void | ProtocolConfigMemReadHandler_read_reply_ok_message (openlcb_statemachine_info_t *statemachine_info, uint8_t space) |
| Generic read reply OK handler. Placeholder. | |
| void | ProtocolConfigMemReadHandler_read_reply_reject_message (openlcb_statemachine_info_t *statemachine_info, uint8_t space) |
| Generic read reply reject handler. Placeholder. | |
Configuration memory read handler 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 dispatch for read commands across all standard address spaces (CDI, All, Config, ACDI-Mfg, ACDI-User, Train FDI, Train Fn Config). Sends Datagram Received OK with reply-pending, reads from config memory, and returns the data in a reply datagram.
| void ProtocolConfigMemReadHandler_initialize | ( | const interface_protocol_config_mem_read_handler_t * | interface_protocol_config_mem_read_handler | ) |
Stores the callback interface. Call once at startup.
* @param interface_protocol_config_mem_read_handler Populated table. *
| void ProtocolConfigMemReadHandler_read_request_config_definition_info | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_read_request_info_t * | config_mem_read_request_info ) |
Read from CDI (0xFF): copy bytes from node->parameters->cdi[].
Send read request targeting CDI (0xFF) on another node.
| void ProtocolConfigMemReadHandler_read_request_train_function_definition_info | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_read_request_info_t * | config_mem_read_request_info ) |
Read from Train FDI (0xFA): copy bytes from node->parameters->fdi[].
Send read request targeting Train FDI (0xFA) on another node.
| void ProtocolConfigMemReadHandler_read_request_train_function_config_memory | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_read_request_info_t * | config_mem_read_request_info ) |
Read from Train Fn Config (0xF9): map flat byte address to functions[].
Send read request targeting Train Fn Config (0xF9) on another node.
Each 16-bit function value occupies 2 bytes big-endian: address/2 = fn_index, address%2 selects high/low byte.
| void ProtocolConfigMemReadHandler_read_request_config_mem | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_read_request_info_t * | config_mem_read_request_info ) |
Read from Config space (0xFD) via config_memory_read callback.
Send read request targeting Config (0xFD) on another node.
Partial reads (fewer bytes than requested) return TRANSFER_ERROR.
| void ProtocolConfigMemReadHandler_read_request_acdi_manufacturer | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_read_request_info_t * | config_mem_read_request_info ) |
Read from ACDI-Mfg (0xFC): dispatch to SNIP loaders by address.
Send read request targeting ACDI-Mfg (0xFC) on another node.
| void ProtocolConfigMemReadHandler_read_request_acdi_user | ( | openlcb_statemachine_info_t * | statemachine_info, |
| config_mem_read_request_info_t * | config_mem_read_request_info ) |
Read from ACDI-User (0xFB): dispatch to SNIP loaders by address.
Send read request targeting ACDI-User (0xFB) on another node.
| void ProtocolConfigMemReadHandler_read_space_config_description_info | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch CDI (0xFF) read to two-phase handler.
Read from CDI space (0xFF).
| void ProtocolConfigMemReadHandler_read_space_all | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch All (0xFE) read to two-phase handler.
Read from All space (0xFE).
| void ProtocolConfigMemReadHandler_read_space_config_memory | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Config (0xFD) read to two-phase handler.
Read from Config space (0xFD).
| void ProtocolConfigMemReadHandler_read_space_acdi_manufacturer | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch ACDI-Mfg (0xFC) read to two-phase handler.
Read from ACDI-Mfg space (0xFC).
| void ProtocolConfigMemReadHandler_read_space_acdi_user | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch ACDI-User (0xFB) read to two-phase handler.
Read from ACDI-User space (0xFB).
| void ProtocolConfigMemReadHandler_read_space_train_function_definition_info | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Train FDI (0xFA) read to two-phase handler.
Read from Train FDI space (0xFA).
| void ProtocolConfigMemReadHandler_read_space_train_function_config_memory | ( | openlcb_statemachine_info_t * | statemachine_info | ) |
Dispatch Train Fn Config (0xF9) read to two-phase handler.
Read from Train Fn Config space (0xF9).
| void ProtocolConfigMemReadHandler_read_message | ( | openlcb_statemachine_info_t * | statemachine_info, |
| uint8_t | space, | ||
| uint8_t | return_msg_ok, | ||
| uint8_t | return_msg_fail ) |
Generic read message handler. Placeholder.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
| space | Address space number. |
| return_msg_ok | MTI for success reply. |
| return_msg_fail | MTI for failure reply. |
| void ProtocolConfigMemReadHandler_read_reply_ok_message | ( | openlcb_statemachine_info_t * | statemachine_info, |
| uint8_t | space ) |
Generic read reply OK handler. Placeholder.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
| space | Address space number. |
| void ProtocolConfigMemReadHandler_read_reply_reject_message | ( | openlcb_statemachine_info_t * | statemachine_info, |
| uint8_t | space ) |
Generic read reply reject handler. Placeholder.
| statemachine_info | Pointer to openlcb_statemachine_info_t context. |
| space | Address space number. |
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License