Linux下的Qt程序里打不开串口???怎么回事
是Linux的系统,装了Qt4.7.0,我在一个项目里测试通信协议,需要用到串口来测试自己写的协议是否正确。。可是QT怎么都打不开串口。我安装了minicom,,也安装了ubuntu软件中心里的cutecom,也安装了别的串口助手等工具,也在minicom里修改了一些设置。。别的串口助手可以打开,qt程序里就是打不开。。求助。。。。。
下面是一些代码::
执行后出现:open ttyUSB error
/************串口初始化******************/
QString portName = "/dev/ttyUSB1";//PORTNAME_1;//电脑
// QString portName = //dev/ttySAC3/;//PORTNAME_1;//ARM板子
myCom = new Posix_QextSerialPort(portName,QextSerialBase::Polling);
//myCom = new QextSerialPort(portName);
if(myCom->open(QIODevice::ReadWrite))
{
#ifdef DEBUG
qDebug()<<"open Uart suceess"<<endl;
#endif
}
else
{
#ifdef DEBUG
qDebug()<<"open ttyUSB error"<<endl;
#endif
//return false;
}