@@ -1,5 +1,6 | |||
|
1 | 1 | // SOPSUYSI_RS232.h |
|
2 | ||
|
2 | #ifndef RS232_H | |
|
3 | #define RS232_H | |
|
3 | 4 | #define debug |
|
4 | 5 | |
|
5 | 6 | #include "rs232config.h" |
@@ -18,7 +19,7 | |||
|
18 | 19 | typedef int rs232port_t; |
|
19 | 20 | typedef speed_t rs232speed_t; |
|
20 | 21 | typedef enum {rs232OneStop=1,rs232One5Stop=2,rs232TwoStop=2}rs232stop; |
|
21 |
typedef enum {rs232parityNo |
|
|
22 | typedef enum {rs232parityNo,rs232parityOdd,rs232parityEven}rs232parity; | |
|
22 | 23 | #endif |
|
23 | 24 | #endif |
|
24 | 25 | #ifdef __cplusplus |
@@ -35,3 +36,8 rs232extern int rs232setparity(rs232port | |||
|
35 | 36 | rs232extern int rs232setnbstop(rs232port_t fd, rs232stop NbStop); |
|
36 | 37 | rs232extern int rs232setcsize(rs232port_t fd, int ChSize); |
|
37 | 38 | rs232extern int rs232setbaudrate(rs232port_t fd, int baudrate); |
|
39 | ||
|
40 | #endif | |
|
41 | ||
|
42 | ||
|
43 |
@@ -98,15 +98,15 int rs232setparity(rs232port_t fd, rs232 | |||
|
98 | 98 | switch(Parity) |
|
99 | 99 | { |
|
100 | 100 | case rs232parityNo: |
|
101 |
terminos.c_cflag &= |
|
|
101 | terminos.c_cflag &= ~PARENB; | |
|
102 | 102 | break; |
|
103 | 103 | case rs232parityOdd: |
|
104 |
terminos.c_cflag |
|
|
105 |
terminos.c_cflag |= P |
|
|
104 | terminos.c_cflag |= PARENB; | |
|
105 | terminos.c_cflag |= PARODD; | |
|
106 | 106 | break; |
|
107 | 107 | case rs232parityEven: |
|
108 |
terminos.c_cflag |
|
|
109 |
terminos.c_cflag |
|
|
108 | terminos.c_cflag |= PARENB; | |
|
109 | terminos.c_cflag &= ~PARODD; | |
|
110 | 110 | break; |
|
111 | 111 | default: |
|
112 | 112 | terminos.c_cflag &= ~PARENB; |
|
1 | NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now