summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/device.cc35
1 files changed, 32 insertions, 3 deletions
diff --git a/noncore/net/opietooth/lib/device.cc b/noncore/net/opietooth/lib/device.cc
index eea1178..40acbd2 100644
--- a/noncore/net/opietooth/lib/device.cc
+++ b/noncore/net/opietooth/lib/device.cc
@@ -6,2 +6,4 @@
6#include <opie2/odebug.h> 6#include <opie2/odebug.h>
7#include <opie2/odevice.h>
8
7using namespace Opie::Core; 9using namespace Opie::Core;
@@ -16,3 +18,4 @@ using Opie::Core::OProcess;
16namespace { 18namespace {
17 int parsePid( const QCString& par ){ 19 int parsePid( const QCString& par )
20 {
18 int id=0; 21 int id=0;
@@ -20,5 +23,18 @@ namespace {
20 QStringList list = QStringList::split( '\n', string ); 23 QStringList list = QStringList::split( '\n', string );
21 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ 24
25 for( QStringList::Iterator it = list.begin(); it != list.end(); ++it )
26 {
22 owarn << "parsePID: " << (*it).latin1() << oendl; 27 owarn << "parsePID: " << (*it).latin1() << oendl;
23 if( !(*it).startsWith("CSR") ){ 28
29 // FIXME mbhaynie: Surely there is a better way to skip
30 // verbosity (E.g. the TI device configuration
31 // script). Apparently the PID is always on a line by
32 // itself, or is at least the first word of a line. Does
33 // QString have somethine like startsWithRegex("[0-9]+")?
34 if( (*it).startsWith("#") ) continue;
35 if( (*it).startsWith("TI") ) continue;
36 if( (*it).startsWith("Loading") ) continue;
37 if( (*it).startsWith("BTS") ) continue;
38 if( !(*it).startsWith("CSR") )
39 {
24 id = (*it).toInt(); 40 id = (*it).toInt();
@@ -46,2 +62,6 @@ Device::~Device(){
46} 62}
63
64// FIXME mbhaynie -- If BT is active, and opie is restarted, this
65// applet thinks bt is down, and will fail to start it again. Not
66// sure why.
47void Device::attach(){ 67void Device::attach(){
@@ -54,3 +74,12 @@ void Device::attach(){
54 *m_process << "-p"; 74 *m_process << "-p";
75
76 // FIXME -- this is a hack for an odd hciattach interface.
77 if ( ODevice::inst()->modelString() == "HX4700" )
78 {
79 *m_process << "-S" << "/etc/bluetooth/TIInit_3.2.26.bts" << "/dev/ttyS1" << "texas";
80 }
81 else
82 {
55 *m_process << m_device << m_mode << m_speed; 83 *m_process << m_device << m_mode << m_speed;
84 }
56 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ), 85 connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ),