Public Attributes

robo_fsm Struct Reference
[Finite State Machines]

Structure describing FSM. More...

#include <fsm.h>

Collaboration diagram for robo_fsm:
Collaboration graph
[legend]

List of all members.

Public Attributes

struct robo_fsmnext
struct fsm_main_looploop
 Main loop, which dispatches events for this FSM.
unsigned flags
pthread_mutex_t send_mutex
struct fsm_event events [FSM_EVENT_QUEUE_LEN]
 Ring-buffer for incomming events.
unsigned ev_head
 Index in the events of the next event to be processed.
unsigned ev_tail
 Index in the events where to put events for this message.
struct timespec timer
 Time of next timer expiration.
robo_fsm_state_t state
 Pointer to current state function.
const char * state_name
 Name of the current state.
robo_fsm_state_t last_state
 Pointer to previous state function.
const char * last_state_name
 Stack of sub-automaton states for use by FCALL() and SUBFSM_TRANSITION().
robo_fsm_state_t fnc_stack [10]
robo_fsm_state_tfnc_sp
 Pointer to the top of fnc_stack.
int debug_states
 Whether to print debug messages on state transitions.
char * debug_name
 The name of automaton (printed in debug messages).
void(* transition_callback )(struct robo_fsm *fsm)
 Pointer to transition callback function.

Detailed Description

Structure describing FSM.


Member Data Documentation

The name of automaton (printed in debug messages).

Whether to print debug messages on state transitions.

Index in the events of the next event to be processed.

Index in the events where to put events for this message.

Protected by send_mutex

struct fsm_event robo_fsm::events[FSM_EVENT_QUEUE_LEN]

Ring-buffer for incomming events.

unsigned robo_fsm::flags

Pointer to the top of fnc_stack.

Pointer to previous state function.

Stack of sub-automaton states for use by FCALL() and SUBFSM_TRANSITION().

Name of the last state

Main loop, which dispatches events for this FSM.

pthread_mutex_t robo_fsm::send_mutex

Pointer to current state function.

This function is called when an event occurs.

const char* robo_fsm::state_name

Name of the current state.

struct timespec robo_fsm::timer

Time of next timer expiration.

Pointer to transition callback function.

This function is called whenever fsm changes state. This callback can be used to track/debug the state of FSM. fsm->state_name will contain the name of current state, fsm->last_state_name the name of last state.


The documentation for this struct was generated from the following file: