Go to the source code of this file.
Data Structures | |
struct | si_station |
struct for the configuration of a station to fill you need to do More... | |
struct | si_time |
Time record. More... | |
struct | si_punch |
A punching record. More... | |
struct | si_card |
struct representation of a control More... | |
Enumerations | |
enum | cards { SI_PCARD, SI_TCARD, SI_ACTIVE, SI_SIX = 0x06, SI_SIX_STAR, SI_EIGHT, SI_NINE } |
Enum to designate card type P Cards T cards and Active cards have not been given a real designation yet 6, 6*, 8, 9 cards are self explanitory. | |
enum | st_mode { SIREAD = 0x01, SISTART = 0x02, SIFINISH = 0x04, SICLEAR = 0x08, SICONTROL = 0x10, SIAUTO = 0x20, SIMASTER = 0x40 } |
Enum to determine working mode of station SIREAD, SISTART, SIFINISH, SICLEAR, SICONTROL are mutally exclusive and ony one of those bytes should ever be set at once. They should be self explanitory. SIAUTO=1 the station will be in autosend mode SIAUTO=0 then station will be in handshake mode SIMASTER=1 Then anything done will be done directly with the main station. SIMASTER=0 then all communication will be done to the slave device. | |
Functions | |
int | OpenStation (const char *, si_station *) |
A function to open a station connected to a tty device and initilize a si_control struct. | |
int | CloseStation (si_station *) |
A function to close the connection to the station. | |
si_station * | MakeStation () |
A function to malloc and initilize a si_control struct to zero. | |
unsigned int | SiCrc (unsigned int, const unsigned char *) |
A function to return CRC values used by SPORTident. | |
int | WriteRaw (const si_station *, unsigned char *, int) |
This writes to the station the exact data you send it. | |
int | ReadRaw (const si_station *, unsigned char *, int) |
This reads to the station the exact data you send it. |
This Program/Library is open source software; you may redistribute and/or modify it as long as the resulting program/library is under a FOSS license or with the approval of the authors or owning group
This Program is distributed in hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE
This is a file to include with the use of the LibSportIdent. It has all of the external functions and macros needed to it
Definition in file sportident.h.
int CloseStation | ( | si_station * | station | ) |
A function to close the connection to the station.
this just resets the fd to zero and closes the connection to the station. so make sure that you free the station accordingly.
station | the staion to close |
Definition at line 33 of file closestation.c.
si_station* MakeStation | ( | ) |
A function to malloc and initilize a si_control struct to zero.
Be careful you must call MakeStation() on station or you must properly free() it. This makes a control where 0 is set to the deult if all the params are null or zero. othere wise sets specific portion to the struct corialating to it's position
Definition at line 31 of file makestation.c.
int OpenStation | ( | const char * | fd, | |
si_station * | station | |||
) |
A function to open a station connected to a tty device and initilize a si_control struct.
Be careful you must call MakeStation() on station or you must properly malloc() it.
fd | a character string of the fully qualified path | |
station | a pointer to a si_station struct to be saved to or initilized |
add more information to failure cases
implement test to check baud rate and extended mode
populate the rest of station
Definition at line 39 of file openstation.c.
int ReadRaw | ( | const si_station * | station, | |
unsigned char * | buffer, | |||
int | len | |||
) |
This reads to the station the exact data you send it.
this is a wrapper for read.
station | the device to read from | |
buffer | the buffer to be read from device | |
len | length of buffer to read |
unsigned int SiCrc | ( | unsigned int | len, | |
const unsigned char * | data | |||
) |
int WriteRaw | ( | const si_station * | station, | |
unsigned char * | buffer, | |||
int | len | |||
) |
This writes to the station the exact data you send it.
it prepends '0xff 0x02 0x02' and appends the crc and '0x03' must
station | the device to write to | |
buffer | the buffer to be written to device | |
len | length of buffer to write |
Definition at line 36 of file writeraw.c.