From c245eb5a0c8e62ece43541f15dc942e3fc25b541 Mon Sep 17 00:00:00 2001 From: sawinglogz <3787776-sawinglogz@users.noreply.gitlab.com> Date: Mon, 16 Aug 2021 10:43:42 -0400 Subject: [PATCH] Update unexpected data alert for PRS1 900X110 based on new sample data. Also add support for auto-trial duration on 460P. --- oscar/SleepLib/loader_plugins/prs1_parser_asv.cpp | 2 +- oscar/SleepLib/loader_plugins/prs1_parser_xpap.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/oscar/SleepLib/loader_plugins/prs1_parser_asv.cpp b/oscar/SleepLib/loader_plugins/prs1_parser_asv.cpp index a5fb6526..f13ce76c 100644 --- a/oscar/SleepLib/loader_plugins/prs1_parser_asv.cpp +++ b/oscar/SleepLib/loader_plugins/prs1_parser_asv.cpp @@ -1260,7 +1260,7 @@ bool PRS1DataChunk::ParseSettingsF5V3(const unsigned char* data, int size) breath_rate = data[pos+1]; timed_inspiration = data[pos+2]; if (breath_rate < 4 || breath_rate > 16) UNEXPECTED_VALUE(breath_rate, "4-16"); - if (timed_inspiration < 12 || timed_inspiration > 24) UNEXPECTED_VALUE(timed_inspiration, "12-24"); + if (timed_inspiration < 12 || timed_inspiration > 25) UNEXPECTED_VALUE(timed_inspiration, "12-25"); this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_BACKUP_BREATH_MODE, PRS1Backup_Fixed)); this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_BACKUP_BREATH_RATE, breath_rate)); // BPM this->AddEvent(new PRS1ScaledSettingEvent(PRS1_SETTING_BACKUP_TIMED_INSPIRATION, timed_inspiration, 0.1)); diff --git a/oscar/SleepLib/loader_plugins/prs1_parser_xpap.cpp b/oscar/SleepLib/loader_plugins/prs1_parser_xpap.cpp index c5643505..9f2e9b6f 100644 --- a/oscar/SleepLib/loader_plugins/prs1_parser_xpap.cpp +++ b/oscar/SleepLib/loader_plugins/prs1_parser_xpap.cpp @@ -1100,10 +1100,12 @@ bool PRS1DataChunk::ParseSettingsF0V45(const unsigned char* data, int size) // TODO: Where is altitude compensation set? We've seen it on 261CA. CHECK_VALUE(data[0x10], 0); + int autotrial_duration = data[0x11]; if (cpapmode == PRS1_MODE_AUTOTRIAL) { - CHECK_VALUE(data[0x11], 7); // 7-day duration? + CHECK_VALUES(autotrial_duration, 7, 30); + this->AddEvent(new PRS1ParsedSettingEvent(PRS1_SETTING_AUTO_TRIAL, autotrial_duration)); } else { - CHECK_VALUE(data[0x11], 0); + CHECK_VALUE(autotrial_duration, 0); } return true;