Main Page   Alphabetical List   Data Structures   File List   Data Fields   Globals  

di_test.c File Reference

Command-line test app to run the DI-194. More...

#include "di194.h"

Go to the source code of this file.

Data Structures

struct  command_entry_s

Defines

#define CMD_TABLE_SIZE   (sizeof(commands) / sizeof(command_entry_t))

Typedefs

typedef enum commands_e commands_t
typedef command_entry_s command_entry_t

Enumerations

enum  commands_e {
  DI_HELP, DI_START, DI_STOP, DI_READ,
  DI_READ_SINGLE, DI_RESET, DI_PROGRAM, DI_QUIT,
  DI_SERIAL, DI_FLUSH, DI_EMPTY_CMD, DI_INVALID_CMD
}

Functions

int user_loop (const int COMM_FD)
 Main loop - read kbd commands, execute same, loop.

void sighandler (int signal)
 Control-break handler. Sets global flag to indicate exit request.

int main (int argc, char *argv[])
 Driver / test routine to exercise the DI code.


Variables

bool do_exit
command_entry_t commands []


Detailed Description

Command-line test app to run the DI-194.

Author:
Paul Hubbard phubbard@computer.org
Date:
4/12/2002

Definition in file di_test.c.


Define Documentation

#define CMD_TABLE_SIZE   (sizeof(commands) / sizeof(command_entry_t))
 

Definition at line 75 of file di_test.c.

Referenced by user_loop().


Typedef Documentation

typedef struct command_entry_s command_entry_t
 

typedef enum commands_e commands_t
 

Referenced by user_loop().


Enumeration Type Documentation

enum commands_e
 

Enumeration values:
DI_HELP 
DI_START 
DI_STOP 
DI_READ 
DI_READ_SINGLE 
DI_RESET 
DI_PROGRAM 
DI_QUIT 
DI_SERIAL 
DI_FLUSH 
DI_EMPTY_CMD 
DI_INVALID_CMD 

Definition at line 15 of file di_test.c.


Function Documentation

int main int  argc,
char *  argv[]
 

Driver / test routine to exercise the DI code.

Note:
Uses contents of "DI194_PORT" if set
Main. Open the port, init the card, do some daq.

Too: -p port parsing, will need for USB serial. getopt!

Parameters:
argc Argc as passed by shell
argv Argv as passed by shell
Returns:
0 All is good

Non-zero All is not good

Definition at line 337 of file di_test.c.

References di_open(), do_exit, sighandler(), and user_loop().

void sighandler int  signal  ) 
 

Control-break handler. Sets global flag to indicate exit request.

Assumes Installed in interrupt chain by someone else

Parameters:
signal Signal number
Returns:
void No return value
Date:
3/25/02

Definition at line 304 of file di_test.c.

References do_exit.

int user_loop const int  COMM_FD  ) 
 

Main loop - read kbd commands, execute same, loop.

Note:
Code copied from Joe Link's simple-ftp-client.c
Author:
pfh
Date:
4-16-02
Assumes Port opened and ready to go

Definition at line 87 of file di_test.c.

References daq_reading_t::analog, command_entry_s::cmd, CMD_TABLE_SIZE, commands, commands_t, di_close(), di_configure(), di_daq_sync(), DI_EMPTY_CMD, DI_FLUSH, DI_HELP, DI_INVALID_CMD, DI_PROGRAM, DI_QUIT, di_read(), DI_READ, di_read_single(), DI_READ_SINGLE, di_reset(), DI_RESET, DI_SERIAL, di_serial_num(), di_start(), DI_START, di_stop(), DI_STOP, daq_reading_t::digital, do_exit, and SERIAL_NUM_LEN.

Referenced by main().


Variable Documentation

command_entry_t commands[]
 

Definition at line 39 of file di_test.c.

Referenced by user_loop().

bool do_exit
 

Definition at line 13 of file di_test.c.


Generated on Thu May 1 11:31:46 2003 for DI-194 driver by doxygen1.3