wlmaker
|
Functions | |
void | wlmtk_fsm_init (wlmtk_fsm_t *fsm_ptr, const wlmtk_fsm_transition_t *transitions, int initial_state) |
bool | wlmtk_fsm_event (wlmtk_fsm_t *fsm_ptr, int event, void *ud_ptr) |
static void | test_event (bs_test_t *test_ptr) |
static bool | test_fsm_handler (wlmtk_fsm_t *fsm_ptr, void *ud_ptr) |
Variables | |
const bs_test_case_t | wlmtk_fsm_test_cases [] |
static const wlmtk_fsm_transition_t | test_transitions [] |
Event-driven finite state machine.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
|
static |
Tests FSM.
|
static |
Test handler for the FSM unit test: Sets the bool to true.
bool wlmtk_fsm_event | ( | wlmtk_fsm_t * | fsm_ptr, |
int | event, | ||
void * | ud_ptr | ||
) |
Handles an event for the finite-state machine.
Will search for the transition matching (current state, event) and call the associate handler.
fsm_ptr | |
event | |
ud_ptr |
void wlmtk_fsm_init | ( | wlmtk_fsm_t * | fsm_ptr, |
const wlmtk_fsm_transition_t * | transitions, | ||
int | initial_state | ||
) |
Initializes the finite-state machine.
fsm_ptr | |
transitions | |
initial_state |
|
static |
Test transition table for the FSM unit test.
const bs_test_case_t wlmtk_fsm_test_cases[] |
Unit tests for the finite-state machine.