diff --git a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp index 699d9064..148c70ab 100644 --- a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp @@ -215,14 +215,16 @@ QString CMS50F37Loader::getModel() { if (!model.isEmpty()) return model; + modelsegments = 0; sendCommand(COMMAND_GET_OXIMETER_MODEL); QTime time; time.start(); do { QApplication::processEvents(); - } while (model.isEmpty() && (time.elapsed() < TIMEOUT)); + } while ((modelsegments < 2) && (time.elapsed() < TIMEOUT)); + // Give a little more time for the second one.. QThread::msleep(100); QApplication::processEvents(); @@ -368,9 +370,12 @@ void CMS50F37Loader::processBytes(QByteArray bytes) data = buffer.at(idx+1); if (data == 0) { model = QString(buffer.mid(idx+3, 6)); - qDebug() << "Model:" << model; + modelsegments++; } else { - qDebug() << "Extra Model:" << data; + QString extra = QString(buffer.mid(idx+3, 6)); + model += extra.trimmed(); + modelsegments++; + qDebug() << "Model:" << model; } break; case 0x03: // Vendor string diff --git a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.h b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.h index f387c537..5eb65c8b 100644 --- a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.h +++ b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.h @@ -146,6 +146,8 @@ protected: int timectr; + int modelsegments; + }; diff --git a/sleepyhead/SleepLib/serialoximeter.cpp b/sleepyhead/SleepLib/serialoximeter.cpp index 8dd03b2b..f6450c82 100644 --- a/sleepyhead/SleepLib/serialoximeter.cpp +++ b/sleepyhead/SleepLib/serialoximeter.cpp @@ -25,7 +25,7 @@ QList GetOxiLoaders() return oxiloaders; } -bool SerialOximeter::scanDevice(QString keyword,quint16 vendor_id, quint16 product_id) +bool SerialOximeter::scanDevice(QString keyword, quint16 vendor_id, quint16 product_id) { static bool dumponce = true; QStringList ports;