|
本帖最后由 haoyunp 于 2014-9-1 16:45 编辑
在6410的qt系统中
//设置为特诉波特率,比如28800
int serial_set_speci_baud(struct serial_t *tty,int baud)
{
struct serial_struct ss,ss_set;
cfsetispeed(&tty->options,B38400);
cfsetospeed(&tty->options,B38400);
tcflush(tty->fd,TCIFLUSH);/*handle unrecevie char*/
tcsetattr(tty->fd,TCSANOW,&tty->options);
if((ioctl(tty->fd,TIOCGSERIAL,&ss))<0){
dprintk("BAUD: error to get the serial_struct info:%s/n",strerror(errno));
return -1;
}
提示:BAUD: error to get the serial_struct info :Invalid argument
为什么会这样呢?在别的开发板中用过这个子程序,没问题的?是驱动有问题吗? |
|