You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

1

Friday, June 18th 2010, 12:17pm

qextserialport and segmentation fault

Hello,

I'm trying to use the latest version of qextserialport. I experience a seg fault when I open the port.
My code is pretty simple:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class PortListener : public QObject {
Q_OBJECT
public:
	PortListener(void);
	void openPort(void);

private:
	QextSerialPort *port;
};

PortListener::PortListener(void) {
	port = new QextSerialPort();
}

void PortListener::openPort(void) {
	port->setPortName("COM1");
	port->setBaudRate(BAUD115200);
	 port->setFlowControl(FLOW_OFF);
	 port->setParity(PAR_NONE);
	port->setDataBits(DATA_8);
	 port->setStopBits(STOP_1);
	if (port->open(QIODevice::ReadOnly) == true) {    	// <---- here the segmentation fault
    	connect(port, SIGNAL(readyRead()), this, SLOT(onReadyRead()));
	} else {
    	// to do
	}
}



Do you see any mistake in my code?

Thanks
Marco

2

Tuesday, April 3rd 2012, 11:12am

Hi,

I have got similar error message. Have you found the solution since then?

David