From 88bd03852df672da133f149b9f3bbb51712e30d4 Mon Sep 17 00:00:00 2001 From: Mark Watkins Date: Wed, 20 Aug 2014 00:58:33 +1000 Subject: [PATCH] Oximetry fix #372347 --- sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp index 505bc83f..b47671f8 100644 --- a/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp +++ b/sleepyhead/SleepLib/loader_plugins/cms50f37_loader.cpp @@ -456,12 +456,12 @@ void CMS50F37Loader::processBytes(QByteArray bytes) buffer[idx+i] = (buffer[idx+i] & 0x7f) | (msb & 0x01 ? 0x80 : 0); } - quint16 pi = (quint8)buffer.at(idx + 4) | (buffer.at(idx + 5) << 8); + quint16 pi = quint8(buffer.at(idx + 4)) | (quint16(buffer.at(idx + 5)) << 8); pulse = buffer.at(idx+3); quint8 spo2 = buffer.at(idx+2); - oxirec->append((spo2 == 0) ? OxiRecord(0,0,0) : OxiRecord(pulse, spo2, pi)); + oxirec->append(((spo2 == 0) || (pulse == 0) || (pi == 0xfff6)) ? OxiRecord(0,0,0) : OxiRecord(pulse, spo2, pi)); } else if (res == 0x0f) { // f,80,de,c2,de,c2,de,c2 cms50F data...