QSerialDevice

Qt Components

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

13
7.9
Description:

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)
Last changelog:

9 years ago

More changes.

mastupristi

10 years ago

I have downloaded from git the last snapshot.

I have problem compiling examples.

I successfully compile the library. then I get an error on examples:
../../src/release//libqserialdevice.a(nativeserialengine_unix.o): In function `NativeSerialEnginePrivate::nativeSelect(int, bool, bool, bool*, bool*)':
nativeserialengine_unix.cpp:(.text+0x975): undefined reference to `qt_safe_select(int, fd_set*, fd_set*, fd_set*, timeval const*)'
collect2: ld returned 1 exit status


I run ubuntu linux 9.10 64 bit, gcc 4.4.1, qt 4.5.2

thanks

Report

C

kuzulis

10 years ago

Hi.

1. Try download new snapshot (Today I made a lot of changes.)
2. For build in Qt 4.5.x you must replace "qt_safe_select" simply "select".

Report

mastupristi

10 years ago

OK

I downloaded the git tree just few minutes ago.
I modified the file nativeserialengine_unix.cpp to change from qt_safe_select to select
then I successfully bult the library.

now I want to buold an example (serialdevicewatcher), so I cd into examples/serialdevicewatcher, I modify serialdevicewatcher.pro to change the INCLUDEPATH to ../../src/qserialdevicewatcher and QMAKE_LIBDIR ../../src/build/release (other wise make fails)

Now there is an error linking:
g++ -Wl,-O1 -o ../../build/bin/serialdevicewatcher/release/serialdevicewatcher ../../build/bin/serialdevicewatcher/obj/main.o ../../build/bin/serialdevicewatcher/obj/moc_myclass.o -L../../src/build/release -L/usr/lib -lqserialdevice -ludev -lQtCore -lpthread
../../build/bin/serialdevicewatcher/obj/main.o: In function `main':
main.cpp:(.text+0x13c): undefined reference to `SerialDeviceWatcher::SerialDeviceWatcher(QObject*)'
main.cpp:(.text+0x168): undefined reference to `SerialDeviceWatcher::setEnabled(bool)'
collect2: ld returned 1 exit status

it seems that inside library there is no SerialDeviceWatcher class.

How can I solve?

Report

C

kuzulis

10 years ago

SerialDeviceWatcher and SerialDeviceInfo not supported anymore. as They unsuccessfully implemented. More successful is the class SerialDeviceEnumerator which includes the functionality SerialDeviceWatcher anb SerialDeviceInfo. Use SerialDeviceEnumerator.

Report

amanz

10 years ago

Why isn't AbstractSerial a QIODevice? Would make sense in my opinion.

Report

C

kuzulis

10 years ago

In previous versions, was used QIODevice. But while I have a library run stable so from QIODevice had to be abandoned. Also, rejection of QIODevice occurred for other reasons.

Report

tridule

10 years ago

I have a poblem when I try to compile the source code with Qt Creator 4.5.1 on Windows XP sp2.

The compiler tells me that "PCVOID" is not declared, at line 632 in qserialdevice\nativeserialengine_win.cpp.

Could you tell me if I missed something or how I must define it to have the lib compile ?

Report

C

kuzulis

10 years ago

Strange. Data Type PCVOID must be defined in the header of your compiler. Solution - remove the (PCVOID).
---
For interest - go look in the directory / include (or similar) of your compiler in all files *. h - text PCVOID. Will it be found? And in what files?
---
Question: what the compiler uses MinGW, MSVS, other?

Report

tridule

10 years ago

EDIT : big mistake in previous post, the line I added is

typedef const void *PCVOID;

sorry, I'm a bit tired :-)

Report

tridule

10 years ago

Thanks for answering so quickly.

I have solved the problem by adding the line

#define const void PCVOID;

at the beginning of the file.

By the way, I'm using msvc2005, but I couldn't find the include directory since I'm a noob with this compiler (I usually use gcc. Sorry for that.

It seems that PCVOID is not declared by default with msvc2005, or I may have to include a specific header which I don't know.

Report

gakov

10 years ago

порылся в реестре... и ни чего не нашел
поведение всегда одно и то же
1. загрузились - нет ключей
2. подключили девайс - создаются ключи и записи в них
3. отключили девайс - удаляются записи, ключи остаются


Report

C

kuzulis

10 years ago

Ну а при п.1 хотя бы эта ветка имеется:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\Serenum]

???

Report

gakov

10 years ago

Да, есть такая ветка.

Report

C

kuzulis

10 years ago

Ну а теперь попробуйте :)

Report

gakov

10 years ago

Как говорил кот Матроскин:
"Ура! Заработало!"

Report

gakov

10 years ago

Как говорил кот Матроскин:
"Ура! Заработало!"

Report

K4ELO

10 years ago

What happened to serialDevicesAvailable() ?
My app that uses the library needs to get a list of available ports so the user can choose a valid one. Otherwise working great and thanks for your efforts!

Report

C

kuzulis

10 years ago

This method is transferred to the class SerialDewiceWatcher, ie now
-> QStringList SerialDeviceWatcher:: devicesAvailable ()

See documentation.

Report

K4ELO

10 years ago

Thanks - appreciate the information.

Report

bugiii

10 years ago

Look at the macro of #ifndef ~ #endif in serialdeviceinfo.h.

Report

C

kuzulis

10 years ago

What you mean?

Report

gakov

10 years ago

Пытался прикрутить SerialDeviceWatcher(QSerialDevice 0.2.0), не работает на Vista SP2 если до создания объекта не подключалось ни одного последовательного устройства. Возможно, беда в том, что пока не подключили хотя бы одно устройство в реестре нет ключа "HARDWARE\DEVICEMAP\SERIALCOMM". После подключения он создается и при отключениях не удаляется.

Report

C

kuzulis

10 years ago

У меня на Win7 прекрасно работает.

Те ветки реестра о которых вы говорите автоматически создаются при "втыкании" в USB (или другие разъемы) конверторов USB/Serial и т.п. и, соответственно, автоматически удаляются при "извлечении" устройства.

PS: используйте не 0.2.0 а SVN. Там самые последние обновления.

Report

C

kuzulis

10 years ago

Кстати, вы проверьте сами, удаляются или нет ветки у Вас.

Report

gakov

10 years ago

вопрос не в том, что ветка не удаляется. а в том что её вообще нет - если нет СОM портов и еще не подключали USB-COM.

на SVN под debug`ом...

SerialDeviceWatcherPrivate::SerialDeviceWatcherPrivate()
-> function: openKey() returned false. Error!


Report

9 years ago

More changes.

12345678910
13
product-maker nadir22 Nov 28 2012 9 excellent
product-maker qstring Jul 25 2012 9 excellent
product-maker agnitsarkar Mar 15 2012 9 excellent
product-maker EvilTosha Jan 21 2012 9 excellent
product-maker peer Dec 30 2011 9 excellent
product-maker michaudg Jun 29 2011 9 excellent
product-maker woodywoodpecker Jun 25 2011 9 excellent
product-maker Krozac Apr 25 2011 9 excellent
product-maker bronkopavel Mar 01 2011 9 excellent
product-maker torsen Feb 03 2011 9 excellent
product-maker ilpaso Nov 30 2010 9 excellent
product-maker Chief677 Sep 28 2010 9 excellent
product-maker lit-uriy Sep 21 2010 9 excellent
Be the first to comment
nadir22
Mar 21 2012
iframe777
Mar 17 2012
peer
Feb 01 2012
Krozac
Sep 20 2011
wcai
Sep 05 2011
michaudg
Jun 29 2011
MaX-MoD
Mar 02 2011
lit-uriy
Jan 06 2011
ilpaso
Nov 30 2010
bronkopavel
Nov 14 2010
mariuszekpl
Oct 31 2010
NickGaens
Apr 28 2010
kostya2vntu
Mar 19 2010
File (click to download) Version Description Downloads Date Filesize DL OCS-Install MD5SUM
*Needs pling-store or ocs-url to install things
Pling
0 Affiliates
Details
license
version
2.0
updated Mar 15 2012
added Sep 15 2009
downloads 24h
0
mediaviews 24h 0
pageviews 24h 4
System Tags