##// END OF EJS Templates
some linux bug fixes, added timeouts for read actions
jeandet -
r12:1b7c273d222a alexis
parent child
Show More
@@ -1,7 +1,7
1 1 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
2 2
3 3
4 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -version-info $(RS232_SO_VERSION)
4 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -fPIC -version-info $(RS232_SO_VERSION)
5 5
6 6 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
7 7
@@ -140,6 +140,7 LIPO = @LIPO@
140 140 LN_S = @LN_S@
141 141 LTLIBOBJS = @LTLIBOBJS@
142 142 MAKEINFO = @MAKEINFO@
143 MANIFEST_TOOL = @MANIFEST_TOOL@
143 144 MKDIR_P = @MKDIR_P@
144 145 NM = @NM@
145 146 NMEDIT = @NMEDIT@
@@ -167,6 +168,7 abs_builddir = @abs_builddir@
167 168 abs_srcdir = @abs_srcdir@
168 169 abs_top_builddir = @abs_top_builddir@
169 170 abs_top_srcdir = @abs_top_srcdir@
171 ac_ct_AR = @ac_ct_AR@
170 172 ac_ct_CC = @ac_ct_CC@
171 173 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
172 174 am__include = @am__include@
@@ -199,7 +201,6 libdir = @libdir@
199 201 libexecdir = @libexecdir@
200 202 localedir = @localedir@
201 203 localstatedir = @localstatedir@
202 lt_ECHO = @lt_ECHO@
203 204 mandir = @mandir@
204 205 mkdir_p = @mkdir_p@
205 206 oldincludedir = @oldincludedir@
@@ -216,7 +217,7 top_build_prefix = @top_build_prefix@
216 217 top_builddir = @top_builddir@
217 218 top_srcdir = @top_srcdir@
218 219 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
219 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -version-info $(RS232_SO_VERSION)
220 librs232_@RS232_API_VERSION@_la_LDFLAGS = -no-undefined -fPIC -version-info $(RS232_SO_VERSION)
220 221 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
221 222 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
222 223 librs232_@RS232_API_VERSION@_la_SOURCES = \
@@ -18,6 +18,8 rs232port_t rs232open(char* psPortName)
18 18 {
19 19 rs232port_t fd;
20 20 fd = open(psPortName, O_RDWR | O_NOCTTY | O_NDELAY);
21 fcntl(fd, F_SETFL, 0);
22 //fd = open(psPortName, O_RDWR | O_NOCTTY);
21 23 #ifdef debug
22 24 if(fd==-1)printf("can't open Port\n");
23 25 #endif
@@ -54,7 +56,9 int rs232setup(rs232port_t fd, int ChSiz
54 56 rs232cfparity(fd, &terminos, Parity);
55 57 rs232cfnbstop(fd, &terminos, NbStop);
56 58 rs232cfcsize(fd, &terminos, ChSize);
57
59 terminos.c_cc[VMIN]=0;
60 terminos.c_cc[VTIME]=20;
61 tcflush(fd, TCIFLUSH);
58 62 #ifdef debug
59 63 if(tcsetattr(fd, TCSANOW, &terminos)!=0)printf("bad setup\n");
60 64 #else
General Comments 0
You need to be logged in to leave comments. Login now