wlmaker
|
#include <libbase/libbase.h>
#include <stdbool.h>
#include <stddef.h>
Go to the source code of this file.
Classes | |
struct | wlmtk_fsm_transition_t |
struct | _wlmtk_fsm_t |
Macros | |
#define | WLMTK_FSM_TRANSITION_SENTINEL |
Typedefs | |
typedef struct _wlmtk_fsm_t | wlmtk_fsm_t |
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) |
Variables | |
const bs_test_case_t | wlmtk_fsm_test_cases [] |
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.
#define WLMTK_FSM_TRANSITION_SENTINEL |
Sentinel element for state transition table.
typedef struct _wlmtk_fsm_t wlmtk_fsm_t |
Forward declaration.
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 |
|
extern |
Unit tests for the finite-state machine.