|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Core type definitions, structures, and configuration constants for the OpenLCB library. More...
Go to the source code of this file.
Data Structures | |
| struct | event_id_struct_t |
| Event ID paired with its current status. More... | |
| struct | event_id_range_t |
| Contiguous range of Event IDs starting at a base address. More... | |
| struct | broadcast_time_t |
| Broadcast Time hour/minute. More... | |
| struct | broadcast_date_t |
| Broadcast Time month/day. More... | |
| struct | broadcast_year_t |
| Broadcast Time year. More... | |
| struct | broadcast_rate_t |
| Broadcast Time clock rate (12-bit signed fixed point, 2 fractional bits). More... | |
| struct | broadcast_clock_state_t |
| Complete state for one Broadcast Time clock. More... | |
| struct | broadcast_clock_t |
| A clock slot with state and subscription flags. More... | |
| struct | openlcb_msg_state_t |
| Message buffer allocation/assembly state flags. More... | |
| union | openlcb_msg_timer_t |
| Timer field union for openlcb_msg_t. More... | |
| struct | openlcb_msg_t |
| Core OpenLCB message structure. More... | |
| struct | message_buffer_t |
| Master buffer storage: message structures + segregated payload pools. More... | |
| struct | user_snip_struct_t |
| SNIP identification strings (manufacturer + user version byte). More... | |
| struct | user_configuration_options |
| Capability flags returned by Get Configuration Options command. More... | |
| struct | user_address_space_info_t |
| Properties of a single configuration memory address space. More... | |
| struct | node_parameters_TAG |
| Complete node configuration parameters (typically const/flash). More... | |
| struct | event_id_enum_t |
| Event list enumeration state. More... | |
| struct | event_id_consumer_list_t |
| List of events consumed by a node. More... | |
| struct | event_id_producer_list_t |
| List of events produced by a node. More... | |
| struct | openlcb_node_state_t |
| Bit-packed node state flags. More... | |
| struct | train_listener_entry_t |
| A single listener entry for a train consist. More... | |
| struct | train_state_TAG |
| Mutable runtime state for a single train node. More... | |
| struct | openlcb_node_TAG |
| OpenLCB virtual node. More... | |
| struct | openlcb_nodes_t |
| Collection of all virtual nodes. More... | |
| struct | openlcb_statemachine_worker_t |
| State machine temporary working buffers. More... | |
| struct | openlcb_stream_message_t |
| Message with inline STREAM-sized payload. More... | |
| struct | openlcb_outgoing_stream_msg_info_t |
| Outgoing message context for the main state machine. More... | |
| struct | openlcb_incoming_msg_info_t |
| Incoming message context. More... | |
| struct | openlcb_statemachine_info_t |
| Complete context passed to protocol handler functions. More... | |
| struct | openlcb_basic_message_t |
| Message with inline BASIC-sized payload. More... | |
| struct | openlcb_outgoing_basic_msg_info_t |
| Outgoing message context for the login state machine. More... | |
| struct | openlcb_login_statemachine_info_t |
| Login state machine context. More... | |
| struct | config_mem_operations_request_info_TAG |
| Request info for Get Options / Get Address Space Info commands. More... | |
| struct | config_mem_read_request_info_TAG |
| Request info for a configuration memory read operation. More... | |
| struct | config_mem_write_request_info_TAG |
| Request info for a configuration memory write operation. More... | |
Macros | |
| #define | LEN_CONFIG_MEM_OPTIONS_DESCRIPTION (64 - 1) |
| Maximum description length for Configuration Options reply. | |
| #define | LEN_CONFIG_MEM_ADDRESS_SPACE_DESCRIPTION (60 - 1) |
| Maximum description length for Address Space Info reply. | |
| #define | NULL_NODE_ID 0x000000000000 |
| NULL/unassigned Node ID value. | |
| #define | NULL_EVENT_ID 0x0000000000000000 |
| NULL/unassigned Event ID value. | |
| #define | LEN_SNIP_NAME_BUFFER 41 |
| SNIP manufacturer name field length (including null) | |
| #define | LEN_SNIP_MODEL_BUFFER 41 |
| SNIP model name field length (including null) | |
| #define | LEN_SNIP_HARDWARE_VERSION_BUFFER 21 |
| SNIP hardware version field length (including null) | |
| #define | LEN_SNIP_SOFTWARE_VERSION_BUFFER 21 |
| SNIP software version field length (including null) | |
| #define | LEN_SNIP_USER_NAME_BUFFER 63 |
| SNIP user-assigned name field length (including null) | |
| #define | LEN_SNIP_USER_DESCRIPTION_BUFFER 64 |
| SNIP user description field length (including null) | |
| #define | LEN_SNIP_USER_DATA (LEN_SNIP_USER_NAME_BUFFER + LEN_SNIP_USER_DESCRIPTION_BUFFER) |
| Total SNIP user data size (name + description) | |
| #define | LEN_SNIP_VERSION 1 |
| SNIP manufacturer version field length (1 byte) | |
| #define | LEN_SNIP_USER_VERSION 1 |
| SNIP user version field length (1 byte) | |
| #define | LEN_SNIP_STRUCTURE 264 |
| Maximum SNIP structure size (256 payload + 8 Event ID) | |
| #define | LEN_MESSAGE_BYTES_BASIC 16 |
| BASIC message payload size. | |
| #define | LEN_MESSAGE_BYTES_DATAGRAM 72 |
| DATAGRAM message maximum payload size. | |
| #define | LEN_MESSAGE_BYTES_SNIP 256 |
| SNIP message payload size (also covers Events with Payload) | |
| #define | LEN_MESSAGE_BYTES_STREAM 512 |
| STREAM message payload size. | |
| #define | LEN_EVENT_ID 8 |
| Event ID size in bytes. | |
| #define | LEN_MESSAGE_BUFFER (USER_DEFINED_BASIC_BUFFER_DEPTH + USER_DEFINED_DATAGRAM_BUFFER_DEPTH + USER_DEFINED_SNIP_BUFFER_DEPTH + USER_DEFINED_STREAM_BUFFER_DEPTH) |
| Total number of message buffers (sum of all buffer types) | |
| #define | LEN_DATAGRAM_MAX_PAYLOAD 64 |
| Maximum datagram payload after protocol overhead. | |
| #define | LEN_EVENT_PAYLOAD LEN_MESSAGE_BYTES_SNIP |
| Event payload maximum size (uses SNIP buffer) | |
Typedefs | |
| typedef uint8_t | payload_basic_t[LEN_MESSAGE_BYTES_BASIC] |
| BASIC message payload buffer (16 bytes) | |
| typedef uint8_t | payload_datagram_t[LEN_MESSAGE_BYTES_DATAGRAM] |
| DATAGRAM message payload buffer (72 bytes) | |
| typedef uint8_t | payload_snip_t[LEN_MESSAGE_BYTES_SNIP] |
| SNIP message payload buffer (256 bytes) | |
| typedef uint8_t | payload_stream_t[LEN_MESSAGE_BYTES_STREAM] |
| STREAM message payload buffer (512 bytes) | |
| typedef payload_basic_t | openlcb_basic_data_buffer_t[USER_DEFINED_BASIC_BUFFER_DEPTH] |
| Array of BASIC payload buffers. | |
| typedef payload_datagram_t | openlcb_datagram_data_buffer_t[USER_DEFINED_DATAGRAM_BUFFER_DEPTH] |
| Array of DATAGRAM payload buffers. | |
| typedef payload_snip_t | openlcb_snip_data_buffer_t[USER_DEFINED_SNIP_BUFFER_DEPTH] |
| Array of SNIP payload buffers. | |
| typedef payload_stream_t | openlcb_stream_data_buffer_t[USER_DEFINED_STREAM_BUFFER_DEPTH] |
| Array of STREAM payload buffers. | |
| typedef uint8_t | openlcb_payload_t[1] |
| Generic 1-byte payload pointer type for casting. | |
| typedef uint64_t | event_id_t |
| 64-bit Event ID. | |
| typedef uint64_t | node_id_t |
| 48-bit Node ID stored in a 64-bit type (upper 16 bits unused). | |
| typedef uint8_t | event_payload_t[LEN_EVENT_PAYLOAD] |
| Event payload data buffer (LEN_EVENT_PAYLOAD bytes). | |
| typedef uint8_t | configuration_memory_buffer_t[LEN_DATAGRAM_MAX_PAYLOAD] |
| Configuration memory read/write operation buffer (64 bytes). | |
| typedef openlcb_msg_t | openlcb_msg_array_t[LEN_MESSAGE_BUFFER] |
| Array of all message structures in the buffer store. | |
| typedef struct node_parameters_TAG | node_parameters_t |
| Complete node configuration parameters (typically const/flash). | |
| typedef struct train_state_TAG | train_state_t |
| Mutable runtime state for a single train node. | |
| typedef struct openlcb_node_TAG | openlcb_node_t |
| OpenLCB virtual node. | |
| typedef void(* | parameterless_callback_t) (void) |
| Callback function type with no parameters. | |
| typedef void(* | operations_config_mem_space_func_t) (openlcb_statemachine_info_t *statemachine_info, struct config_mem_operations_request_info_TAG *config_mem_operations_request_info) |
| Config mem operations callback function type. | |
| typedef struct config_mem_operations_request_info_TAG | config_mem_operations_request_info_t |
| Request info for Get Options / Get Address Space Info commands. | |
| typedef void(* | read_config_mem_space_func_t) (openlcb_statemachine_info_t *statemachine_info, struct config_mem_read_request_info_TAG *config_mem_read_request_info) |
| Config mem read callback function type. | |
| typedef struct config_mem_read_request_info_TAG | config_mem_read_request_info_t |
| Request info for a configuration memory read operation. | |
| typedef void(* | write_config_mem_space_func_t) (openlcb_statemachine_info_t *statemachine_info, struct config_mem_write_request_info_TAG *config_mem_write_request_info) |
| Config mem write callback function type. | |
| typedef struct config_mem_write_request_info_TAG | config_mem_write_request_info_t |
| Request info for a configuration memory write operation. | |
Core type definitions, structures, and configuration constants for the OpenLCB library.
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.
Defines all fundamental data types used across the library: message buffers (BASIC/DATAGRAM/SNIP/STREAM pools), node structures with event producer/consumer lists, configuration memory request types, broadcast time clock state, and train state. All memory is statically allocated at compile time — there is no dynamic allocation at runtime.
| typedef uint8_t openlcb_payload_t[1] |
Generic 1-byte payload pointer type for casting.
| typedef uint64_t event_id_t |
64-bit Event ID.
| typedef uint64_t node_id_t |
48-bit Node ID stored in a 64-bit type (upper 16 bits unused).
| typedef uint8_t event_payload_t[LEN_EVENT_PAYLOAD] |
Event payload data buffer (LEN_EVENT_PAYLOAD bytes).
| typedef uint8_t configuration_memory_buffer_t[LEN_DATAGRAM_MAX_PAYLOAD] |
Configuration memory read/write operation buffer (64 bytes).
| typedef openlcb_msg_t openlcb_msg_array_t[LEN_MESSAGE_BUFFER] |
Array of all message structures in the buffer store.
| typedef struct node_parameters_TAG node_parameters_t |
Complete node configuration parameters (typically const/flash).
Contains SNIP strings, protocol support bits, CDI/FDI data, and address space information for every supported space.
| typedef struct train_state_TAG train_state_t |
Mutable runtime state for a single train node.
Allocated from a static pool by OpenLcbApplicationTrain_setup().
| typedef struct openlcb_node_TAG openlcb_node_t |
OpenLCB virtual node.
Holds identity, state, event lists, and a pointer to const configuration parameters. Nodes cannot be deallocated once allocated.
| typedef void(* parameterless_callback_t) (void) |
Callback function type with no parameters.
| typedef void(* operations_config_mem_space_func_t) (openlcb_statemachine_info_t *statemachine_info, struct config_mem_operations_request_info_TAG *config_mem_operations_request_info) |
Config mem operations callback function type.
Request info for Get Options / Get Address Space Info commands.
| typedef void(* read_config_mem_space_func_t) (openlcb_statemachine_info_t *statemachine_info, struct config_mem_read_request_info_TAG *config_mem_read_request_info) |
Config mem read callback function type.
| typedef struct config_mem_read_request_info_TAG config_mem_read_request_info_t |
Request info for a configuration memory read operation.
| typedef void(* write_config_mem_space_func_t) (openlcb_statemachine_info_t *statemachine_info, struct config_mem_write_request_info_TAG *config_mem_write_request_info) |
Config mem write callback function type.
| typedef struct config_mem_write_request_info_TAG config_mem_write_request_info_t |
Request info for a configuration memory write operation.
| enum payload_type_enum |
| enum event_status_enum |
| enum space_encoding_enum |
Power-of-two event range sizes for range-identified events.
Broadcast Time Protocol event type decoded from an Event ID.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License