| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#include <string.h> |
| 22 |
|
| 23 |
typedef struct _COMPORT *COMPORT; |
| 24 |
|
| 25 |
bool SERIAL_open(const char* portname, COMPORT* port); |
| 26 |
void SERIAL_close(COMPORT port); |
| 27 |
void SERIAL_getErrorString(char* buffer, size_t length); |
| 28 |
|
| 29 |
#define SERIAL_1STOP 1 |
| 30 |
#define SERIAL_2STOP 2 |
| 31 |
#define SERIAL_15STOP 0 |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
bool SERIAL_setCommParameters(COMPORT port, |
| 36 |
int baudrate, char parity, int stopbits, int length); |
| 37 |
|
| 38 |
void SERIAL_setDTR(COMPORT port, bool value); |
| 39 |
void SERIAL_setRTS(COMPORT port, bool value); |
| 40 |
void SERIAL_setBREAK(COMPORT port, bool value); |
| 41 |
|
| 42 |
#define SERIAL_CTS 0x10 |
| 43 |
#define SERIAL_DSR 0x20 |
| 44 |
#define SERIAL_RI 0x40 |
| 45 |
#define SERIAL_CD 0x80 |
| 46 |
|
| 47 |
int SERIAL_getmodemstatus(COMPORT port); |
| 48 |
bool SERIAL_setmodemcontrol(COMPORT port, int flags); |
| 49 |
|
| 50 |
bool SERIAL_sendchar(COMPORT port, char data); |
| 51 |
|
| 52 |
|
| 53 |
#define SERIAL_BREAK_ERR 0x10 |
| 54 |
#define SERIAL_FRAMING_ERR 0x08 |
| 55 |
#define SERIAL_PARITY_ERR 0x04 |
| 56 |
#define SERIAL_OVERRUN_ERR 0x02 |
| 57 |
|
| 58 |
int SERIAL_getextchar(COMPORT port); |