|
OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
|
Non-blocking login state machine for node initialization. More...
Go to the source code of this file.
Data Structures | |
| struct | interface_openlcb_login_state_machine_t |
| Callback interface for the login state machine. All pointers are REQUIRED unless noted. Internal function pointers are exposed for unit testing. More... | |
Functions | |
| void | OpenLcbLoginStateMachine_initialize (const interface_openlcb_login_state_machine_t *interface_openlcb_login_state_machine) |
| Stores the callback interface. Call once at startup after OpenLcbLoginMessageHandler_initialize(). | |
| void | OpenLcbLoginMainStatemachine_run (void) |
| Runs one non-blocking step of login processing. Call from main loop. | |
| void | OpenLcbLoginStateMachine_process (openlcb_login_statemachine_info_t *openlcb_statemachine_info) |
| Dispatches to the handler matching node->run_state. Exposed for unit testing. | |
| bool | OpenLcbLoginStatemachine_handle_outgoing_openlcb_message (void) |
| Tries to send the pending message; returns true if one was pending. Exposed for unit testing. | |
| bool | OpenLcbLoginStatemachine_handle_try_reenumerate (void) |
| Re-enters the state processor if the enumerate flag is set. Exposed for unit testing. | |
| bool | OpenLcbLoginStatemachine_handle_try_enumerate_first_node (void) |
| Starts enumeration from the first node if none is active. Exposed for unit testing. | |
| bool | OpenLcbLoginStatemachine_handle_try_enumerate_next_node (void) |
| Advances to the next node needing login. Exposed for unit testing. | |
| openlcb_login_statemachine_info_t * | OpenLcbLoginStatemachine_get_statemachine_info (void) |
| Returns pointer to internal static state machine info. For unit testing only — do not modify. | |
Non-blocking login state machine for node initialization.
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.
Walks each node through Initialization Complete, Producer Identified, Consumer Identified, and on_login_complete before entering RUNSTATE_RUN. Uses a polling architecture called repeatedly from the main loop; each call performs one atomic operation and returns immediately.
|
extern |
Stores the callback interface. Call once at startup after OpenLcbLoginMessageHandler_initialize().
| interface_openlcb_login_state_machine | Must remain valid for application lifetime. |
Stores the callback interface. Call once at startup after OpenLcbLoginMessageHandler_initialize().
Algorithm:
* @param interface_openlcb_login_state_machine Pointer to interface structure *
|
extern |
Runs one non-blocking step of login processing. Call from main loop.
Tries to send a pending message, re-enumerate if flagged, or advance to the next node needing login. Nodes already in RUNSTATE_RUN are skipped.
Algorithm:
|
extern |
Dispatches to the handler matching node->run_state. Exposed for unit testing.
| openlcb_statemachine_info | Pointer to openlcb_login_statemachine_info_t context. |
Dispatches to the handler matching node->run_state. Exposed for unit testing.
Algorithm:
* @param openlcb_statemachine_info Pointer to state machine info with node and message buffer *
|
extern |
Tries to send the pending message; returns true if one was pending. Exposed for unit testing.
Tries to send the pending message; returns true if one was pending. Exposed for unit testing.
Algorithm:
|
extern |
Re-enters the state processor if the enumerate flag is set. Exposed for unit testing.
Re-enters the state processor if the enumerate flag is set. Exposed for unit testing.
Algorithm:
|
extern |
Starts enumeration from the first node if none is active. Exposed for unit testing.
Starts enumeration from the first node if none is active. Exposed for unit testing.
Algorithm:
|
extern |
Advances to the next node needing login. Exposed for unit testing.
Advances to the next node needing login. Exposed for unit testing.
Algorithm:
|
extern |
Returns pointer to internal static state machine info. For unit testing only — do not modify.
Returns pointer to internal static state machine info. For unit testing only — do not modify.
Copyright (c) 2026 Jim Kueneman all rights reserved. See the License