summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/manager/bluebase.cpp54
-rw-r--r--noncore/net/opietooth/manager/bluebase.h3
-rw-r--r--noncore/net/opietooth/manager/manager.pro4
3 files changed, 52 insertions, 9 deletions
diff --git a/noncore/net/opietooth/manager/bluebase.cpp b/noncore/net/opietooth/manager/bluebase.cpp
index af65f14..b4b59c3 100644
--- a/noncore/net/opietooth/manager/bluebase.cpp
+++ b/noncore/net/opietooth/manager/bluebase.cpp
@@ -19,2 +19,3 @@
19#include "scandialog.h" 19#include "scandialog.h"
20#include "hciconfwrapper.h"
20 21
@@ -32,3 +33,2 @@
32#include <qmessagebox.h> 33#include <qmessagebox.h>
33#include <qapplication.h>
34#include <qcheckbox.h> 34#include <qcheckbox.h>
@@ -60,4 +60,5 @@ namespace OpieTooth {
60 this, SLOT( startServiceActionClicked( QListViewItem* ) ) ); 60 this, SLOT( startServiceActionClicked( QListViewItem* ) ) );
61 // hehe, cast right later
61 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ), 62 connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ),
62 this, SLOT(startServiceActionHold( BTListItem *, const QPoint &, int) ) ); 63 this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) );
63 connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ), 64 connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ),
@@ -92,2 +93,3 @@ namespace OpieTooth {
92 (void) new BTListItem( topLV2, "BlueNiC" , "", "service" ); 93 (void) new BTListItem( topLV2, "BlueNiC" , "", "service" );
94 writeToHciConfig();
93 } 95 }
@@ -128,3 +130,41 @@ namespace OpieTooth {
128 cfg.writeEntry( "enableInquiryscan" , enableInquiryscan ); 130 cfg.writeEntry( "enableInquiryscan" , enableInquiryscan );
129} 131
132 writeToHciConfig();
133 }
134
135 void BlueBase::writeToHciConfig() {
136
137 HciConfWrapper *hciconf = new HciConfWrapper( "/tmp/hcid.conf" );
138 hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" );
139
140
141 // hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" );
142
143 hciconf->setName( deviceName );
144
145 if ( useEncryption == 1) {
146 hciconf->setEncrypt( true );
147 } else {
148 hciconf->setEncrypt( false );
149 }
150
151
152 if ( enableAuthentification == 1) {
153 hciconf->setAuth( true );
154 } else {
155 hciconf->setAuth( false );
156 }
157
158 if ( enablePagescan == 1) {
159 hciconf->setPscan( true );
160 } else {
161 hciconf->setPscan( false );
162 }
163
164 if ( enableInquiryscan == 1) {
165 hciconf->setIscan( true );
166 } else {
167 hciconf->setIscan( false );
168 }
169 }
130 170
@@ -227,2 +267,3 @@ namespace OpieTooth {
227 267
268
228 QMessageBox* box = new QMessageBox( this, "Test" ); 269 QMessageBox* box = new QMessageBox( this, "Test" );
@@ -276,3 +317,3 @@ namespace OpieTooth {
276 */ 317 */
277 void BlueBase::startServiceActionHold( BTListItem * item, const QPoint & point, int column ) { 318 void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) {
278 319
@@ -282,5 +323,6 @@ namespace OpieTooth {
282 323
324
283 //QSize s = menu->sizeHint ( ); 325 //QSize s = menu->sizeHint ( );
284 326
285 if ( item->type() == "device") { 327 if ( ((BTListItem*)item)->type() == "device") {
286 328
@@ -307,3 +349,3 @@ namespace OpieTooth {
307 349
308 } else if ( item->type() == "service") { 350 } else if ( ((BTListItem*)item)->type() == "service") {
309 menu->insertItem( tr("Test1:"), 0); 351 menu->insertItem( tr("Test1:"), 0);
diff --git a/noncore/net/opietooth/manager/bluebase.h b/noncore/net/opietooth/manager/bluebase.h
index 481f0c9..ef67aa2 100644
--- a/noncore/net/opietooth/manager/bluebase.h
+++ b/noncore/net/opietooth/manager/bluebase.h
@@ -47,2 +47,3 @@ namespace OpieTooth {
47 void writeSavedDevices(); 47 void writeSavedDevices();
48 void writeToHciConfig();
48 QString getStatus(); 49 QString getStatus();
@@ -71,3 +72,3 @@ namespace OpieTooth {
71 void startServiceActionClicked( QListViewItem *item ); 72 void startServiceActionClicked( QListViewItem *item );
72 void startServiceActionHold( BTListItem *, const QPoint &, int ); 73 void startServiceActionHold( QListViewItem *, const QPoint &, int );
73 void deviceActive( const QString& mac, bool connected ); 74 void deviceActive( const QString& mac, bool connected );
diff --git a/noncore/net/opietooth/manager/manager.pro b/noncore/net/opietooth/manager/manager.pro
index 39ddcaf..4fcf010 100644
--- a/noncore/net/opietooth/manager/manager.pro
+++ b/noncore/net/opietooth/manager/manager.pro
@@ -3,4 +3,4 @@ CONFIG = qt warn_on debug
3#CONFIG = qt warn_on release 3#CONFIG = qt warn_on release
4HEADERS = bluebase.h scandialog.h btlistitem.h 4HEADERS = bluebase.h scandialog.h btlistitem.h hciconfwrapper.h
5SOURCES = main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp 5SOURCES = main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include