|
unsigned int controll;
unsigned int RTS;
RTS = TIOCM_RTS;
unsigned int CTS;
CTS = TIOCM_CTS;
while(1){
if(ioctl(fd,TIOCMBIS,&RTS) > 0 )//结果为负数
{
printf("RTS set success!\n");
}
if(ioctl(fd,TIOCMBIS,&CTS))//结果为负数
{
printf("CTS set success!\n");
}
ioctl(fd,TIOCMGET,&controll);
printf("%x\n",controll);
}
return 0;
为什么设置RTS和CTS引脚都不能成功打印信息,只打印controll的值 |
|