author | mickeyl <mickeyl> | 2005-08-21 22:32:50 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2005-08-21 22:32:50 (UTC) |
commit | 140e4dc44a29678de1ae8b2cef5b1d081993223e (patch) (side-by-side diff) | |
tree | 70b0875f779f6a4a327e583207664f4396ecc141 | |
parent | 4def5629dc68465b1dc8bb23c115e2f5f7513804 (diff) | |
download | opie-140e4dc44a29678de1ae8b2cef5b1d081993223e.zip opie-140e4dc44a29678de1ae8b2cef5b1d081993223e.tar.gz opie-140e4dc44a29678de1ae8b2cef5b1d081993223e.tar.bz2 |
Add support for some unusual requirements of the iPAQ hx4700 BT interface.
Patch courtesy Michael Haynie - thanks!
-rw-r--r-- | noncore/net/opietooth/lib/device.cc | 55 |
1 files changed, 42 insertions, 13 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 @@ #include <opie2/odebug.h> +#include <opie2/odevice.h> + using namespace Opie::Core; @@ -16,15 +18,29 @@ using Opie::Core::OProcess; namespace { - int parsePid( const QCString& par ){ - int id=0; - QString string( par ); - QStringList list = QStringList::split( '\n', string ); - for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ){ - owarn << "parsePID: " << (*it).latin1() << oendl; - if( !(*it).startsWith("CSR") ){ - id = (*it).toInt(); - break; - } + int parsePid( const QCString& par ) + { + int id=0; + QString string( par ); + QStringList list = QStringList::split( '\n', string ); + + for( QStringList::Iterator it = list.begin(); it != list.end(); ++it ) + { + owarn << "parsePID: " << (*it).latin1() << oendl; + + // FIXME mbhaynie: Surely there is a better way to skip + // verbosity (E.g. the TI device configuration + // script). Apparently the PID is always on a line by + // itself, or is at least the first word of a line. Does + // QString have somethine like startsWithRegex("[0-9]+")? + if( (*it).startsWith("#") ) continue; + if( (*it).startsWith("TI") ) continue; + if( (*it).startsWith("Loading") ) continue; + if( (*it).startsWith("BTS") ) continue; + if( !(*it).startsWith("CSR") ) + { + id = (*it).toInt(); + break; + } + } + return id; } - return id; - } } @@ -46,2 +62,6 @@ Device::~Device(){ } + +// FIXME mbhaynie -- If BT is active, and opie is restarted, this +// applet thinks bt is down, and will fail to start it again. Not +// sure why. void Device::attach(){ @@ -54,3 +74,12 @@ void Device::attach(){ *m_process << "-p"; - *m_process << m_device << m_mode << m_speed; + + // FIXME -- this is a hack for an odd hciattach interface. + if ( ODevice::inst()->modelString() == "HX4700" ) + { + *m_process << "-S" << "/etc/bluetooth/TIInit_3.2.26.bts" << "/dev/ttyS1" << "texas"; + } + else + { + *m_process << m_device << m_mode << m_speed; + } connect(m_process, SIGNAL( processExited(Opie::Core::OProcess*) ), |