Subversion Repositories Programming Utils

Compare Revisions

Ignore whitespace Rev 56 → Rev 57

/trunk/JavaSerial/NativeCode/SerialPortImpl.c
38,9 → 38,9
return -1; \
}
#define SET_SERIAL_PORT_STRUCT( port, io_name ) if( tcsetattr( port, TCSANOW, &io_name ) < 0 ){\
return 0;\
return -1;\
}
#define inline
#endif
 
#include <stdlib.h>
249,7 → 249,7
}
#else
if( parity == 0 ){
newio.c_cflag |= IGNPAR;
newio.c_iflag |= IGNPAR;
}else if( parity == 1 ){
newio.c_cflag |= PARODD;
}else if( parity == 2 ){
287,11 → 287,11
}
#else
if( flow_control == 0 ){
newio.c_cflag &= ~( IXON | IXOFF | IXANY );
newio.c_iflag &= ~( IXON | IXOFF | IXANY );
}else if( flow_control == 1 ){
newio.c_cflag |= HW_FLOW;
}else if( flow_control == 2 ){
newio.c_cflag |= ( IXON | IXOFF | IXANY );
newio.c_iflag |= ( IXON | IXOFF | IXANY );
}
#endif
493,7 → 493,10
 
//Set the baud rate
set_baud_rate( new_port, baudRate );
if( set_baud_rate( new_port, baudRate ) < 0 ){
throw_io_exception_message( env, "Unable to set baud rate" );
return 0;
}
set_raw_input( new_port );
//Set the data bits( character size )
set_data_bits( new_port, dataBits );
689,6 → 692,7
struct port_descriptor* desc;
 
desc = get_port_descriptor( env, obj );
 
if( desc == NULL ){
return 0;
}