OpenLcbCLib 1.0 Alpha
OpenSource C Library to create OpenLcb/Lcc Nodes
Loading...
Searching...
No Matches
can_login_statemachine.c File Reference

Implementation of the CAN login state machine dispatcher. More...

Functions

void CanLoginStateMachine_initialize (const interface_can_login_state_machine_t *interface_can_login_state_machine)
 Stores the dependency-injection interface pointer.
 
void CanLoginStateMachine_run (can_statemachine_info_t *can_statemachine_info)
 Dispatches to the appropriate login state handler based on the node's run_state.
 

Detailed Description

Implementation of the CAN login state machine dispatcher.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

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.

Maps the node's current run_state to the corresponding login handler function pointer from the dependency-injected interface. Executes exactly one state handler per call and returns so the main loop can continue processing other nodes and tasks.

Author
Jim Kueneman
Date
4 Mar 2026

Function Documentation

◆ CanLoginStateMachine_initialize()

void CanLoginStateMachine_initialize ( const interface_can_login_state_machine_t * interface_can_login_state_machine)

Stores the dependency-injection interface pointer.

Registers the dependency-injection interface for this module.

◆ CanLoginStateMachine_run()

void CanLoginStateMachine_run ( can_statemachine_info_t * can_statemachine_info)

Dispatches to the appropriate login state handler based on the node's run_state.

Dispatches to the handler for the node's current run_state.

* @param can_statemachine_info State machine context (node + login frame buffer).
* 

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