PDA

View Full Version : Get Serial Port signal From Device in ubuntu



basilb07
31st December 2016, 08:29
How to Get Data from external device. device connected via serial port..
i want read device passing value ..
am try to code here

ui->setupUi(this);
serial.setPortName("/dev/ttyS0");
serial.setBaudRate(QSerialPort::Baud9600);
serial.setDataBits(QSerialPort::Data8);
serial.setParity(QSerialPort::NoParity);
serial.setStopBits(QSerialPort::OneStop);
serial.setFlowControl(QSerialPort::NoFlowControl);
serial.open(QIODevice::ReadWrite);


after how to ready port value

high_flyer
15th January 2017, 22:32
Since it appears your serial class is a QIODevice then you can use any of the reading methods.