]> pilppa.com Git - familiar-h63xx-build.git/commitdiff
opie-bluetoothapplet: use information provided by blueprobe to determine device nodes.
authorSlavek Banko <slavek.banko@axis.cz>
Tue, 25 Jul 2006 19:58:42 +0000 (21:58 +0200)
committerRene Wagner <rw@handhelds.org>
Tue, 25 Jul 2006 19:58:42 +0000 (21:58 +0200)
Signed-off-by: Rene Wagner <rw@handhelds.org>
org.handhelds.familiar/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch [new file with mode: 0644]
org.handhelds.familiar/packages/opie-bluetoothapplet/opie-bluetoothapplet_1.2.1.bb

diff --git a/org.handhelds.familiar/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch b/org.handhelds.familiar/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch
new file mode 100644 (file)
index 0000000..91a483c
--- /dev/null
@@ -0,0 +1,70 @@
+Index: bluezapplet.cpp
+===================================================================
+RCS file: /cvs/opie/noncore/net/opietooth/applet/bluezapplet.cpp,v
+retrieving revision 1.20
+diff -u -r1.20 bluezapplet.cpp
+--- applet/bluezapplet.cpp     29 Aug 2005 21:27:26 -0000      1.20
++++ applet/bluezapplet.cpp     5 Jul 2006 22:21:22 -0000
+@@ -49,6 +49,8 @@
+ #include <qstring.h>
+ #include <qtimer.h>
+ #include <qpopupmenu.h>
++#include <qfile.h>
++#include <qtextstream.h>
+ /* STD */
+ #include <device.h>
+@@ -103,18 +105,41 @@
+     int BluezApplet::setBluezStatus(int c) {
+         if ( c == 1 ) {
+-            switch ( ODevice::inst()->model() ) {
+-            case Model_iPAQ_H39xx:
+-                btDevice = new Device( "/dev/tts/1", "bcsp", "921600" );
+-                break;
+-
+-          case Model_iPAQ_H5xxx:
+-              btDevice = new Device( "/dev/tts/1", "any", "921600" );
+-              break;
+-
+-            default:
+-                btDevice = new Device( "/dev/ttySB0", "bcsp", "230400" );
+-                break;
++          QFile cfg("/etc/sysconfig/bluetooth");
++          if(cfg.open(IO_ReadOnly)) {
++              QTextStream stream (&cfg);
++              QString streamIn = stream.read();
++              QStringList list = QStringList::split("\n", streamIn);
++              cfg.close();
++              if(list.grep("BLUETOOTH_PORT=").count() > 0 &&
++                   list.grep("BLUETOOTH_PROTOCOL=").count() > 0 &&
++                   list.grep("BLUETOOTH_SPEED=").count() > 0) {
++                  btDevice = new Device( list.grep("BLUETOOTH_PORT=")[0].
++                                           replace((QString)"BLUETOOTH_PORT=", ""),
++                                           list.grep("BLUETOOTH_PROTOCOL=")[0].
++                                           replace((QString)"BLUETOOTH_PROTOCOL=", ""),
++                                           list.grep("BLUETOOTH_SPEED=")[0].
++                                           replace((QString)"BLUETOOTH_SPEED=", ""));
++              }
++          }
++          if(!btDevice) {
++                switch ( ODevice::inst()->model() ) {
++              case Model_iPAQ_H39xx:
++                  btDevice = new Device( "/dev/tts/1", "bcsp", "921600" );
++                  break;
++
++              case Model_iPAQ_H5xxx:
++                  btDevice = new Device( "/dev/tts/1", "any", "921600" );
++                  break;
++
++              case Model_iPAQ_H22xx:
++                  btDevice = new Device( "/dev/tts/3", "any", "921600" );
++                  break;
++
++              default:
++                  btDevice = new Device( "/dev/ttySB0", "bcsp", "230400" );
++                  break;
++              }
+             }
+         } else {
+             if ( btDevice ) {
index 43d21d82db8a502833cab832781c71ea564a5244..237214dbf6fbe60dbf7ee63821481fc646bd2ffe 100644 (file)
@@ -1,6 +1,10 @@
 include ${PN}.inc
+
+PR = "r1"
     
+DEPENDS += "blueprobe"
+RDEPENDS += "blueprobe"
 
 SRC_URI = "${HANDHELDS_CVS};tag=${TAG};module=opie/noncore/net/opietooth/applet \
-           ${HANDHELDS_CVS};tag=${TAG};module=opie/pics/bluetoothapplet"
+           ${HANDHELDS_CVS};tag=${TAG};module=opie/pics/bluetoothapplet \
+          file://sysconfig-bluetooth.patch;patch=1"