diff options
author | Slavek Banko <slavek.banko@axis.cz> | 2006-07-25 21:58:42 +0200 |
---|---|---|
committer | Rene Wagner <rw@handhelds.org> | 2006-07-25 21:58:42 +0200 |
commit | eb30b5af54d657c5f51a80fced64c901b8d3e764 (patch) | |
tree | 18f026ffa50b33e40fa93736c36ca060197a2d1c | |
parent | 324445b861576465296ef56a3d50ebf8a82f52ca (diff) |
opie-bluetoothapplet: use information provided by blueprobe to determine device nodes.
Signed-off-by: Rene Wagner <rw@handhelds.org>
-rw-r--r-- | org.handhelds.familiar/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch | 70 | ||||
-rw-r--r-- | org.handhelds.familiar/packages/opie-bluetoothapplet/opie-bluetoothapplet_1.2.1.bb | 8 |
2 files changed, 76 insertions, 2 deletions
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 index 0000000..91a483c --- /dev/null +++ b/org.handhelds.familiar/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch @@ -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 ) { diff --git a/org.handhelds.familiar/packages/opie-bluetoothapplet/opie-bluetoothapplet_1.2.1.bb b/org.handhelds.familiar/packages/opie-bluetoothapplet/opie-bluetoothapplet_1.2.1.bb index 43d21d8..237214d 100644 --- a/org.handhelds.familiar/packages/opie-bluetoothapplet/opie-bluetoothapplet_1.2.1.bb +++ b/org.handhelds.familiar/packages/opie-bluetoothapplet/opie-bluetoothapplet_1.2.1.bb @@ -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" |