fsm.c File Reference

Author:
Tran Duy Khanh, Michal Sojka
More...

#include "fsm.h"
#include <stdio.h>

Include dependency graph for fsm.c:

Go to the source code of this file.

Defines

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

Functions

const char * fsm_common_event_str (enum fsm_common_events ev)
int fsm_nop_state (struct robo_fsm *fsm)
 Non operative state, do nothing.
static void gettimeofday_ts (struct timespec *ts)
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)
static int timespec_valid (struct timespec *ts)
static int timespec_cmp (struct timespec *ts1, struct timespec *ts2)
static fsm_event sem_wait_checked (struct robo_fsm *fsm)
static fsm_event sem_timedwait_checked (sem_t *sem, struct timespec *abs_timeout, struct robo_fsm *fsm, enum fsm_common_events timeout_event)
static fsm_event wait_for_event (struct robo_fsm *fsm)
static void handle_event (struct robo_fsm *fsm, fsm_event event)
static void * fsm_thread_routine (void *arg)
 FSM thread function.
void fsm_init (struct robo_fsm *fsm, char *debug_name)
 FSM initialization.
int fsm_start (struct robo_fsm *fsm, pthread_attr_t *attr)
 Starts previously initialized FSM.
int fsm_destroy (struct robo_fsm *fsm)
 Deallocates all resources allocated by fsm_init().


Detailed Description

Author:
Tran Duy Khanh, Michal Sojka

Date:
07/04/17
Finite state machine of the robot.

Definition in file fsm.c.


Function Documentation

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

Definition at line 55 of file fsm.c.


Generated on Thu Sep 13 11:28:29 2007 for DCE-Eurobot by  doxygen 1.5.3