Removed svn keywords from comments.
[quicksms.git] / serial / serialdefs.h
blobe428c50fc48af17b019657a902b6e71153a27ccc
1 /***************************************************************************//**
2 * Project Name : quicksms
4 * \file serialdefs.h this file contains some enums used by CSerialPort.
5 * \package quicksms
6 ******************************************************************************/
7 #ifndef SERIALDEFS_H
8 #define SERIALDEFS_H
10 namespace serial
13 /*********************************************************************//**
14 * \brief parity.
16 * Use it to select correct port parity checking.
17 ***********************************************************************/
19 enum Parity
21 PAR_NONE, ///< no parity checking
22 PAR_EVEN, ///< 'even' parity checking
23 PAR_ODD ///< 'odd' parity checking
24 };//Parity
26 enum Baudrate
28 BAUD_DEFAULT
33 /*********************************************************************//**
34 * \brief flow control.
36 * Used to select port flow control
38 ************************************************************************/
39 enum FlowControl
41 FLOW_NONE, ///< no flow control
42 FLOW_SOFTWARE, ///< XON/XOFF flow control
43 FLOW_HARDWARE ///< hardware flow control
44 };//FlowControl
46 /*********************************************************************//**
47 * \brief port status.
49 * this enum is used to indicate port state. Constant names are
50 * self-explainable.
51 ************************************************************************/
52 enum Status
54 STAT_OK, ///< everything's correct
55 STAT_BUSY, ///< an r/w operation is in progress
56 STAT_IO_ERROR, ///< I/O error occured
57 STAT_FILE_ALREADY_OPEN, ///< port is already open, maybe by another app, or you called open() twice?
58 STAT_FILE_NOT_FOUND, ///< port name / path is incorrect.
59 STAT_TIMEOUT, ///< a read / write / open timeout occured
60 STAT_UNKNOWN ///< port uninitalized or in unknown state
61 };//Status
64 /*********************************************************************//**
65 * \brief pointer to read callback function
66 * \param[in] pSize how many bytes are available?
67 * \param[in,out] pBuffer this points to recieved data
69 * if callback function is non-zero, then we can use it
70 * to immediately process incoming data as soon as it becomes available
72 ************************************************************************/
73 typedef int (*ReadCallback)(void* pBuffer, int &pSize);
75 };//serial
77 #endif //SERIALDEFS_H