PageRenderTime 32ms CodeModel.GetById 16ms app.highlight 9ms RepoModel.GetById 2ms app.codeStats 0ms

/elekIOServ/elekIOServ.h

http://github.com/Yniold/liftsrc
C Header | 102 lines | 37 code | 23 blank | 42 comment | 0 complexity | dc2a22137e9ed64f95f5307fd3588b92 MD5 | raw file
  1// ============================================
  2// elekIOServ.h
  3// Headerfile
  4// ============================================
  5
  6// $RCSfile: elekIOServ.h,v $ last changed on $Date: 2006/09/04 10:47:22 $ by $Author: rudolf $
  7
  8// History:
  9//
 10// $Log: elekIOServ.h,v $
 11// Revision 1.14  2006/09/04 10:47:22  rudolf
 12// fixed compiler warning for GCC 4.03
 13//
 14// Revision 1.13  2005/12/14 13:53:27  rudolf
 15// GABRIEL campaign changes
 16//
 17// Revision 1.12  2005/09/21 21:02:48  rudolf
 18// fixed Latitude and Longitude parsing, changed tty to S1
 19//
 20// Revision 1.11  2005/06/27 10:12:42  rudolf
 21// changed TimerStates numbering (HH), fixed bug
 22//
 23// Revision 1.10  2005/06/26 13:02:17  rudolf
 24// added time limit for answer from slave
 25//
 26// Revision 1.9  2005/06/08 17:31:51  rudolf
 27// prepared sockets for sending the data structure between master and slave
 28//
 29// Revision 1.8  2005/05/22 15:02:43  rudolf
 30// changed BaudRate and ttyX, changed debug output if commands are sent via eCmd
 31//
 32// Revision 1.7  2005/04/21 15:59:21  rudolf
 33// fixed stupid typo
 34//
 35// Revision 1.6  2005/04/21 15:51:52  rudolf
 36// fix for ARM version
 37//
 38// Revision 1.5  2005/01/31 09:49:31  rudolf
 39// more work on GPS
 40//
 41
 42#ifdef RUNONPC
 43#define SIGNAL_STATUS SIGRTMAX
 44#else
 45#define SIGNAL_STATUS SIGALRM
 46#endif
 47
 48
 49#define MAX_AGE_SLAVE_STATUS 0.06  // time that a status package is valid after init req.
 50#define MAX_TASKS_TO_WAKE 10
 51
 52enum TimerSignalStateEnum {   // states of signal timer
 53  
 54  TIMER_SIGNAL_STATE_INITIAL=-1,    // wait for signal to occur
 55  TIMER_SIGNAL_STATE_GATHER,     // wake up and gather data
 56  TIMER_SIGNAL_STATE_REQ,        // request data from slave and instruments
 57
 58  TIMER_SIGNAL_STATE_MAX
 59  
 60};
 61
 62
 63typedef unsigned char BOOL;
 64struct TaskListType {
 65  char TaskName[MAX_PORT_NAME_LEN];
 66  int TaskConn;
 67  int TaskWantStatusOnPort;         
 68}; /* TaskListType */
 69
 70struct SyncFlagType {
 71	BOOL MaskChange;
 72};  /*SyncFlagType */
 73
 74
 75
 76#define MAXSLAVES 3
 77/* struct to keep a list of slaves */
 78struct SlaveListType {
 79  char *SlaveName;                /* name for debug messages */  
 80  char *SlaveIP;                  /* IP Address */
 81};
 82
 83
 84
 85// ========================
 86// Globals for GPS
 87// ========================
 88
 89char port[256] = "/dev/ttyS1";   // serial device used for the incoming GPS data
 90unsigned char pDataBuffer[1024];
 91
 92char aProgramName[] = "GPS";              // needed for serial.c 's debug output
 93char *progname = (char *) aProgramName;   // export pointer to debug string
 94
 95int verbose = 255;                        // be very verbose
 96long baud = 4800;                         // serial baudrate
 97long baudmaster= 38400;                   // baudrate master
 98volatile char ucDataReadyFlag = 0;        // Data ready flag
 99int fdGPS = -1;                           // file descriptor for serial communication
100char ucPortOpened = 0;                    // flag for the timer routine wether port is available or not
101
102