author | korovkin <korovkin> | 2006-04-15 16:03:19 (UTC) |
---|---|---|
committer | korovkin <korovkin> | 2006-04-15 16:03:19 (UTC) |
commit | 6d3a8eaf3b92f8eec9908eed91568342fac5de1d (patch) (unidiff) | |
tree | deb2f977342b99f72ddcbbaec4066c81278cd65f | |
parent | a1bcbe41d45924713c4ead9b25ac5518473c9ca9 (diff) | |
download | opie-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.
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.cpp | 20 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluebase.h | 1 | ||||
-rw-r--r-- | noncore/net/opietooth/manager/bluetoothbase.ui | 264 |
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 | |||
@@ -55,2 +55,3 @@ using namespace Opie::Core; | |||
55 | #include <qlist.h> | 55 | #include <qlist.h> |
56 | #include <qfile.h> | ||
56 | 57 | ||
@@ -96,2 +97,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
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 | ||
@@ -132,2 +134,3 @@ BlueBase::BlueBase( QWidget* parent, const char* name, WFlags fl ) | |||
132 | serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1); | 134 | serSpeed->setCurrentItem((sizeof(speeds) / sizeof(speeds[0])) - 1); |
135 | encCheckBox->setChecked(true); | ||
133 | } | 136 | } |
@@ -175,3 +178,5 @@ void 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" ); |
@@ -185,2 +190,8 @@ void BlueBase::writeToHciConfig() | |||
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 | } |
@@ -742,2 +753,11 @@ void BlueBase::forwardExit(Opie::Core::OProcess* proc) | |||
742 | 753 | ||
754 | /** | ||
755 | * Encrypt entered passkey | ||
756 | * doit - do encryption of the key | ||
757 | */ | ||
758 | void 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 | |||
@@ -96,2 +96,3 @@ namespace OpieTooth { | |||
96 | void doForward(); | 96 | void doForward(); |
97 | void doEncrypt(bool); | ||
97 | void forwardExit(Opie::Core::OProcess* proc); | 98 | void forwardExit(Opie::Core::OProcess* proc); |
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 | |||
@@ -13,3 +13,3 @@ | |||
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>268</width> | 14 | <width>273</width> |
15 | <height>368</height> | 15 | <height>368</height> |
@@ -21,3 +21,3 @@ | |||
21 | </property> | 21 | </property> |
22 | <vbox> | 22 | <hbox> |
23 | <property stdset="1"> | 23 | <property stdset="1"> |
@@ -241,7 +241,7 @@ | |||
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> |
@@ -249,10 +249,10 @@ | |||
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> |
@@ -260,17 +260,24 @@ | |||
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> |
@@ -278,3 +285,3 @@ | |||
278 | <name>name</name> | 285 | <name>name</name> |
279 | <cstring>pagescanCheckBox</cstring> | 286 | <cstring>encCheckBox</cstring> |
280 | </property> | 287 | </property> |
@@ -282,6 +289,6 @@ | |||
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> |
@@ -289,3 +296,3 @@ | |||
289 | <name>name</name> | 296 | <name>name</name> |
290 | <cstring>inquiryscanCheckBox</cstring> | 297 | <cstring>authCheckBox</cstring> |
291 | </property> | 298 | </property> |
@@ -293,10 +300,10 @@ | |||
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> |
@@ -304,10 +311,10 @@ | |||
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> |
@@ -315,21 +322,25 @@ | |||
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> |
@@ -353,3 +364,3 @@ | |||
353 | <name>margin</name> | 364 | <name>margin</name> |
354 | <number>4</number> | 365 | <number>0</number> |
355 | </property> | 366 | </property> |
@@ -357,3 +368,3 @@ | |||
357 | <name>spacing</name> | 368 | <name>spacing</name> |
358 | <number>2</number> | 369 | <number>0</number> |
359 | </property> | 370 | </property> |
@@ -385,3 +396,3 @@ | |||
385 | <name>margin</name> | 396 | <name>margin</name> |
386 | <number>0</number> | 397 | <number>4</number> |
387 | </property> | 398 | </property> |
@@ -389,3 +400,3 @@ | |||
389 | <name>spacing</name> | 400 | <name>spacing</name> |
390 | <number>0</number> | 401 | <number>2</number> |
391 | </property> | 402 | </property> |
@@ -401,6 +412,12 @@ | |||
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> |
@@ -408,103 +425,52 @@ | |||
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> |
@@ -513,3 +479,3 @@ | |||
513 | </widget> | 479 | </widget> |
514 | </vbox> | 480 | </hbox> |
515 | </widget> | 481 | </widget> |
@@ -537,2 +503,20 @@ | |||
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> |