HERMES Modem
Hermes ARQ/Broadcast modem
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Functions | Variables
fsm.h File Reference
#include <pthread.h>
Include dependency graph for fsm.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fsm_handle
 Thread-safe finite-state machine wrapper. More...
 

Macros

#define EV_CLIENT_CONNECT   0
 
#define EV_CLIENT_DISCONNECT   1
 
#define EV_START_LISTEN   2
 
#define EV_STOP_LISTEN   3
 
#define EV_LINK_CALL_REMOTE   4
 
#define EV_LINK_INCOMING_CALL   5
 
#define EV_LINK_DISCONNECT   6
 
#define EV_LINK_ESTABLISHMENT_TIMEOUT   7
 
#define EV_LINK_ESTABLISHED   8
 

Typedefs

typedef void(* fsm_state) (int event)
 State-handler function signature used by FSM dispatcher.
 

Functions

void fsm_init (fsm_handle *fsm, fsm_state initial_state)
 Initialize FSM instance.
 
void fsm_dispatch (fsm_handle *fsm, int event)
 Dispatch an event into current FSM state.
 
void fsm_destroy (fsm_handle *fsm)
 Destroy FSM synchronization resources.
 

Variables

const char * fsm_event_names []
 

Macro Definition Documentation

◆ EV_CLIENT_CONNECT

#define EV_CLIENT_CONNECT   0

◆ EV_CLIENT_DISCONNECT

#define EV_CLIENT_DISCONNECT   1

◆ EV_LINK_CALL_REMOTE

#define EV_LINK_CALL_REMOTE   4

◆ EV_LINK_DISCONNECT

#define EV_LINK_DISCONNECT   6

◆ EV_LINK_ESTABLISHED

#define EV_LINK_ESTABLISHED   8

◆ EV_LINK_ESTABLISHMENT_TIMEOUT

#define EV_LINK_ESTABLISHMENT_TIMEOUT   7

◆ EV_LINK_INCOMING_CALL

#define EV_LINK_INCOMING_CALL   5

◆ EV_START_LISTEN

#define EV_START_LISTEN   2

◆ EV_STOP_LISTEN

#define EV_STOP_LISTEN   3

Typedef Documentation

◆ fsm_state

typedef void(* fsm_state) (int event)

State-handler function signature used by FSM dispatcher.

Function Documentation

◆ fsm_destroy()

void fsm_destroy ( fsm_handle fsm)

Destroy FSM synchronization resources.

Parameters
fsmFSM handle.

◆ fsm_dispatch()

void fsm_dispatch ( fsm_handle fsm,
int  event 
)

Dispatch an event into current FSM state.

Parameters
fsmFSM handle.
eventEvent identifier.

◆ fsm_init()

void fsm_init ( fsm_handle fsm,
fsm_state  initial_state 
)

Initialize FSM instance.

Parameters
fsmFSM handle.
initial_stateInitial state callback.

Variable Documentation

◆ fsm_event_names

const char* fsm_event_names[]
extern