mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-08 04:00:44 +00:00
Oximetry fix #372349
This commit is contained in:
parent
1ec687a9c6
commit
351680a5df
@ -450,16 +450,16 @@ void CMS50F37Loader::processBytes(QByteArray bytes)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (res == 0x09) {
|
if (res == 0x09) {
|
||||||
msb = quint8(buffer.at(idx+1));
|
quint8 * buf = (unsigned char *)&buffer.data()[idx];
|
||||||
// 9,80,e1,c4,ce,82 // cms50i data
|
// 9,80,e1,c4,ce,82 // cms50i data
|
||||||
// for (int i = 2, msb = buffer.at(idx+1); i < len; i++, msb>>= 1) {
|
for (int i = 2, msb = buf[1]; i < len; i++, msb>>= 1) {
|
||||||
// buffer[idx+i] = (buffer[idx+i] & 0x7f) | (msb & 0x01 ? 0x80 : 0);
|
buf[i] = (buf[i] & 0x7f) | (msb & 0x01 ? 0x80 : 0);
|
||||||
// }
|
}
|
||||||
|
|
||||||
quint16 pi = quint8(buffer.at(idx + 4)) | ((msb & 4) << 5) | (quint16(buffer.at(idx + 5)) << 8);
|
quint16 pi = buf[4] | buf[5] << 8;
|
||||||
|
|
||||||
pulse = quint8(buffer.at(idx+3)) | ((msb & 2 ) << 6);
|
pulse = buf[3];
|
||||||
quint8 spo2 = buffer.at(idx+2);
|
quint8 spo2 = buf[2];
|
||||||
|
|
||||||
oxirec->append(((spo2 == 0) || (pulse == 0) || (pi == 0xfff6)) ? OxiRecord(0,0,0) : OxiRecord(pulse, spo2, pi));
|
oxirec->append(((spo2 == 0) || (pulse == 0) || (pi == 0xfff6)) ? OxiRecord(0,0,0) : OxiRecord(pulse, spo2, pi));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user