Scan for rfcomm device for cms50iw take 2

This commit is contained in:
Mark Watkins 2014-09-19 13:03:34 +10:00
parent d6ee4eada7
commit c250ec40aa
2 changed files with 3 additions and 3 deletions

View File

@ -69,7 +69,7 @@ bool CMS50F37Loader::openDevice()
if (port.isEmpty()) {
bool b = scanDevice("",m_vendorID, m_productID);
if (!b) {
b = scanDevice("rfcomm", 0, 0);
b = scanDevice("rfcomm", 0, 0); // Linux
}
if (!b) {
return false;

View File

@ -39,7 +39,7 @@ bool SerialOximeter::scanDevice(QString keyword,quint16 vendor_id, quint16 produ
QString name = info->portName();
QString desc = info->description();
if ((!keyword.isEmpty() && desc.contains(keyword, Qt::CaseInsensitive)) ||
if ((!keyword.isEmpty() && (desc.contains(keyword, Qt::CaseInsensitive) || name.contains(keyword, Qt::CaseInsensitive))) ||
((info->hasVendorIdentifier() && (info->vendorIdentifier() == vendor_id))
&& (info->hasProductIdentifier() && (info->productIdentifier() == product_id))))
{
@ -54,7 +54,7 @@ bool SerialOximeter::scanDevice(QString keyword,quint16 vendor_id, quint16 produ
qDebug() << dbg.toLocal8Bit().data();
break;
} else if (dumponce) {
QString dbg=QString("Other Serial Port: %1 %2 %3 %4").arg(name).arg(desc).arg(info->manufacturer()).arg(info->systemLocation());
QString dbg=QString("Other Serial Port: Name: %1 Desc: %2 Manufacturer: %3 Location: %4").arg(name).arg(desc).arg(info->manufacturer()).arg(info->systemLocation());
if (info->hasProductIdentifier()) //60000
dbg += QString(" PID: %1").arg(info->productIdentifier());