mastupristi
6th August 2009, 15:47
I'm tring to use QSerialDevice and I have a question (can you hear me kuzulis? ;) )
I work under linux and I tried in this way:
MyDevice = new TSerialDevice();
MyDevice->setDeviceName("/dev/ttyS0");
MyDevice->setBaudRate(19200);
MyDevice->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
If I execute this code I can read in console:
TPosixSerialDevice::setBaudRate->Device is not open! Error!
Trying to open File
Opened File succesfully
so it seems wrond the order of calls, so I tried this:
MyDevice = new TSerialDevice();
MyDevice->setBaudRate(19200);
MyDevice->setDeviceName("/dev/ttyS0");
MyDevice->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
No more error in console, but baudrate is set to default (9600) :(
So I tried to test baudrate of first piece of code, althought the error on setBaudRate() the baudrate is correctly set to 19200.
Is this a bug or I am wrong somewhere?
thanks
I work under linux and I tried in this way:
MyDevice = new TSerialDevice();
MyDevice->setDeviceName("/dev/ttyS0");
MyDevice->setBaudRate(19200);
MyDevice->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
If I execute this code I can read in console:
TPosixSerialDevice::setBaudRate->Device is not open! Error!
Trying to open File
Opened File succesfully
so it seems wrond the order of calls, so I tried this:
MyDevice = new TSerialDevice();
MyDevice->setBaudRate(19200);
MyDevice->setDeviceName("/dev/ttyS0");
MyDevice->open(QIODevice::ReadWrite | QIODevice::Unbuffered);
No more error in console, but baudrate is set to default (9600) :(
So I tried to test baudrate of first piece of code, althought the error on setBaudRate() the baudrate is correctly set to 19200.
Is this a bug or I am wrong somewhere?
thanks