I have a problem while reading data from microcontroller...my microcontroller sends char 'a' continiously(just to test)..and I want to receive the character in my ui application..(lineedit)...
Qt Code:
  1. QextSerialPort * port = new QextSerialPort("COM4", QextSerialPort::EventDriven);
  2. port->setBaudRate(BAUD9600);
  3. port->setFlowControl(FLOW_OFF);
  4. port->setParity(PAR_NONE);
  5. port->setDataBits(DATA_8);
  6. port->setStopBits(STOP_1);
  7. port->open(QIODevice::ReadWrite);
  8. port->setTimeout(500);
  9. port->setRts(true);
  10. port->setDtr(true);
  11. if(port->isReadable())
  12. {
  13. char buff[1024];
  14. qint64 i=port->readLine(buff,1024);
  15.  
  16. buff[i]='\0';
  17. QString str(buff);
  18. if(i!=-1)
  19. {
  20. ui->lineEdit->setText(str);;
  21. port->close();
  22. }
  23. }
  24.  
  25. else
  26. qDebug("port not open");
To copy to clipboard, switch view to plain text mode 
this does not help me ............please help me/...