From eb30b5af54d657c5f51a80fced64c901b8d3e764 Mon Sep 17 00:00:00 2001 From: Slavek Banko Date: Tue, 25 Jul 2006 21:58:42 +0200 Subject: [PATCH] opie-bluetoothapplet: use information provided by blueprobe to determine device nodes. Signed-off-by: Rene Wagner --- .../files/sysconfig-bluetooth.patch | 70 +++++++++++++++++++ .../opie-bluetoothapplet_1.2.1.bb | 8 ++- 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 org.handhelds.familiar/packages/opie-bluetoothapplet/files/sysconfig-bluetooth.patch 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 + #include + #include ++#include ++#include + + /* STD */ + #include +@@ -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" -- 2.41.1