Defines | Functions

fsm.c File Reference

#include "fsm.h"
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
Include dependency graph for fsm.c:

Defines

#define E(name)   case EV_##name: return "EV_" #name;

Functions

const char * fsm_common_event_str (fsm_event ev)
int fsm_nop_state (struct robo_fsm *fsm)
 Non operative state, do nothing.
void __fsm_timespec_add_ms (struct timespec *ts, struct timespec *now, long ms)
 Set timespec to some time from now.
void __fsm_timespec_invalidate (struct timespec *ts)
int __fsm_timespec_cmp (struct timespec *ts1, struct timespec *ts2)
void __fsm_timer_stop (struct robo_fsm *fsm)
bool is_there_event_for_us (struct robo_fsm *fsm)
void fsm_main_loop (struct fsm_main_loop *loop)
 FSM main event loop.
void fsm_main_loop_init (struct fsm_main_loop *loop)
 Initializes main loop.
void fsm_init (struct robo_fsm *fsm, char *debug_name, struct fsm_main_loop *loop)
 FSM initialization.
int fsm_start (struct fsm_main_loop *loop, pthread_attr_t *attr)
 Starts previously initialized FSM main loop in a separate thread.
void fsm_exit (struct robo_fsm *fsm)
 Signals FSM to exit.
void fsm_destroy (struct robo_fsm *fsm)
 Deallocates all resources allocated by fsm_init().

Define Documentation

#define E (   name  )     case EV_##name: return "EV_" #name;

Function Documentation

void __fsm_timer_stop ( struct robo_fsm fsm  ) 

Here is the call graph for this function:

void __fsm_timespec_add_ms ( struct timespec *  ts,
struct timespec *  now,
long  ms 
)

Set timespec to some time from now.

Parameters:
[out] ts Result
[in] now Actual time or NULL. If NULL, actual time is determined by calling gettimeofday().
[in] ms number of milliseconds to be set

Here is the caller graph for this function:

int __fsm_timespec_cmp ( struct timespec *  ts1,
struct timespec *  ts2 
) [inline]
void __fsm_timespec_invalidate ( struct timespec *  ts  )  [inline]

Here is the caller graph for this function:

const char* fsm_common_event_str ( fsm_event  ev  ) 
void fsm_main_loop ( struct fsm_main_loop loop  ) 

FSM main event loop.

Dispatches FSM events and calls appropriate state functions.

Parameters:
loop Specifies which FSMs are handled by this main loop.

Here is the caller graph for this function:

void fsm_main_loop_init ( struct fsm_main_loop loop  ) 

Initializes main loop.

Parameters:
loop 

Here is the caller graph for this function:

int fsm_nop_state ( struct robo_fsm fsm  ) 

Non operative state, do nothing.

bool is_there_event_for_us ( struct robo_fsm fsm  ) 

Here is the call graph for this function: