-rw-r--r-- | noncore/net/opietooth/lib/parser.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/noncore/net/opietooth/lib/parser.cc b/noncore/net/opietooth/lib/parser.cc index 7e95907..d20b9f3 100644 --- a/noncore/net/opietooth/lib/parser.cc +++ b/noncore/net/opietooth/lib/parser.cc @@ -126,80 +126,78 @@ bool Parser::parseClassId( const QString& str) { if (str.startsWith("Service Class ID List:") ) { owarn << "found class id" << oendl; owarn << "line: " << str.latin1() << oendl; m_classOver = true; return true; }else if ( m_classOver && str.startsWith(" " ) ){ // ok now are the informations in place owarn << "line with class id" << oendl; owarn << str.latin1() << oendl; // "Obex Object Push" (0x1105) // find backwards the " and the from 0 to pos and the mid pos+1 // then stripWhiteSpace add name replace '"' with "" // and then convert 0x1105 toInt() QString classes; int ids; ids = convert( str, classes ); owarn << "ids " << ids << oendl; m_item.insertClassId( ids, classes ); return true; }else{ owarn << "Else " << m_classOver << oendl; m_classOver = false; } return false; } bool Parser::parseProtocol( const QString& str) { if (str.startsWith("Protocol Descriptor List:") ) { m_protocolOver = true; m_protocolAdded = false; return true; + }else if (m_protocolOver && str.startsWith(" ") ) { + m_protocolAdded = true; + QString dummy = str.stripWhiteSpace(); + int pos = dummy.findRev(':'); + if ( pos > -1 ) { + int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt(); + Services::ProtocolDescriptor desc( m_protName, m_protId, port ); + m_item.insertProtocolDescriptor( desc ); + } + return true; }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100) - owarn << "double protocol filter" << oendl; if (!m_protocolAdded ) { // the protocol does neither supply a channel nor port so add it now Services::ProtocolDescriptor desc( m_protName, m_protId ); m_item.insertProtocolDescriptor( desc ); } m_protocolAdded = false; { // the find function m_protId = convert(str, m_protName ); } return true; - }else if (m_protocolOver && str.startsWith(" ") ) { - owarn << "tripple protocol filter" << oendl; - m_protocolAdded = true; - QString dummy = str.stripWhiteSpace(); - int pos = dummy.findRev(':'); - if ( pos > -1 ) { - int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt(); - Services::ProtocolDescriptor desc( m_protName, m_protId, port ); - m_item.insertProtocolDescriptor( desc ); - } - return true; }else if (m_protocolOver ) { m_protocolOver = false; } return false; } bool Parser::parseProfile( const QString& str) { if (str.startsWith("Profile Descriptor List:") ) { m_profOver = true; }else if ( m_profOver && str.startsWith(" ") ) { m_profId = convert( str, m_profName ); }else if ( m_profOver && str.startsWith(" ") ) { // now find int pos = str.findRev(':'); if ( pos > 0 ) { int dummy = str.mid(pos+1 ).stripWhiteSpace().toInt(); owarn << "dummyInt: " << dummy << oendl; Services::ProfileDescriptor desc( m_profName, m_profId, dummy ); m_item.insertProfileDescriptor(desc); } }else m_profOver = false; return false; } |