Please enable JavaScript to use RhodeCode Enterprise
##// END OF EJS Templates
jeandet@PC-DE-JEANDET.lab-lpp.local
- Fri, 23 Mar 2012 08:59:31
Show More
0
src/RS232.h
src/RS232.h
+1
-1
@@
-7,7
+7,7
7
#define rs232noerr 0
7
#define rs232noerr 0
8
typedef int rs232port_t ;
8
typedef int rs232port_t ;
9
typedef int rs232speed_t ;
9
typedef int rs232speed_t ;
10
typedef enum { rs232OneStop =1, rs232One5Stop =2, rs232TwoStop =2} rs232stop ;
10
typedef enum { rs232OneStop , rs232One5Stop , rs232TwoStop } rs232stop ;
11
typedef enum { rs232parityNo , rs232parityOdd , rs232parityEven } rs232parity ;
11
typedef enum { rs232parityNo , rs232parityOdd , rs232parityEven } rs232parity ;
12
12
13
13
0
src/RS232_unix.c
src/RS232_unix.c
+9
-3
@@
-134,12
+134,18
int rs232setnbstop(rs232port_t fd, rs232
134
tcgetattr (( int ) fd , & terminos );
134
tcgetattr (( int ) fd , & terminos );
135
switch ( NbStop )
135
switch ( NbStop )
136
{
136
{
137
case 2 :
137
case rs 232OneStop :
138
terminos . c_cflag &= ~ CSTOPB ;
139
break ;
140
case rs232One5Stop :
138
terminos . c_cflag |= CSTOPB ;
141
terminos . c_cflag |= CSTOPB ;
139
break ;
142
break ;
143
case rs232TwoStop :
144
terminos . c_cflag |= CSTOPB ;
145
break ;
140
default :
146
default :
141
terminos . c_cflag &= ~ CSTOPB ;
147
terminos . c_cflag &= ~ CSTOPB ;
142
break ;
148
break ;
143
}
149
}
144
tcsetattr (( int ) fd , TCSANOW , & terminos );
150
tcsetattr (( int ) fd , TCSANOW , & terminos );
145
return 0 ;
151
return 0 ;
0
src/RS232_win.c
src/RS232_win.c
+2
-2
@@
-45,7
+45,7
int privatedecodestop(rs232stop NbStop)
45
case rs232TwoStop :
45
case rs232TwoStop :
46
return TWOSTOPBITS ;
46
return TWOSTOPBITS ;
47
break ;
47
break ;
48
default ;
48
default :
49
return ONESTOPBIT ;
49
return ONESTOPBIT ;
50
break ;
50
break ;
51
}
51
}
@@
-101,7
+101,7
rs232port_t rs232open(char* psPortName)
101
rs232port_t fd ;
101
rs232port_t fd ;
102
fd = ( rs232port_t ) CreateFile ( psPortName , GENERIC_READ | GENERIC_WRITE , 0 , 0 , OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , 0 );
102
fd = ( rs232port_t ) CreateFile ( psPortName , GENERIC_READ | GENERIC_WRITE , 0 , 0 , OPEN_EXISTING , FILE_ATTRIBUTE_NORMAL , 0 );
103
#ifdef debug
103
#ifdef debug
104
if ( fd == INVALID_HANDLE_VALUE )
104
if ( fd == ( rs232port_t ) INVALID_HANDLE_VALUE )
105
{
105
{
106
printf ( "can't open Port \n " );
106
printf ( "can't open Port \n " );
107
return ( rs232port_t ) badPortValue ;
107
return ( rs232port_t ) badPortValue ;
Site-wide shortcuts
/
Use quick search box
g h
Goto home page
g g
Goto my private gists page
g G
Goto my public gists page
g 0-9
Goto bookmarked items from 0-9
n r
New repository page
n g
New gist page
Repositories
g s
Goto summary page
g c
Goto changelog page
g f
Goto files page
g F
Goto files page with file search activated
g p
Goto pull requests page
g o
Goto repository settings
g O
Goto repository access permissions settings
t s
Toggle sidebar on some pages