summaryrefslogtreecommitdiff
Side-by-side diff
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 @@
#include "scandialog.h"
+#include "hciconfwrapper.h"
@@ -32,3 +33,2 @@
#include <qmessagebox.h>
-#include <qapplication.h>
#include <qcheckbox.h>
@@ -60,4 +60,5 @@ namespace OpieTooth {
this, SLOT( startServiceActionClicked( QListViewItem* ) ) );
+ // hehe, cast right later
connect( ListView2, SIGNAL( rightButtonClicked( QListViewItem *, const QPoint &, int ) ),
- this, SLOT(startServiceActionHold( BTListItem *, const QPoint &, int) ) );
+ this, SLOT(startServiceActionHold( QListViewItem *, const QPoint &, int) ) );
connect( localDevice , SIGNAL( foundServices( const QString& , Services::ValueList ) ),
@@ -92,2 +93,3 @@ namespace OpieTooth {
(void) new BTListItem( topLV2, "BlueNiC" , "", "service" );
+ writeToHciConfig();
}
@@ -128,3 +130,41 @@ namespace OpieTooth {
cfg.writeEntry( "enableInquiryscan" , enableInquiryscan );
-}
+
+ writeToHciConfig();
+ }
+
+ void BlueBase::writeToHciConfig() {
+
+ HciConfWrapper *hciconf = new HciConfWrapper( "/tmp/hcid.conf" );
+ hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" );
+
+
+ // hciconf->setPinHelper( "/bin/QtPalmtop/bin/blue-pin" );
+
+ hciconf->setName( deviceName );
+
+ if ( useEncryption == 1) {
+ hciconf->setEncrypt( true );
+ } else {
+ hciconf->setEncrypt( false );
+ }
+
+
+ if ( enableAuthentification == 1) {
+ hciconf->setAuth( true );
+ } else {
+ hciconf->setAuth( false );
+ }
+
+ if ( enablePagescan == 1) {
+ hciconf->setPscan( true );
+ } else {
+ hciconf->setPscan( false );
+ }
+
+ if ( enableInquiryscan == 1) {
+ hciconf->setIscan( true );
+ } else {
+ hciconf->setIscan( false );
+ }
+ }
@@ -227,2 +267,3 @@ namespace OpieTooth {
+
QMessageBox* box = new QMessageBox( this, "Test" );
@@ -276,3 +317,3 @@ namespace OpieTooth {
*/
- void BlueBase::startServiceActionHold( BTListItem * item, const QPoint & point, int column ) {
+ void BlueBase::startServiceActionHold( QListViewItem * item, const QPoint & point, int column ) {
@@ -282,5 +323,6 @@ namespace OpieTooth {
+
//QSize s = menu->sizeHint ( );
- if ( item->type() == "device") {
+ if ( ((BTListItem*)item)->type() == "device") {
@@ -307,3 +349,3 @@ namespace OpieTooth {
- } else if ( item->type() == "service") {
+ } else if ( ((BTListItem*)item)->type() == "service") {
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 {
void writeSavedDevices();
+ void writeToHciConfig();
QString getStatus();
@@ -71,3 +72,3 @@ namespace OpieTooth {
void startServiceActionClicked( QListViewItem *item );
- void startServiceActionHold( BTListItem *, const QPoint &, int );
+ void startServiceActionHold( QListViewItem *, const QPoint &, int );
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
#CONFIG = qt warn_on release
-HEADERS = bluebase.h scandialog.h btlistitem.h
-SOURCES = main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp
+HEADERS = bluebase.h scandialog.h btlistitem.h hciconfwrapper.h
+SOURCES = main.cpp bluebase.cpp scandialog.cpp btlistitem.cpp hciconfwrapper.cpp
INCLUDEPATH += $(OPIEDIR)/include