[maemo-developers] Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device
From: Suyash.Kumar at tieto.com Suyash.Kumar at tieto.comDate: Fri Jul 2 10:15:25 EEST 2010
- Previous message: Retrieving contacts from SIM Memory and Phone Memory Individually.
- Next message: Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi, I am writing a simple Qt on Maemo application for serial communication between device and PC for which I am using QextSerialPort 1.2 library to write on the /dev/ttyS0 port so that it could be read by the COM1 port on my windows machine connected to the device via USB cable. I am able to create the .so libraries and using the QESPTA example provided in QextSerialPort to write on the first serial port. Initially I was trying to write on the COM1 port and the device was creating a file named COM1 and writing everything there. Then I found the naming convention used for the first port on Linux/Maemo is /dev/ttyS0 and changed the port ame accordingly. but this is returning error when the API for writing on port is used although the API to open the port is returning Success. Port Settings & open/ write calls (Code Snippet): port = new QextSerialPort("/dev/ttyS0"); port->setBaudRate(BAUD9600); port->setFlowControl(FLOW_HARDWARE); port->setParity(PAR_NONE); port->setDataBits(DATA_8); port->setStopBits(STOP_1); //set timeouts to 500 ms port->setTimeout(500); port->open(QIODevice::ReadWrite | QIODevice::Unbuffered); // internally calls QFile->Open(..) as shown below and returs success if (Posix_File->open(QIODevice::ReadWrite|QIODevice::Unbuffered)) { qDebug("Opened File succesfully"); /*set open mode*/ QIODevice::open(mode); int i = port->write((message->text()).toAscii(),(message->text()).length()); qDebug("trasmitted : %d", i); // internally calls QIODevice::Write(...) returns -1 as error Has anyone used QextSerialPort before to write on the serial port on Maemo device and does it works? Also, please suggest the possible reason for QIODevice returning error even when the port opens successfully? Regards, Suyash. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.maemo.org/pipermail/maemo-developers/attachments/20100702/67ddb542/attachment.htm>
- Previous message: Retrieving contacts from SIM Memory and Phone Memory Individually.
- Next message: Unable to write to the serial port /dev/ttyS0 using QextSerialPort on Maemo device
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]