OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
openlcb_node.h
Go to the documentation of this file.
1
39// This is a guard condition so that contents of this file are not included
40// more than once.
41#ifndef __OPENLCB_OPENLCB_NODE__
42#define __OPENLCB_OPENLCB_NODE__
43
44#include <stdbool.h>
45#include <stdint.h>
46
47#include "openlcb_types.h"
48
55typedef struct
56{
57
59 void (*on_100ms_timer_tick)(void);
60
62
63#ifdef __cplusplus
64extern "C" {
65#endif /* __cplusplus */
66
76 extern void OpenLcbNode_initialize(const interface_openlcb_node_t *interface);
77
92 extern openlcb_node_t *OpenLcbNode_allocate(uint64_t node_id, const node_parameters_t *node_parameters);
93
105 extern openlcb_node_t *OpenLcbNode_get_first(uint8_t key);
106
114 extern openlcb_node_t *OpenLcbNode_get_next(uint8_t key);
115
123 extern bool OpenLcbNode_is_last(uint8_t key);
124
132 extern openlcb_node_t *OpenLcbNode_find_by_alias(uint16_t alias);
133
141 extern openlcb_node_t *OpenLcbNode_find_by_node_id(uint64_t node_id);
142
149 extern void OpenLcbNode_reset_state(void);
150
156 extern uint16_t OpenLcbNode_get_count(void);
157
166 extern void OpenLcbNode_100ms_timer_tick(uint8_t current_tick);
167
168#ifdef __cplusplus
169}
170#endif /* __cplusplus */
171
172#endif /* __OPENLCB_OPENLCB_NODE__ */
openlcb_node_t * OpenLcbNode_find_by_alias(uint16_t alias)
Finds a node by its 12-bit CAN alias.
Definition openlcb_node.c:380
openlcb_node_t * OpenLcbNode_allocate(uint64_t node_id, const node_parameters_t *node_parameters)
Allocates a new node with the given ID and configuration.
Definition openlcb_node.c:338
bool OpenLcbNode_is_last(uint8_t key)
Returns true if the current enumeration position is the last node.
Definition openlcb_node.c:249
openlcb_node_t * OpenLcbNode_find_by_node_id(uint64_t node_id)
Finds a node by its 64-bit OpenLCB node ID.
Definition openlcb_node.c:409
uint16_t OpenLcbNode_get_count(void)
Returns the number of allocated nodes.
Definition openlcb_node.c:479
openlcb_node_t * OpenLcbNode_get_next(uint8_t key)
Returns the next allocated node for the given enumerator key.
Definition openlcb_node.c:215
void OpenLcbNode_reset_state(void)
Resets all allocated nodes to their initial login state.
Definition openlcb_node.c:462
void OpenLcbNode_initialize(const interface_openlcb_node_t *interface)
Initializes the node management module.
Definition openlcb_node.c:146
openlcb_node_t * OpenLcbNode_get_first(uint8_t key)
Returns the first allocated node for enumeration.
Definition openlcb_node.c:181
void OpenLcbNode_100ms_timer_tick(uint8_t current_tick)
100ms timer tick handler — gates the application callback.
Definition openlcb_node.c:437
Core type definitions, structures, and configuration constants for the OpenLCB library.
Dependency injection interface for the OpenLCB Node module.
Definition openlcb_node.h:56
Complete node configuration parameters (typically const/flash).
Definition openlcb_types.h:562
OpenLCB virtual node.
Definition openlcb_types.h:679

Copyright (c) 2026 Jim Kueneman all rights reserved. See the License