OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
train_state_TAG Struct Reference

Mutable runtime state for a single train node. More...

Data Fields

uint16_t set_speed
 
uint16_t commanded_speed
 
uint16_t actual_speed
 
bool estop_active
 
bool global_estop_active
 
bool global_eoff_active
 
node_id_t controller_node_id
 
uint16_t controller_alias
 
uint8_t reserved_node_count
 
node_id_t reserved_by_node_id
 
uint32_t heartbeat_timeout_s
 
uint32_t heartbeat_counter_100ms
 
train_listener_entry_t listeners [USER_DEFINED_MAX_LISTENERS_PER_TRAIN]
 
uint8_t listener_count
 
uint8_t listener_enum_index
 
uint16_t functions [USER_DEFINED_MAX_TRAIN_FUNCTIONS]
 
uint16_t dcc_address
 
bool is_long_address
 
uint8_t speed_steps
 
struct openlcb_node_TAGowner_node
 

Detailed Description

Mutable runtime state for a single train node.

Allocated from a static pool by OpenLcbApplicationTrain_setup().

Field Documentation

◆ set_speed

uint16_t set_speed

Last commanded speed (float16)

◆ commanded_speed

uint16_t commanded_speed

Control algorithm output speed (float16)

◆ actual_speed

uint16_t actual_speed

Measured speed, optional (float16)

◆ estop_active

bool estop_active

Point-to-point E-stop active

◆ global_estop_active

bool global_estop_active

Global Emergency Stop active

◆ global_eoff_active

bool global_eoff_active

Global Emergency Off active

◆ controller_node_id

node_id_t controller_node_id

Active controller (0 if none)

◆ controller_alias

uint16_t controller_alias

CAN alias of active controller (0 if none)

◆ reserved_node_count

uint8_t reserved_node_count

Reservation count

◆ reserved_by_node_id

node_id_t reserved_by_node_id

Node ID that holds the reservation (0 if none)

◆ heartbeat_timeout_s

uint32_t heartbeat_timeout_s

Heartbeat deadline in seconds (0 = disabled)

◆ heartbeat_counter_100ms

uint32_t heartbeat_counter_100ms

Heartbeat countdown in 100ms ticks

◆ listeners

train_listener_entry_t listeners[USER_DEFINED_MAX_LISTENERS_PER_TRAIN]

◆ listener_count

uint8_t listener_count

◆ listener_enum_index

uint8_t listener_enum_index

Enumeration index for listener forwarding

◆ functions

uint16_t functions[USER_DEFINED_MAX_TRAIN_FUNCTIONS]

Function values indexed by function number

◆ dcc_address

uint16_t dcc_address

DCC address (0 = not set)

◆ is_long_address

bool is_long_address

true = extended (long) DCC address

◆ speed_steps

uint8_t speed_steps

0=default, 1=14, 2=28, 3=128

◆ owner_node

struct openlcb_node_TAG* owner_node

Back-pointer to owning node


The documentation for this struct was generated from the following file:

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