kb_lrftest.c File Reference

This module provides useful basic examples to interface with the LedRangeFinder library for korebot. More...

Include dependency graph for kb_lrftest.c:

Go to the source code of this file.

Defines

#define MAX_TIMEOUT_IN_MS   500
#define MAX_DATA_BYTES   246
#define PXA_INT0   8
#define OUT   0
#define device   "/dev/tts/2"

Functions

void clrscr (void)
void initTime (struct timeval *timestruct)
unsigned long deltaTime (struct timeval *timeS1)
int gpioinit (int argc, char *argv[], void *data)
int lrfon (int argc, char *argv[], void *data)
int lrfoff (int argc, char *argv[], void *data)
int setsn (int argc, char *argv[], void *data)
int zeroCnt (int argc, char *argv[], void *data)
char * lrfheader ()
int setfile (int argc, char *argv[], void *data)
int lrfinit (int argc, char *argv[], void *data)
int lrfmeasure (int argc, char *argv[], void *data)
int quit (int argc, char *argv[], void *data)
int emergencystop (int argc, char *argv[], void *data)
int help (int argc, char *argv[], void *data)
int main (int argc, char *argv[])

Variables

static int quitReq = 0
static int lrfHandle = 0x1234
static int gpioOKE = 0
static int lrfOKE = 0
static int snOKE = 0
static int measCnt = 0
static char * LRF_SN
static char * KBA_SN
static FILE * outfile
unsigned short DataDist [121]
fd_set fd_set1
static kb_command_t cmds []
static char buf [1024]


Detailed Description

This module provides useful basic examples to interface with the LedRangeFinder library for korebot.

simple led range finder test executable

Author:
Arnaud Maye (K-Team SA)
Note:
Copyright (C) 2005 K-TEAM SA
Bug:
none discovered.
Todo:

Definition in file kb_lrftest.c.


Define Documentation

#define device   "/dev/tts/2"

Definition at line 42 of file kb_lrftest.c.

#define MAX_DATA_BYTES   246

Definition at line 36 of file kb_lrftest.c.

#define MAX_TIMEOUT_IN_MS   500

Definition at line 35 of file kb_lrftest.c.

#define OUT   0

Definition at line 40 of file kb_lrftest.c.

#define PXA_INT0   8

Definition at line 39 of file kb_lrftest.c.


Function Documentation

void clrscr ( void   ) 

"clear" the console screen

Definition at line 48 of file kb_lrftest.c.

Referenced by lrfmeasure(), and main().

unsigned long deltaTime ( struct timeval *  timeS1  ) 

Definition at line 61 of file kb_lrftest.c.

int emergencystop ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 328 of file kb_lrftest.c.

References gpioinit(), and lrfoff().

Here is the call graph for this function:

int gpioinit ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 74 of file kb_lrftest.c.

References gpioOKE, kb_gpio_dir(), kb_gpio_function(), kb_gpio_init(), kb_init(), OUT, and PXA_INT0.

Referenced by emergencystop(), and lrfmeasure().

Here is the call graph for this function:

int help ( int  argc,
char *  argv[],
void *  data 
)

Display a list of available commands.

Definition at line 453 of file koala_GoAutomation.c.

void initTime ( struct timeval *  timestruct  ) 

Definition at line 56 of file kb_lrftest.c.

char* lrfheader (  ) 

Definition at line 161 of file kb_lrftest.c.

References KBA_SN, LRF_SN, and outfile.

Referenced by lrfmeasure().

int lrfinit ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 224 of file kb_lrftest.c.

References device, kb_lrf_Init(), and lrfHandle.

Here is the call graph for this function:

int lrfmeasure ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 230 of file kb_lrftest.c.

References clrscr(), device, gpioinit(), kb_lrf_DistanceData, kb_lrf_GetDistances(), kb_lrf_Init(), lrfHandle, lrfheader(), lrfoff(), measCnt, and outfile.

Here is the call graph for this function:

int lrfoff ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 118 of file kb_lrftest.c.

References gpioOKE, and kb_lrf_pwrOff().

Referenced by emergencystop(), and lrfmeasure().

Here is the call graph for this function:

int lrfon ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 101 of file kb_lrftest.c.

References gpioOKE, and kb_lrf_pwrOn().

Here is the call graph for this function:

int main ( int  argc,
char *  argv[] 
)

Definition at line 378 of file kb_lrftest.c.

References clrscr(), kb_init(), kb_parse_command(), kb_set_debug_level(), KBA_SN, LRF_SN, and quitReq.

Here is the call graph for this function:

int quit ( int  argc,
char *  argv[],
void *  data 
)

Quit the program.

Definition at line 323 of file kb_lrftest.c.

References quitReq.

int setfile ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 209 of file kb_lrftest.c.

References outfile.

int setsn ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 132 of file kb_lrftest.c.

References KBA_SN, LRF_SN, and snOKE.

int zeroCnt ( int  argc,
char *  argv[],
void *  data 
)

Definition at line 154 of file kb_lrftest.c.

References measCnt.


Variable Documentation

char buf[1024] [static]

Main program to process the command line.

Definition at line 376 of file kb_lrftest.c.

kb_command_t cmds[] [static]

Initial value:

 {
  { "quit"            , 0 , 0 , quit } ,
  { "exit"            , 0 , 0 , quit } ,
  { "bye"             , 0 , 0 , quit } ,
  { "emstop"          , 0,  0 , emergencystop },
  { "zeromeasure"     , 0 , 0 , zeroCnt },
  { "setserialnum"    , 2 , 2 , setsn },
  { "setfile"         , 1 , 1 , setfile },
  { "gpioinit"        , 0 , 0 , gpioinit },
  { "lrfinit"        , 0 , 0 , lrfinit },
  { "lrfon"           , 0 , 0 , lrfon },
  { "lrfoff"          , 0 , 0 , lrfoff },
  { "lrfmeasure"      , 0 , 1 , lrfmeasure },
  { "help"            , 0 , 0 , help } ,
  { NULL              , 0 , 0 , NULL }
}
The command table contains: command name : min number of args : max number of args : the function to call

Definition at line 341 of file kb_lrftest.c.

unsigned short DataDist[121]

Definition at line 30 of file kb_lrftest.c.

fd_set fd_set1

Definition at line 32 of file kb_lrftest.c.

Referenced by kb_lrf_FlushSerPort(), and kb_lrf_SendCommand().

int gpioOKE = 0 [static]

Definition at line 22 of file kb_lrftest.c.

Referenced by gpioinit(), lrfoff(), and lrfon().

char* KBA_SN [static]

Definition at line 27 of file kb_lrftest.c.

Referenced by lrfheader(), main(), and setsn().

char* LRF_SN [static]

Definition at line 26 of file kb_lrftest.c.

Referenced by lrfheader(), main(), and setsn().

int lrfHandle = 0x1234 [static]

Definition at line 21 of file kb_lrftest.c.

Referenced by lrfinit(), and lrfmeasure().

int lrfOKE = 0 [static]

Definition at line 23 of file kb_lrftest.c.

int measCnt = 0 [static]

Definition at line 25 of file kb_lrftest.c.

Referenced by lrfmeasure(), and zeroCnt().

FILE* outfile [static]

Definition at line 28 of file kb_lrftest.c.

Referenced by lrfheader(), lrfmeasure(), and setfile().

int quitReq = 0 [static]

Definition at line 20 of file kb_lrftest.c.

int snOKE = 0 [static]

Definition at line 24 of file kb_lrftest.c.

Referenced by setsn().


Generated on Wed Dec 15 11:49:28 2010 for KoreBot Library by  doxygen 1.5.5