Fix the SetPoint change event.

This commit is contained in:
Jef Driesen 2011-07-07 20:30:37 +02:00
parent 2401731720
commit 7a238281f6

View File

@ -259,33 +259,32 @@ hw_ostc_parser_samples_foreach (parser_t *abstract, sample_callback_t callback,
if (offset + length > size) if (offset + length > size)
return PARSER_STATUS_ERROR; return PARSER_STATUS_ERROR;
// Events. // Get the event byte.
if (events) { if (events) {
// Get the event byte. events = data[offset++];
unsigned int value = data[offset++]; }
// Alarms // Alarms
switch (value & 0x0F) { switch (events & 0x0F) {
case 0: // No Alarm case 0: // No Alarm
case 1: // Slow case 1: // Slow
case 2: // Deco Stop missed case 2: // Deco Stop missed
case 3: // Deep Stop missed case 3: // Deep Stop missed
case 4: // ppO2 Low Warning case 4: // ppO2 Low Warning
case 5: // ppO2 High Warning case 5: // ppO2 High Warning
case 6: // Manual Marker case 6: // Manual Marker
case 7: // Low Battery case 7: // Low Battery
break; break;
} }
// Manual Gas Set // Manual Gas Set
if (value & 0x10) { if (events & 0x10) {
offset += 2; offset += 2;
} }
// Gas Change // Gas Change
if (value & 0x20) { if (events & 0x20) {
offset++; offset++;
}
} }
// Extended sample info. // Extended sample info.
@ -305,6 +304,11 @@ hw_ostc_parser_samples_foreach (parser_t *abstract, sample_callback_t callback,
offset += info[i].size; offset += info[i].size;
} }
} }
// SetPoint Change
if (events & 0x40) {
offset++;
}
} }
if (data[offset] != 0xFD || data[offset + 1] != 0xFD) if (data[offset] != 0xFD || data[offset + 1] != 0xFD)