summaryrefslogtreecommitdiff
path: root/noncore/net/opietooth
Unidiff
Diffstat (limited to 'noncore/net/opietooth') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/opietooth/lib/parser.cc22
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
@@ -152,35 +152,33 @@ bool Parser::parseClassId( const QString& str) {
152bool Parser::parseProtocol( const QString& str) { 152bool Parser::parseProtocol( const QString& str) {
153 if (str.startsWith("Protocol Descriptor List:") ) { 153 if (str.startsWith("Protocol Descriptor List:") ) {
154 m_protocolOver = true; 154 m_protocolOver = true;
155 m_protocolAdded = false; 155 m_protocolAdded = false;
156 return true; 156 return true;
157 157
158 }else if (m_protocolOver && str.startsWith(" ") ) {
159 m_protocolAdded = true;
160 QString dummy = str.stripWhiteSpace();
161 int pos = dummy.findRev(':');
162 if ( pos > -1 ) {
163 int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt();
164 Services::ProtocolDescriptor desc( m_protName, m_protId, port );
165 m_item.insertProtocolDescriptor( desc );
166 }
167 return true;
158 }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100) 168 }else if (m_protocolOver && str.startsWith(" ") ) { // "L2CAP" (0x0100)
159 owarn << "double protocol filter" << oendl;
160 169
161 if (!m_protocolAdded ) { // the protocol does neither supply a channel nor port so add it now 170 if (!m_protocolAdded ) { // the protocol does neither supply a channel nor port so add it now
162 Services::ProtocolDescriptor desc( m_protName, m_protId ); 171 Services::ProtocolDescriptor desc( m_protName, m_protId );
163 m_item.insertProtocolDescriptor( desc ); 172 m_item.insertProtocolDescriptor( desc );
164 } 173 }
165 m_protocolAdded = false; 174 m_protocolAdded = false;
166 { // the find function 175 { // the find function
167 m_protId = convert(str, m_protName ); 176 m_protId = convert(str, m_protName );
168 } 177 }
169 return true; 178 return true;
170 }else if (m_protocolOver && str.startsWith(" ") ) {
171 owarn << "tripple protocol filter" << oendl;
172 m_protocolAdded = true;
173 QString dummy = str.stripWhiteSpace();
174 int pos = dummy.findRev(':');
175 if ( pos > -1 ) {
176 int port = dummy.mid(pos+1 ).stripWhiteSpace().toInt();
177 Services::ProtocolDescriptor desc( m_protName, m_protId, port );
178 m_item.insertProtocolDescriptor( desc );
179 }
180 return true;
181 }else if (m_protocolOver ) { 179 }else if (m_protocolOver ) {
182 m_protocolOver = false; 180 m_protocolOver = false;
183 } 181 }
184 return false; 182 return false;
185} 183}
186bool Parser::parseProfile( const QString& str) { 184bool Parser::parseProfile( const QString& str) {