author | mickeyl <mickeyl> | 2002-12-31 14:59:35 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2002-12-31 14:59:35 (UTC) |
commit | 76ec681931f01609969b92e75908418d9e8e92d5 (patch) (unidiff) | |
tree | 8230634998f17c66ebb4eb1acd82112cdb77c944 /noncore/net/wellenreiter/gui/wellenreiter.cpp | |
parent | 3f35e5918b5f508139e189d2428d01d6c2933a50 (diff) | |
download | opie-76ec681931f01609969b92e75908418d9e8e92d5.zip opie-76ec681931f01609969b92e75908418d9e8e92d5.tar.gz opie-76ec681931f01609969b92e75908418d9e8e92d5.tar.bz2 |
- catch with latest changes in libwellenreiter
- GUI now identifies and displays device manufacturers
- GUI now displays the number of received beacons for each device
Diffstat (limited to 'noncore/net/wellenreiter/gui/wellenreiter.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/wellenreiter/gui/wellenreiter.cpp | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/noncore/net/wellenreiter/gui/wellenreiter.cpp b/noncore/net/wellenreiter/gui/wellenreiter.cpp index 9068e3a..b22c5cc 100644 --- a/noncore/net/wellenreiter/gui/wellenreiter.cpp +++ b/noncore/net/wellenreiter/gui/wellenreiter.cpp | |||
@@ -24,6 +24,7 @@ | |||
24 | // Qtopia | 24 | // Qtopia |
25 | 25 | ||
26 | #ifdef QWS | 26 | #ifdef QWS |
27 | #include <qpe/qpeapplication.h> | ||
27 | #include <qpe/global.h> | 28 | #include <qpe/global.h> |
28 | #endif | 29 | #endif |
29 | 30 | ||
@@ -55,12 +56,13 @@ using namespace Opie; | |||
55 | 56 | ||
56 | #include "manufacturers.h" | 57 | #include "manufacturers.h" |
57 | 58 | ||
59 | #include <daemon/source/config.hh> | ||
60 | #include <libwellenreiter/source/wl_types.hh> | ||
58 | #include <libwellenreiter/source/wl_sock.hh> | 61 | #include <libwellenreiter/source/wl_sock.hh> |
59 | #include <libwellenreiter/source/wl_proto.hh> | 62 | #include <libwellenreiter/source/wl_proto.hh> |
60 | #include <daemon/source/config.hh> | ||
61 | 63 | ||
62 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | 64 | Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) |
63 | : WellenreiterBase( parent, name, fl ), daemonRunning( false ) | 65 | : WellenreiterBase( parent, name, fl ), daemonRunning( false ), manufacturerdb( 0 ) |
64 | { | 66 | { |
65 | 67 | ||
66 | // | 68 | // |
@@ -69,7 +71,7 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | |||
69 | 71 | ||
70 | QString manufile; | 72 | QString manufile; |
71 | #ifdef QWS | 73 | #ifdef QWS |
72 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) qApp.qpeDir() ); | 74 | manufile.sprintf( "%s/share/wellenreiter/manufacturers.dat", (const char*) QPEApplication::qpeDir() ); |
73 | #else | 75 | #else |
74 | manufile.sprintf( "/home/mickey/work/opie/share/wellenreiter/manufacturers.dat" ); | 76 | manufile.sprintf( "/home/mickey/work/opie/share/wellenreiter/manufacturers.dat" ); |
75 | #endif | 77 | #endif |
@@ -92,7 +94,8 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | |||
92 | // setup socket for daemon communication, register socket notifier | 94 | // setup socket for daemon communication, register socket notifier |
93 | // | 95 | // |
94 | 96 | ||
95 | daemon_fd = wl_setupsock( GUIADDR, GUIPORT ); | 97 | // struct sockaddr_in sockaddr; |
98 | daemon_fd = wl_setupsock( GUIADDR, GUIPORT, sockaddr ); | ||
96 | if ( daemon_fd == -1 ) | 99 | if ( daemon_fd == -1 ) |
97 | { | 100 | { |
98 | logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); | 101 | logwindow->log( "(E) Couldn't get file descriptor for commsocket." ); |
@@ -111,6 +114,9 @@ Wellenreiter::Wellenreiter( QWidget* parent, const char* name, WFlags fl ) | |||
111 | connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); | 114 | connect( button, SIGNAL( clicked() ), this, SLOT( buttonClicked() ) ); |
112 | button->setEnabled( false ); | 115 | button->setEnabled( false ); |
113 | netview->setColumnWidthMode( 1, QListView::Manual ); | 116 | netview->setColumnWidthMode( 1, QListView::Manual ); |
117 | |||
118 | if ( manufacturerdb ) | ||
119 | netview->setManufacturerDB( manufacturerdb ); | ||
114 | 120 | ||
115 | } | 121 | } |
116 | 122 | ||
@@ -127,17 +133,24 @@ void Wellenreiter::handleMessage() | |||
127 | 133 | ||
128 | qDebug( "received message from daemon." ); | 134 | qDebug( "received message from daemon." ); |
129 | 135 | ||
130 | char buffer[10000]; | 136 | /*char buffer[10000]; |
131 | memset( &buffer, 0, sizeof( buffer ) ); | 137 | memset( &buffer, 0, sizeof( buffer ) );*/ |
138 | |||
139 | char buffer[WL_SOCKBUF]; | ||
132 | 140 | ||
133 | // int result = #wl_recv( &daemon_fd, (char*) &buffer, sizeof(buffer) ); | 141 | // int result = #wl_recv( &daemon_fd, (char*) &buffer, sizeof(buffer) ); |
134 | 142 | ||
143 | /* | ||
144 | |||
135 | struct sockaddr from; | 145 | struct sockaddr from; |
136 | socklen_t len; | 146 | socklen_t len; |
137 | 147 | ||
138 | int result = recvfrom( daemon_fd, &buffer, 8192, MSG_WAITALL, &from, &len ); | 148 | int result = recvfrom( daemon_fd, &buffer, 8192, MSG_WAITALL, &from, &len ); |
139 | |||
140 | qDebug( "received %d from recv [%d bytes]", result, len ); | 149 | qDebug( "received %d from recv [%d bytes]", result, len ); |
150 | |||
151 | */ | ||
152 | |||
153 | int result = wl_recv( &daemon_fd, sockaddr, (char*) &buffer, WL_SOCKBUF ); | ||
141 | 154 | ||
142 | if ( result == -1 ) | 155 | if ( result == -1 ) |
143 | { | 156 | { |