##// 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 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
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 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
6 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
7
7
@@ -140,6 +140,7 LIPO = @LIPO@
140 LN_S = @LN_S@
140 LN_S = @LN_S@
141 LTLIBOBJS = @LTLIBOBJS@
141 LTLIBOBJS = @LTLIBOBJS@
142 MAKEINFO = @MAKEINFO@
142 MAKEINFO = @MAKEINFO@
143 MANIFEST_TOOL = @MANIFEST_TOOL@
143 MKDIR_P = @MKDIR_P@
144 MKDIR_P = @MKDIR_P@
144 NM = @NM@
145 NM = @NM@
145 NMEDIT = @NMEDIT@
146 NMEDIT = @NMEDIT@
@@ -167,6 +168,7 abs_builddir = @abs_builddir@
167 abs_srcdir = @abs_srcdir@
168 abs_srcdir = @abs_srcdir@
168 abs_top_builddir = @abs_top_builddir@
169 abs_top_builddir = @abs_top_builddir@
169 abs_top_srcdir = @abs_top_srcdir@
170 abs_top_srcdir = @abs_top_srcdir@
171 ac_ct_AR = @ac_ct_AR@
170 ac_ct_CC = @ac_ct_CC@
172 ac_ct_CC = @ac_ct_CC@
171 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
173 ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
172 am__include = @am__include@
174 am__include = @am__include@
@@ -199,7 +201,6 libdir = @libdir@
199 libexecdir = @libexecdir@
201 libexecdir = @libexecdir@
200 localedir = @localedir@
202 localedir = @localedir@
201 localstatedir = @localstatedir@
203 localstatedir = @localstatedir@
202 lt_ECHO = @lt_ECHO@
203 mandir = @mandir@
204 mandir = @mandir@
204 mkdir_p = @mkdir_p@
205 mkdir_p = @mkdir_p@
205 oldincludedir = @oldincludedir@
206 oldincludedir = @oldincludedir@
@@ -216,7 +217,7 top_build_prefix = @top_build_prefix@
216 top_builddir = @top_builddir@
217 top_builddir = @top_builddir@
217 top_srcdir = @top_srcdir@
218 top_srcdir = @top_srcdir@
218 lib_LTLIBRARIES = librs232-@RS232_API_VERSION@.la
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 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
221 rs232_includedir = $(includedir)/rs232-$(RS232_API_VERSION)
221 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
222 rs232_libincludedir = $(libdir)/rs232-$(RS232_API_VERSION)/include
222 librs232_@RS232_API_VERSION@_la_SOURCES = \
223 librs232_@RS232_API_VERSION@_la_SOURCES = \
@@ -18,6 +18,8 rs232port_t rs232open(char* psPortName)
18 {
18 {
19 rs232port_t fd;
19 rs232port_t fd;
20 fd = open(psPortName, O_RDWR | O_NOCTTY | O_NDELAY);
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 #ifdef debug
23 #ifdef debug
22 if(fd==-1)printf("can't open Port\n");
24 if(fd==-1)printf("can't open Port\n");
23 #endif
25 #endif
@@ -54,7 +56,9 int rs232setup(rs232port_t fd, int ChSiz
54 rs232cfparity(fd, &terminos, Parity);
56 rs232cfparity(fd, &terminos, Parity);
55 rs232cfnbstop(fd, &terminos, NbStop);
57 rs232cfnbstop(fd, &terminos, NbStop);
56 rs232cfcsize(fd, &terminos, ChSize);
58 rs232cfcsize(fd, &terminos, ChSize);
57
59 terminos.c_cc[VMIN]=0;
60 terminos.c_cc[VTIME]=20;
61 tcflush(fd, TCIFLUSH);
58 #ifdef debug
62 #ifdef debug
59 if(tcsetattr(fd, TCSANOW, &terminos)!=0)printf("bad setup\n");
63 if(tcsetattr(fd, TCSANOW, &terminos)!=0)printf("bad setup\n");
60 #else
64 #else
General Comments 0
You need to be logged in to leave comments. Login now