Testing connection of a device Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
dudero
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Mar 25, 2009 7:09 pm

Testing connection of a device

Post by dudero » Thu Apr 16, 2009 3:12 pm

Hello,

I want to test if a device is connected.
In my case it`s a UART device which is connected to my PC via a RS232 interface.
And I am accessing it by port address:
"/dev/ttyS0"(Linux).

But later this should be generic, because the program should be run under different operating systems.

Does have anybody an idea how could it be realized with wxWidgets?

Greetz dudero

spectrum
Filthy Rich wx Solver
Filthy Rich wx Solver
Posts: 207
Joined: Sat Jul 21, 2007 12:17 pm

Post by spectrum » Thu Apr 16, 2009 3:47 pm

hi dudero,

you can try wxCTB

http://wxcode.sourceforge.net/showcomp.php?name=wxCtb

there is a wxSerialPort object included, should be portable.

Otherwise, i will easily write my own ComPort object, with some #ifdefs.

greetings,
spectrum
spectrum

dudero
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Mar 25, 2009 7:09 pm

Post by dudero » Fri Apr 17, 2009 7:50 am

Thx spectrum,

I have tried it, but I get a error at make process:

Code: Select all

~/wxWidgets_modules/wxctb-0.9/build> make DEBUG=x GPIB=x
g++ -c -o /wxctb_lib_timer.o   -D_THREAD_SAFE -pthread  -I../include   -MT/wxctb_lib_timer.o -MF`echo /wxctb_lib_timer.o | sed -e 's,\.o$,.d,'` -MD ../src/linux/timer.cpp
../src/linux/timer.cpp: In function ‘void kill_all_timer()’:
../src/linux/timer.cpp:93: error: ‘pthread_kill_other_threads_np’ was not declared in this scope
../src/linux/timer.cpp: At global scope:
../src/linux/timer.cpp:99: fatal error: opening dependency file /wxctb_lib_timer.d: Keine Berechtigung
compilation terminated.
make: *** [/wxctb_lib_timer.o] Fehler 1
[email protected]:~/wxWidgets_modules/wxctb-0.9/build> sudo make DEBUG=x GPIB=x
g++ -c -o /wxctb_lib_timer.o   -D_THREAD_SAFE -pthread  -I../include   -MT/wxctb_lib_timer.o -MF`echo /wxctb_lib_timer.o | sed -e 's,\.o$,.d,'` -MD ../src/linux/timer.cpp
../src/linux/timer.cpp: In function ‘void kill_all_timer()’:
../src/linux/timer.cpp:93: error: ‘pthread_kill_other_threads_np’ was not declared in this scope
make: *** [/wxctb_lib_timer.o] Fehler 1
How can I solve this?

Greetz dudero

dudero
Knows some wx things
Knows some wx things
Posts: 44
Joined: Wed Mar 25, 2009 7:09 pm

Post by dudero » Fri Apr 17, 2009 9:11 am

I have fixed it with a self implemented testConnection method :wink:

Post Reply