00001 #ifndef __SportIdent__
00002 #define __SportIdent__
00003
00029 enum cards{
00030 SI_PCARD,
00031 SI_TCARD,
00032 SI_ACTIVE,
00033 SI_SIX = 0x06,
00034 SI_SIX_STAR,
00035 SI_EIGHT,
00036 SI_NINE
00037 };
00044 enum st_mode{
00045 SIREAD = 0x01,
00046 SISTART = 0x02,
00047 SIFINISH= 0x04,
00048 SICLEAR = 0x08,
00049 SICONTROL=0x10,
00050 SIAUTO = 0x20,
00051 SIMASTER= 0x40
00052 };
00066 typedef struct si_station_t{
00067 unsigned int fd;
00068 unsigned int code;
00069 unsigned char mode;
00070 unsigned char exten;
00073 unsigned int time;
00074 unsigned int version;
00075 unsigned int battery;
00076 unsigned int backup;
00077 } si_station;
00078
00084 typedef struct si_time_t{
00086 unsigned char dow;
00088 unsigned char tod;
00090 unsigned char week;
00092 unsigned int time12h;
00093 }si_time;
00094
00100 typedef struct si_punch_t{
00101 unsigned int code;
00102 si_time time;
00103 } si_punch;
00104
00111 typedef struct si_card_t{
00112 unsigned int number;
00113 unsigned int type;
00114 unsigned int num_punch;
00115 si_punch* start;
00116 si_punch* finish;
00117 si_punch* clear;
00118 si_punch* check;
00119 si_punch** punches;
00120 unsigned int start_num;
00121 unsigned char* info;
00122 } si_card;
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150 extern int OpenStation(const char*, si_station *);
00151 extern int CloseStation(si_station *);
00152 extern si_station * MakeStation();
00153 extern unsigned int SiCrc(unsigned int, const unsigned char*);
00154 extern int WriteRaw (const si_station *, unsigned char *, int);
00155 extern int ReadRaw (const si_station *, unsigned char *, int);
00156
00157 #endif