Board index » kylix » How to control Serial Port RTS

How to control Serial Port RTS


2005-02-22 08:17:45 AM
kylix0
I use Kylix C++ 3.0.
I can't control RTS,Someone can tell me something wrong.
thanks a lot.
char SendData[7]={ 2,0,1,65,0,0,68 };
int fp;
struct termios oldtio,newtio;
if((fp=open("/dev/ttyS0",O_RDWR|O_NOCTTY))!=-1)
{
tcgetattr(fp,&oldtio);
bzero(&newtio, sizeof(newtio));
newtio.c_cflag=B19200 | CRTSCTS | CS8 | CLOCAL | CREAD;
tcflush(fp,TCIFLUSH);
tcsetattr(fp,TCSANOW,&newtio);
write(fp,SendData,sizeof(SendData))
close(fp);
}
 
 

Re:How to control Serial Port RTS

sigmaccc schrieb:
Quote
I use Kylix C++ 3.0.
I can't control RTS,Someone can tell me something wrong.
thanks a lot.




char SendData[7]={ 2,0,1,65,0,0,68 };
int fp;
struct termios oldtio,newtio;

if((fp=open("/dev/ttyS0",O_RDWR|O_NOCTTY))!=-1)
{
tcgetattr(fp,&oldtio);
bzero(&newtio, sizeof(newtio));


newtio.c_cflag=B19200 | CRTSCTS | CS8 | CLOCAL | CREAD;




tcflush(fp,TCIFLUSH);
tcsetattr(fp,TCSANOW,&newtio);

write(fp,SendData,sizeof(SendData))
close(fp);
}


I have no Idea, but did you have a look at Synapse?
www.ararat.cz/synapse/
See unit synaser.pas