
QSerialDevice
Source (link to git-repo or to original if based on someone elses unmodified work): Add the source-code for this project on opencode.net
So, announces release: QSerialDevice 2.0
QSerialDevice – cross-platform library for serial devices based on Qt4.
Release 2.0 will be the last for the library QSerialDevice.
Recently the project (2.0 branch) has been accepted into Qt as an addon (renamed to QtSerialPort), therefore, the current Gitorious repository is no longer used, and his development frozen. Ie do not send more here merge requests, etc., his repository works only in r/o mode.
The new repository is now available here (only available to registered developers):
git clone ssh://codereview.qt-project.org:29418/playground/qtserialport.git
More see: http://qt-project.org/wiki/QtSerialPort
In the future, after the stabilization of the code will create a public repository QtSerialPort, which is an addon for Qt (LGPL + commercial).
Version history:
v 0.4.0 (Outdated)
v 0.3.0 (Outdated)
v 0.2.0 (Outdated)
v 0.1.0 (Outdated)
9 years ago
More changes.
9 years ago
More changes.
momomo34
8 years ago
I am using your example to develop my own application. I found a problem with the buffer size in reception. Can you explain me how is it possible to change the receiving buffer size. It is now 14 bytes. For my application I need a buffer at 255 bytes. How is it possible to do this?
Thank you.
Report
kuzulis
8 years ago
A little unclear about which library it, about what examples and what kind of buffer do you mean?
Report
RomanG
8 years ago
a while ago I downloaded your source version 0.3.0. and included it in my App. Wrote a Thread which handels the serial port (AbstractSerial), to be sure that no data can be lost. Everything worked fine. After the info that your source will be an addon to Qt5 I downloaded your new version 2.0. and replaced the old version in my app.
The new version works as long as no interactions on the gui will take place. But as soon as for example I hold the Main-Window at its windowframetitle the readyRead() SIGNAL will not be triggeret any more.
I still can write to the Port and also input data wont be lost its just that the SIGNAL will not be triggeret.
Why is this? What do I have to do, in order to get the SIGNAL even if my window is in action?
thanks.
regards
Roman
Report
kuzulis
8 years ago
1. Use QtSerialPort, because in QSerialDevice 2.0 has some bugs.
2. Give a minimal example that reproduces the problem.
Report
goeck
9 years ago
I really liked versions prior to 2.0, but now I find almost totally undocumented and massively changed code (which is OK regarding the code...).
I fumbled around and got it back running, but now the readyRead() signal seems to emit never. As I can see on the wires, using Logic, sending Bytes works out fine; the RS232 device answers as expected, but my reading routine doesn't get called due to missing readyRead() signal. What do I do wrong?
Where can I find the new documentation, or how can I build it? Am missing the doxygen style...
THX for the work
Keep it up
goeck
Report
kuzulis
9 years ago
For details, see here
http://qt-project.org/wiki/QtSerialPort
It says how to build a library.
Documentation is now done in QDoc, therefore, if you will use QtSerialPort - then run "make docs".
Perhaps this is also true in relation to QSerialDevice.
ReadyRead () signal is working. Maybe you do something wrong.
For QSerialDevice 2.0 see examples in /examples and /tests
Report
goeck
9 years ago
Report
kuzulis
9 years ago
But you could just remove in serialportengine_p_win.cpp here lines:
...
53 #ifndef Q_CC_MSVC
54 # include <ddk/ntddser.h>
55 #else
...
88 #endif
Report
goeck
9 years ago
Report
goeck
9 years ago
thanks for the quick reply and the hint with QDoc. I applied qdoc3.exe to the qdocconf file, but it says: Environment variable 'SERIALDEVICE_DIR' undefined
Actually on my MinGW MSYS windows machine running 'make.exe docs' leads to an error message, saying that no makefile was found...
I don't know what can be done wrongly when connecting to the signal... It only seems to partly work, when calling 'waitForReadyRead(100);' right after something was written on RS232, which is blocking. It worked out pretty fine using qserialdevice 0.4.1... I simply updated the code.
Hope you have some more hints for me.
thanks and
Cheers
goeck
Report
goeck
9 years ago
Yeah, you're right, using waitForReadyRead() was the only thing that kind of worked for me, no signaling, nothing.
I now compiled some Doxygen help with the 2.0 code. It mostly workes.
Cheers
goeck
Report
kuzulis
9 years ago
Strange, but I'll check it in the future, maybe :)
Report
kuzulis
9 years ago
Strange, but I'll check it in the future, maybe :)
Report
kuzulis
9 years ago
Look for it in the documentation below in compliance with such as: "Programming with a blocking socket is radically different from programming with a non-blocking socket..."
When using waitForReadyRead() does not make sense in the signal readyRead()! :)
Report
EvilTosha
9 years ago
Система вин7 64, Qt 4.8.0
Report
kuzulis
9 years ago
http://gitorious.org/qserialdevice/qserialdevice/trees/2.0
Report
EvilTosha
9 years ago
Report
kuzulis
9 years ago
Report
EvilTosha
9 years ago
Спасибо за помощь и обсуждение проблемы.
Report
tony1tf
9 years ago
Based on Qt 4.7.0 (64 bit) Built on Sep 15 2010 at 14:09:02
I am a relative beginner at this and dont have enough knowledge to debug the problem - all I wanted to do was to write a small Qt application to send a few characters to the serial port (prolific usb to serial adaptor) when a button is pressed. I can do this manually from the mac os x terminal with the command "screen -U /dev/tty.usbserial 9600 "
I have had several goes at compiling the QSerialDevice build examples
anymaster app compiles but crashes my mac
anyslave app compiles but hangs
emumerator starts compiling but
stops with this warning:
ld: warning: directory '/tmp/qt-stuff-6474/source/qt-everywhere-opensource-src-4.7.0/lib' following -L not found.
Undefined symbols:
"_CFDictionaryAddValue", referenced from:
SerialDeviceEnumeratorPrivate::SerialDeviceEnumeratorPrivate()in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
SerialDeviceEnumeratorPrivate::SerialDeviceEnumeratorPrivate()in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
"_CFRunLoopGetCurrent", referenced from:
SerialDeviceEnumeratorPrivate::setEnabled(bool) in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
"_CFNumberGetValue", referenced from:
SerialDeviceEnumeratorPrivate::updateInfo() const in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
SerialDeviceEnumeratorPrivate::updateInfo() const in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
"_IORegistryEntryCreateCFProperty", referenced from:
SerialDeviceEnumeratorPrivate::updateInfo() const in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
"_IONotificationPortCreate", referenced from:
SerialDeviceEnumeratorPrivate::setEnabled(bool) in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
"_CFRelease", referenced from:
SerialDeviceEnumeratorPrivate::updateInfo() const in libqserialdevice.a(serialdeviceenumerator_p_mac.o)
and so many similar error messages
The compilation never gets as far as the remainder of the apps
Any help appreciated, thanks
Tony
Report
kuzulis
9 years ago
Use the new version 2.0 of the library - there are many changes and everything should work fine.
http://gitorious.org/qserialdevice/qserialdevice/trees/2.0
Report
tony1tf
9 years ago
Thanks for your fast reply. I downloaded version 2, but it produces a different error - here is the compiler output just before the error:
make[1]: Entering directory `/Users/afa/Documents/Astronomy/serialport-build-desktop/src'
/Developer/Tools/Qt/moc -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/local/Qt4.7/mkspecs/macx-g++ -I../../qserialdevice-qserialdevice\ 2/src -I/Library/Frameworks/QtCore.framework/Versions/4/Headers -I/usr/include/QtCore -I/usr/include -I../../qserialdevice-qserialdevice\ 2/include -I/Users/afa/Documents/Astronomy/serialport-build-desktop/src/. -I../../qserialdevice-qserialdevice\ 2/src -I. -F/Library/Frameworks -D__APPLE__ -D__GNUC__ ../../qserialdevice-qserialdevice 2/include/serialport.h -o moc_serialport.cpp
moc: Too many input files specified
I also had the same "too many files error" when trying to compile another serial port implementation.
Obviously yet another Mac compatibility issue
Tony
Report
tony1tf
9 years ago
I found the reason for the "too many files" error was because of the space in the file name - you had added <space>2 to the Qserial-device application.
So now I can compile, but cannot get the test apps to run - QT is asking for an executable and run environment, and then I get the error message "Failed to start program. Path or permissions wrong?" or if I tell it to start in a terminal window it cant start xterm. Then from time to time I get another error message in a pop up window in QT "The file serialport.pro.user has changed outside Qt Creator. Do you want to reload it?"
So no success yet.
Tony
Report
kuzulis
9 years ago
Report
tony1tf
9 years ago
OK, lets take it step by step:
do you agree that the "too many files" error from moc was caused by you having added "<space>2" to the new version you told me load:
http://gitorious.org/qserialdevice/qserialdevice/trees/2.0
Tony
Report