|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Callback interface for train protocol events. More...
Data Fields | |
| void(* | on_speed_changed )(openlcb_node_t *openlcb_node, uint16_t speed_float16) |
| Speed was set. State already updated. | |
| void(* | on_function_changed )(openlcb_node_t *openlcb_node, uint32_t fn_address, uint16_t fn_value) |
| Function was set. Standard functions stored in train_state.functions[]. | |
| void(* | on_emergency_entered )(openlcb_node_t *openlcb_node, train_emergency_type_enum emergency_type) |
| Emergency state entered. State flags already updated. | |
| void(* | on_emergency_exited )(openlcb_node_t *openlcb_node, train_emergency_type_enum emergency_type) |
| Emergency state exited. State flags already updated. | |
| void(* | on_controller_assigned )(openlcb_node_t *openlcb_node, node_id_t controller_node_id) |
| Controller assigned or changed. State already updated. | |
| void(* | on_controller_released )(openlcb_node_t *openlcb_node) |
| Controller released. State already cleared. | |
| void(* | on_listener_changed )(openlcb_node_t *openlcb_node) |
| Listener list modified (attach or detach). | |
| void(* | on_heartbeat_timeout )(openlcb_node_t *openlcb_node) |
| Heartbeat timed out. State already updated. | |
| bool(* | on_controller_assign_request )(openlcb_node_t *openlcb_node, node_id_t current_controller, node_id_t requesting_controller) |
| Another controller wants to take over. Return true to accept. NULL = accept. | |
| bool(* | on_controller_changed_request )(openlcb_node_t *openlcb_node, node_id_t new_controller) |
| Controller Changed Notify received. Return true to accept handoff. NULL = accept. | |
| void(* | on_query_speeds_reply )(openlcb_node_t *openlcb_node, uint16_t set_speed, uint8_t status, uint16_t commanded_speed, uint16_t actual_speed) |
| Query Speeds reply received. | |
| void(* | on_query_function_reply )(openlcb_node_t *openlcb_node, uint32_t fn_address, uint16_t fn_value) |
| Query Function reply received. | |
| void(* | on_controller_assign_reply )(openlcb_node_t *openlcb_node, uint8_t result, node_id_t current_controller) |
| Controller Assign reply received. On reject (result != 0), current_controller is the Node ID of the controller that currently owns the train. On accept, it is 0. | |
| void(* | on_controller_query_reply )(openlcb_node_t *openlcb_node, uint8_t flags, node_id_t controller_node_id) |
| Controller Query reply received. | |
| void(* | on_controller_changed_notify_reply )(openlcb_node_t *openlcb_node, uint8_t result) |
| Controller Changed Notify reply received. | |
| void(* | on_listener_attach_reply )(openlcb_node_t *openlcb_node, node_id_t node_id, uint8_t result) |
| Listener Attach reply received. | |
| void(* | on_listener_detach_reply )(openlcb_node_t *openlcb_node, node_id_t node_id, uint8_t result) |
| Listener Detach reply received. | |
| void(* | on_listener_query_reply )(openlcb_node_t *openlcb_node, uint8_t count, uint8_t index, uint8_t flags, node_id_t node_id) |
| Listener Query reply received. | |
| void(* | on_reserve_reply )(openlcb_node_t *openlcb_node, uint8_t result) |
| Reserve reply received. | |
| void(* | on_heartbeat_request )(openlcb_node_t *openlcb_node, uint32_t timeout_seconds) |
| Heartbeat request from train node. | |
Callback interface for train protocol events.
All callbacks are optional (can be NULL).
Train-node side:
Throttle side:
| void(* on_speed_changed) (openlcb_node_t *openlcb_node, uint16_t speed_float16) |
Speed was set. State already updated.
| void(* on_function_changed) (openlcb_node_t *openlcb_node, uint32_t fn_address, uint16_t fn_value) |
Function was set. Standard functions stored in train_state.functions[].
| void(* on_emergency_entered) (openlcb_node_t *openlcb_node, train_emergency_type_enum emergency_type) |
Emergency state entered. State flags already updated.
| void(* on_emergency_exited) (openlcb_node_t *openlcb_node, train_emergency_type_enum emergency_type) |
Emergency state exited. State flags already updated.
| void(* on_controller_assigned) (openlcb_node_t *openlcb_node, node_id_t controller_node_id) |
Controller assigned or changed. State already updated.
| void(* on_controller_released) (openlcb_node_t *openlcb_node) |
Controller released. State already cleared.
| void(* on_listener_changed) (openlcb_node_t *openlcb_node) |
Listener list modified (attach or detach).
| void(* on_heartbeat_timeout) (openlcb_node_t *openlcb_node) |
Heartbeat timed out. State already updated.
| bool(* on_controller_assign_request) (openlcb_node_t *openlcb_node, node_id_t current_controller, node_id_t requesting_controller) |
Another controller wants to take over. Return true to accept. NULL = accept.
| bool(* on_controller_changed_request) (openlcb_node_t *openlcb_node, node_id_t new_controller) |
Controller Changed Notify received. Return true to accept handoff. NULL = accept.
| void(* on_query_speeds_reply) (openlcb_node_t *openlcb_node, uint16_t set_speed, uint8_t status, uint16_t commanded_speed, uint16_t actual_speed) |
Query Speeds reply received.
| void(* on_query_function_reply) (openlcb_node_t *openlcb_node, uint32_t fn_address, uint16_t fn_value) |
Query Function reply received.
| void(* on_controller_assign_reply) (openlcb_node_t *openlcb_node, uint8_t result, node_id_t current_controller) |
Controller Assign reply received. On reject (result != 0), current_controller is the Node ID of the controller that currently owns the train. On accept, it is 0.
| void(* on_controller_query_reply) (openlcb_node_t *openlcb_node, uint8_t flags, node_id_t controller_node_id) |
Controller Query reply received.
| void(* on_controller_changed_notify_reply) (openlcb_node_t *openlcb_node, uint8_t result) |
Controller Changed Notify reply received.
| void(* on_listener_attach_reply) (openlcb_node_t *openlcb_node, node_id_t node_id, uint8_t result) |
Listener Attach reply received.
| void(* on_listener_detach_reply) (openlcb_node_t *openlcb_node, node_id_t node_id, uint8_t result) |
Listener Detach reply received.
| void(* on_listener_query_reply) (openlcb_node_t *openlcb_node, uint8_t count, uint8_t index, uint8_t flags, node_id_t node_id) |
Listener Query reply received.
| void(* on_reserve_reply) (openlcb_node_t *openlcb_node, uint8_t result) |
Reserve reply received.
| void(* on_heartbeat_request) (openlcb_node_t *openlcb_node, uint32_t timeout_seconds) |
Heartbeat request from train node.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License