summaryrefslogtreecommitdiff
path: root/noncore
authorkorovkin <korovkin>2006-04-15 16:03:19 (UTC)
committer korovkin <korovkin>2006-04-15 16:03:19 (UTC)
commit6d3a8eaf3b92f8eec9908eed91568342fac5de1d (patch) (unidiff)
treedeb2f977342b99f72ddcbbaec4066c81278cd65f /noncore
parenta1bcbe41d45924713c4ead9b25ac5518473c9ca9 (diff)
downloadopie-6d3a8eaf3b92f8eec9908eed91568342fac5de1d.zip
opie-6d3a8eaf3b92f8eec9908eed91568342fac5de1d.tar.gz
opie-6d3a8eaf3b92f8eec9908eed91568342fac5de1d.tar.bz2
Added default passkey writing to /etc/bluetooth/pin file.
Added encrypt default passkey in edit line button.
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp20
-rw-r--r--noncore/net/opietooth/manager/bluebase.h1
-rw-r--r--noncore/net/opietooth/manager/bluetoothbase.ui264
3 files changed, 145 insertions, 140 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index 9ec5bf8..924d191 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -53,6 +53,7 @@ using namespace Opie::Core;
53#include <qpopupmenu.h> 53#include <qpopupmenu.h>
54#include <qtimer.h> 54#include <qtimer.h>
55#include <qlist.h> 55#include <qlist.h>
56#include <qfile.h>
56 57
57/* STD */ 58/* STD */
58#include <remotedevice.h> 59#include <remotedevice.h>
@@ -94,6 +95,7 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
94 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ), 95 connect( m_localDevice, SIGNAL( signalStrength(const QString&,const QString&) ),
95 this, SLOT( addSignalStrength(const QString&,const QString&) ) ); 96 this, SLOT( addSignalStrength(const QString&,const QString&) ) );
96 connect(runButton, SIGNAL(clicked()), this, SLOT(doForward())); 97 connect(runButton, SIGNAL(clicked()), this, SLOT(doForward()));
98 connect(encCheckBox, SIGNAL(toggled(bool)), this, SLOT(doEncrypt(bool)));
97 99
98 // let hold be rightButtonClicked() 100 // let hold be rightButtonClicked()
99 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold); 101 QPEApplication::setStylusOperation( devicesView->viewport(), QPEApplication::RightOnHold);
@@ -130,6 +132,7 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl )
130 serSpeed->insertItem(speeds[i].str); 132 serSpeed->insertItem(speeds[i].str);
131 } 133 }
132 serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1); 134 serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1);
135 encCheckBox->setChecked(true);
133} 136}
134 137
135/** 138/**
@@ -173,7 +176,9 @@ void BlueBase::writeConfig()
173 */ 176 */
174void BlueBase::writeToHciConfig() 177void BlueBase::writeToHciConfig()
175{ 178{
179 QFile pinFile("/etc/bluetooth/pin"); // /etc/bluetooth/pin file
176 owarn << "writeToHciConfig" << oendl; 180 owarn << "writeToHciConfig" << oendl;
181 //Write /etc/bluetooth/hcid.conf file
177 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" ); 182 HciConfWrapper hciconf ( "/etc/bluetooth/hcid.conf" );
178 hciconf.load(); 183 hciconf.load();
179 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" ); 184 hciconf.setPinHelper( QPEApplication::qpeDir() + "bin/bluepin" );
@@ -183,6 +188,12 @@ void BlueBase::writeToHciConfig()
183 hciconf.setPscan( m_enablePagescan ); 188 hciconf.setPscan( m_enablePagescan );
184 hciconf.setIscan( m_enableInquiryscan ); 189 hciconf.setIscan( m_enableInquiryscan );
185 hciconf.save(); 190 hciconf.save();
191 // Write /etc/bluetooth/pin (default PIN file)
192 pinFile.open(IO_WriteOnly | IO_Truncate);
193 pinFile.writeBlock(m_defaultPasskey, m_defaultPasskey.length());
194 pinFile.writeBlock("\n", sizeof("\n"));
195 pinFile.flush();
196 pinFile.close();
186} 197}
187 198
188 199
@@ -740,4 +751,13 @@ void BlueBase::forwardExit(Opie::Core::OProcess* proc)
740 runButton->setText("start gateway"); 751 runButton->setText("start gateway");
741} 752}
742 753
754/**
755 * Encrypt entered passkey
756 * doit - do encryption of the key
757 */
758void BlueBase::doEncrypt(bool doit)
759{
760 passkeyLine->setEchoMode((doit)? QLineEdit::Password: QLineEdit::Normal);
761}
762
743//eof 763//eof
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 0128a88..9cbea56 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -94,6 +94,7 @@ namespace OpieTooth {
94 void deviceActive( const QString& mac, bool connected ); 94 void deviceActive( const QString& mac, bool connected );
95 void applyConfigChanges(); 95 void applyConfigChanges();
96 void doForward(); 96 void doForward();
97 void doEncrypt(bool);
97 void forwardExit(Opie::Core::OProcess* proc); 98 void forwardExit(Opie::Core::OProcess* proc);
98 void addSignalStrength(); 99 void addSignalStrength();
99 void addSignalStrength( const QString& mac, const QString& strengh ); 100 void addSignalStrength( const QString& mac, const QString& strengh );
diff --git a/noncore/net/opietooth/manager/bluetoothbase.ui b/noncore/net/opietooth/manager/bluetoothbase.ui
index a5e2c6f..5539181 100644
--- a/noncore/net/opietooth/manager/bluetoothbase.ui
+++ b/noncore/net/opietooth/manager/bluetoothbase.ui
@@ -11,7 +11,7 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>268</width> 14 <width>273</width>
15 <height>368</height> 15 <height>368</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -19,7 +19,7 @@
19 <name>caption</name> 19 <name>caption</name>
20 <string>Form1</string> 20 <string>Form1</string>
21 </property> 21 </property>
22 <vbox> 22 <hbox>
23 <property stdset="1"> 23 <property stdset="1">
24 <name>margin</name> 24 <name>margin</name>
25 <number>0</number> 25 <number>0</number>
@@ -239,99 +239,110 @@
239 <name>spacing</name> 239 <name>spacing</name>
240 <number>2</number> 240 <number>2</number>
241 </property> 241 </property>
242 <widget row="6" column="0" rowspan="1" colspan="2" > 242 <widget row="0" column="0" >
243 <class>QPushButton</class> 243 <class>QLabel</class>
244 <property stdset="1"> 244 <property stdset="1">
245 <name>name</name> 245 <name>name</name>
246 <cstring>configApplyButton</cstring> 246 <cstring>deviceNameLabel</cstring>
247 </property> 247 </property>
248 <property stdset="1"> 248 <property stdset="1">
249 <name>text</name> 249 <name>text</name>
250 <string>Apply</string> 250 <string>Device Name</string>
251 </property> 251 </property>
252 </widget> 252 </widget>
253 <widget row="2" column="0" rowspan="1" colspan="2" > 253 <widget row="1" column="0" >
254 <class>QCheckBox</class> 254 <class>QLabel</class>
255 <property stdset="1"> 255 <property stdset="1">
256 <name>name</name> 256 <name>name</name>
257 <cstring>authCheckBox</cstring> 257 <cstring>passkeyLabel</cstring>
258 </property> 258 </property>
259 <property stdset="1"> 259 <property stdset="1">
260 <name>text</name> 260 <name>text</name>
261 <string>enable authentification</string> 261 <string>Default Passkey</string>
262 </property> 262 </property>
263 </widget> 263 </widget>
264 <widget row="3" column="0" rowspan="1" colspan="2" > 264 <widget row="0" column="1" >
265 <class>QCheckBox</class> 265 <class>QLineEdit</class>
266 <property stdset="1"> 266 <property stdset="1">
267 <name>name</name> 267 <name>name</name>
268 <cstring>cryptCheckBox</cstring> 268 <cstring>deviceNameLine</cstring>
269 </property> 269 </property>
270 </widget>
271 <widget row="1" column="1" >
272 <class>QLineEdit</class>
270 <property stdset="1"> 273 <property stdset="1">
271 <name>text</name> 274 <name>name</name>
272 <string>enable encryption</string> 275 <cstring>passkeyLine</cstring>
276 </property>
277 <property stdset="1">
278 <name>echoMode</name>
279 <enum>Password</enum>
273 </property> 280 </property>
274 </widget> 281 </widget>
275 <widget row="4" column="0" rowspan="1" colspan="2" > 282 <widget row="2" column="1" >
276 <class>QCheckBox</class> 283 <class>QCheckBox</class>
277 <property stdset="1"> 284 <property stdset="1">
278 <name>name</name> 285 <name>name</name>
279 <cstring>pagescanCheckBox</cstring> 286 <cstring>encCheckBox</cstring>
280 </property> 287 </property>
281 <property stdset="1"> 288 <property stdset="1">
282 <name>text</name> 289 <name>text</name>
283 <string>Enable Page scan</string> 290 <string>encrypt</string>
284 </property> 291 </property>
285 </widget> 292 </widget>
286 <widget row="5" column="0" rowspan="1" colspan="2" > 293 <widget row="3" column="0" rowspan="1" colspan="2" >
287 <class>QCheckBox</class> 294 <class>QCheckBox</class>
288 <property stdset="1"> 295 <property stdset="1">
289 <name>name</name> 296 <name>name</name>
290 <cstring>inquiryscanCheckBox</cstring> 297 <cstring>authCheckBox</cstring>
291 </property> 298 </property>
292 <property stdset="1"> 299 <property stdset="1">
293 <name>text</name> 300 <name>text</name>
294 <string>Enable Inquiry scan</string> 301 <string>enable authentification</string>
295 </property> 302 </property>
296 </widget> 303 </widget>
297 <widget row="0" column="0" > 304 <widget row="4" column="0" rowspan="1" colspan="2" >
298 <class>QLabel</class> 305 <class>QCheckBox</class>
299 <property stdset="1"> 306 <property stdset="1">
300 <name>name</name> 307 <name>name</name>
301 <cstring>deviceNameLabel</cstring> 308 <cstring>cryptCheckBox</cstring>
302 </property> 309 </property>
303 <property stdset="1"> 310 <property stdset="1">
304 <name>text</name> 311 <name>text</name>
305 <string>Device Name</string> 312 <string>enable encryption</string>
306 </property> 313 </property>
307 </widget> 314 </widget>
308 <widget row="1" column="0" > 315 <widget row="5" column="0" rowspan="1" colspan="2" >
309 <class>QLabel</class> 316 <class>QCheckBox</class>
310 <property stdset="1"> 317 <property stdset="1">
311 <name>name</name> 318 <name>name</name>
312 <cstring>passkeyLabel</cstring> 319 <cstring>pagescanCheckBox</cstring>
313 </property> 320 </property>
314 <property stdset="1"> 321 <property stdset="1">
315 <name>text</name> 322 <name>text</name>
316 <string>Default Passkey</string> 323 <string>Enable Page scan</string>
317 </property> 324 </property>
318 </widget> 325 </widget>
319 <widget row="0" column="1" > 326 <widget row="6" column="0" rowspan="1" colspan="2" >
320 <class>QLineEdit</class> 327 <class>QCheckBox</class>
321 <property stdset="1"> 328 <property stdset="1">
322 <name>name</name> 329 <name>name</name>
323 <cstring>deviceNameLine</cstring> 330 <cstring>inquiryscanCheckBox</cstring>
331 </property>
332 <property stdset="1">
333 <name>text</name>
334 <string>Enable Inquiry scan</string>
324 </property> 335 </property>
325 </widget> 336 </widget>
326 <widget row="1" column="1" > 337 <widget row="7" column="0" rowspan="1" colspan="2" >
327 <class>QLineEdit</class> 338 <class>QPushButton</class>
328 <property stdset="1"> 339 <property stdset="1">
329 <name>name</name> 340 <name>name</name>
330 <cstring>passkeyLine</cstring> 341 <cstring>configApplyButton</cstring>
331 </property> 342 </property>
332 <property stdset="1"> 343 <property stdset="1">
333 <name>echoMode</name> 344 <name>text</name>
334 <enum>Password</enum> 345 <string>Apply</string>
335 </property> 346 </property>
336 </widget> 347 </widget>
337 </grid> 348 </grid>
@@ -351,11 +362,11 @@
351 <vbox> 362 <vbox>
352 <property stdset="1"> 363 <property stdset="1">
353 <name>margin</name> 364 <name>margin</name>
354 <number>4</number> 365 <number>0</number>
355 </property> 366 </property>
356 <property stdset="1"> 367 <property stdset="1">
357 <name>spacing</name> 368 <name>spacing</name>
358 <number>2</number> 369 <number>0</number>
359 </property> 370 </property>
360 <widget> 371 <widget>
361 <class>QLabel</class> 372 <class>QLabel</class>
@@ -383,11 +394,11 @@
383 <vbox> 394 <vbox>
384 <property stdset="1"> 395 <property stdset="1">
385 <name>margin</name> 396 <name>margin</name>
386 <number>0</number> 397 <number>4</number>
387 </property> 398 </property>
388 <property stdset="1"> 399 <property stdset="1">
389 <name>spacing</name> 400 <name>spacing</name>
390 <number>0</number> 401 <number>2</number>
391 </property> 402 </property>
392 <widget> 403 <widget>
393 <class>QGroupBox</class> 404 <class>QGroupBox</class>
@@ -399,119 +410,74 @@
399 <name>title</name> 410 <name>title</name>
400 <string>Cell Forwarder</string> 411 <string>Cell Forwarder</string>
401 </property> 412 </property>
402 <vbox> 413 <property>
414 <name>layoutMargin</name>
415 </property>
416 <property>
417 <name>layoutSpacing</name>
418 </property>
419 <grid>
403 <property stdset="1"> 420 <property stdset="1">
404 <name>margin</name> 421 <name>margin</name>
405 <number>11</number> 422 <number>4</number>
406 </property> 423 </property>
407 <property stdset="1"> 424 <property stdset="1">
408 <name>spacing</name> 425 <name>spacing</name>
409 <number>6</number> 426 <number>2</number>
410 </property> 427 </property>
411 <widget> 428 <widget row="2" column="0" rowspan="1" colspan="3" >
412 <class>QLayoutWidget</class> 429 <class>QPushButton</class>
430 <property stdset="1">
431 <name>name</name>
432 <cstring>runButton</cstring>
433 </property>
434 <property stdset="1">
435 <name>text</name>
436 <string>start gateway</string>
437 </property>
438 </widget>
439 <widget row="0" column="0" rowspan="1" colspan="2" >
440 <class>QLabel</class>
413 <property stdset="1"> 441 <property stdset="1">
414 <name>name</name> 442 <name>name</name>
415 <cstring>Layout9</cstring> 443 <cstring>serDevLabel</cstring>
444 </property>
445 <property stdset="1">
446 <name>text</name>
447 <string>Serial device:</string>
416 </property> 448 </property>
417 <vbox>
418 <property stdset="1">
419 <name>margin</name>
420 <number>0</number>
421 </property>
422 <property stdset="1">
423 <name>spacing</name>
424 <number>6</number>
425 </property>
426 <widget>
427 <class>QLayoutWidget</class>
428 <property stdset="1">
429 <name>name</name>
430 <cstring>Layout5</cstring>
431 </property>
432 <hbox>
433 <property stdset="1">
434 <name>margin</name>
435 <number>0</number>
436 </property>
437 <property stdset="1">
438 <name>spacing</name>
439 <number>6</number>
440 </property>
441 <widget>
442 <class>QLabel</class>
443 <property stdset="1">
444 <name>name</name>
445 <cstring>serDevLabel</cstring>
446 </property>
447 <property stdset="1">
448 <name>text</name>
449 <string>Serial device:</string>
450 </property>
451 </widget>
452 <widget>
453 <class>QLineEdit</class>
454 <property stdset="1">
455 <name>name</name>
456 <cstring>serDevName</cstring>
457 </property>
458 </widget>
459 </hbox>
460 </widget>
461 <widget>
462 <class>QLayoutWidget</class>
463 <property stdset="1">
464 <name>name</name>
465 <cstring>Layout6</cstring>
466 </property>
467 <hbox>
468 <property stdset="1">
469 <name>margin</name>
470 <number>0</number>
471 </property>
472 <property stdset="1">
473 <name>spacing</name>
474 <number>6</number>
475 </property>
476 <widget>
477 <class>QLabel</class>
478 <property stdset="1">
479 <name>name</name>
480 <cstring>serSpeedLabel</cstring>
481 </property>
482 <property stdset="1">
483 <name>text</name>
484 <string>Speed:</string>
485 </property>
486 </widget>
487 <widget>
488 <class>QComboBox</class>
489 <property stdset="1">
490 <name>name</name>
491 <cstring>serSpeed</cstring>
492 </property>
493 </widget>
494 </hbox>
495 </widget>
496 <widget>
497 <class>QPushButton</class>
498 <property stdset="1">
499 <name>name</name>
500 <cstring>runButton</cstring>
501 </property>
502 <property stdset="1">
503 <name>text</name>
504 <string>start gateway</string>
505 </property>
506 </widget>
507 </vbox>
508 </widget> 449 </widget>
509 </vbox> 450 <widget row="0" column="2" >
451 <class>QLineEdit</class>
452 <property stdset="1">
453 <name>name</name>
454 <cstring>serDevName</cstring>
455 </property>
456 </widget>
457 <widget row="1" column="1" rowspan="1" colspan="2" >
458 <class>QComboBox</class>
459 <property stdset="1">
460 <name>name</name>
461 <cstring>serSpeed</cstring>
462 </property>
463 </widget>
464 <widget row="1" column="0" >
465 <class>QLabel</class>
466 <property stdset="1">
467 <name>name</name>
468 <cstring>serSpeedLabel</cstring>
469 </property>
470 <property stdset="1">
471 <name>text</name>
472 <string>Speed:</string>
473 </property>
474 </widget>
475 </grid>
510 </widget> 476 </widget>
511 </vbox> 477 </vbox>
512 </widget> 478 </widget>
513 </widget> 479 </widget>
514 </vbox> 480 </hbox>
515</widget> 481</widget>
516<customwidgets> 482<customwidgets>
517 <customwidget> 483 <customwidget>
@@ -535,4 +501,22 @@
535 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data> 501 <data format="XPM.GZ" length="646">789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
536 </image> 502 </image>
537</images> 503</images>
504<tabstops>
505 <tabstop>Status</tabstop>
506 <tabstop>devicesView</tabstop>
507 <tabstop>PushButton2</tabstop>
508 <tabstop>connectionsView</tabstop>
509 <tabstop>deviceNameLine</tabstop>
510 <tabstop>passkeyLine</tabstop>
511 <tabstop>encCheckBox</tabstop>
512 <tabstop>authCheckBox</tabstop>
513 <tabstop>cryptCheckBox</tabstop>
514 <tabstop>pagescanCheckBox</tabstop>
515 <tabstop>inquiryscanCheckBox</tabstop>
516 <tabstop>configApplyButton</tabstop>
517 <tabstop>rfcommBindButton</tabstop>
518 <tabstop>serDevName</tabstop>
519 <tabstop>serSpeed</tabstop>
520 <tabstop>runButton</tabstop>
521</tabstops>
538</UI> 522</UI>