Send a "machine state snapshot" message.
632 uint8_t currentAlarmSize = 0;
634 if (currentAlarmCodes[
i] != 0u) {
641 uint8_t ventilationModeValue;
642 switch (ventilationMode) {
644 ventilationModeValue = 1u;
647 ventilationModeValue = 2u;
650 ventilationModeValue = 3u;
653 ventilationModeValue = 4u;
656 ventilationModeValue = 5u;
659 ventilationModeValue = 0u;
665 crc32.update(
"S:", 2);
670 crc32.update(
static_cast<uint8_t
>(strlen(
VERSION)));
677 crc32.update(
"\t", 1);
682 crc32.update(systick, 8);
685 crc32.update(
"\t", 1);
690 crc32.update(cycle, 4);
693 crc32.update(
"\t", 1);
696 crc32.update(peakCommand);
699 crc32.update(
"\t", 1);
702 crc32.update(plateauCommand);
705 crc32.update(
"\t", 1);
708 crc32.update(peepCommand);
711 crc32.update(
"\t", 1);
714 crc32.update(cpmCommand);
717 crc32.update(
"\t", 1);
719 byte previousPeakPressure[2];
720 toBytes16(previousPeakPressure, previousPeakPressureValue);
721 Serial6.write(previousPeakPressure, 2);
722 crc32.update(previousPeakPressure, 2);
725 crc32.update(
"\t", 1);
727 byte previousPlateauPressure[2];
728 toBytes16(previousPlateauPressure, previousPlateauPressureValue);
729 Serial6.write(previousPlateauPressure, 2);
730 crc32.update(previousPlateauPressure, 2);
733 crc32.update(
"\t", 1);
735 byte previousPeepPressure[2];
736 toBytes16(previousPeepPressure, previousPeepPressureValue);
737 Serial6.write(previousPeepPressure, 2);
738 crc32.update(previousPeepPressure, 2);
741 crc32.update(
"\t", 1);
743 Serial6.write(currentAlarmSize);
744 crc32.update(currentAlarmSize);
745 Serial6.write(currentAlarmCodes, currentAlarmSize);
746 crc32.update(currentAlarmCodes, currentAlarmSize);
749 crc32.update(
"\t", 1);
754 crc32.update(volume, 2);
757 crc32.update(
"\t", 1);
760 crc32.update(expiratoryTerm);
763 crc32.update(
"\t", 1);
766 crc32.update(triggerEnabled);
769 crc32.update(
"\t", 1);
772 crc32.update(triggerOffset);
775 crc32.update(
"\t", 1);
777 Serial6.write(previouscpmValue);
778 crc32.update(previouscpmValue);
781 crc32.update(
"\t", 1);
784 crc32.update(alarmSnoozed);
787 crc32.update(
"\t", 1);
790 crc32.update(cpuLoad);
793 crc32.update(
"\t", 1);
795 Serial6.write(ventilationModeValue);
796 crc32.update(ventilationModeValue);
799 crc32.update(
"\t", 1);
801 Serial6.write(inspiratoryTriggerFlow);
802 crc32.update(inspiratoryTriggerFlow);
805 crc32.update(
"\t", 1);
807 Serial6.write(expiratoryTriggerFlow);
808 crc32.update(expiratoryTriggerFlow);
811 crc32.update(
"\t", 1);
816 crc32.update(tiMin, 2);
819 crc32.update(
"\t", 1);
824 crc32.update(tiMax, 2);
827 crc32.update(
"\t", 1);
829 Serial6.write(lowInspiratoryMinuteVolumeAlarmThreshold);
830 crc32.update(lowInspiratoryMinuteVolumeAlarmThreshold);
833 crc32.update(
"\t", 1);
835 Serial6.write(highInspiratoryMinuteVolumeAlarmThreshold);
836 crc32.update(highInspiratoryMinuteVolumeAlarmThreshold);
839 crc32.update(
"\t", 1);
841 Serial6.write(lowExpiratoryMinuteVolumeAlarmThreshold);
842 crc32.update(lowExpiratoryMinuteVolumeAlarmThreshold);
845 crc32.update(
"\t", 1);
847 Serial6.write(highExpiratoryMinuteVolumeAlarmThreshold);
848 crc32.update(highExpiratoryMinuteVolumeAlarmThreshold);
851 crc32.update(
"\t", 1);
853 Serial6.write(lowRespiratoryRateAlarmThreshold);
854 crc32.update(lowRespiratoryRateAlarmThreshold);
857 crc32.update(
"\t", 1);
859 Serial6.write(highRespiratoryRateAlarmThreshold);
860 crc32.update(highRespiratoryRateAlarmThreshold);
863 crc32.update(
"\t", 1);
865 byte targetTidalVolume[2];
866 toBytes16(targetTidalVolume, targetTidalVolumeValue);
867 Serial6.write(targetTidalVolume, 2);
868 crc32.update(targetTidalVolume, 2);
871 crc32.update(
"\t", 1);
873 byte lowTidalVolumeAlarmThreshold[2];
874 toBytes16(lowTidalVolumeAlarmThreshold, lowTidalVolumeAlarmThresholdValue);
875 Serial6.write(lowTidalVolumeAlarmThreshold, 2);
876 crc32.update(lowTidalVolumeAlarmThreshold, 2);
879 crc32.update(
"\t", 1);
881 byte highTidalVolumeAlarmThreshold[2];
882 toBytes16(highTidalVolumeAlarmThreshold, highTidalVolumeAlarmThresholdValue);
883 Serial6.write(highTidalVolumeAlarmThreshold, 2);
884 crc32.update(highTidalVolumeAlarmThreshold, 2);
887 crc32.update(
"\t", 1);
889 byte plateauDuration[2];
890 toBytes16(plateauDuration, plateauDurationValue);
891 Serial6.write(plateauDuration, 2);
892 crc32.update(plateauDuration, 2);
895 crc32.update(
"\t", 1);
897 byte leakAlarmThreshold[2];
898 toBytes16(leakAlarmThreshold, leakAlarmThresholdValue);
899 Serial6.write(leakAlarmThreshold, 2);
900 crc32.update(leakAlarmThreshold, 2);
903 crc32.update(
"\t", 1);
905 Serial6.write(targetInspiratoryFlow);
906 crc32.update(targetInspiratoryFlow);
909 crc32.update(
"\t", 1);
911 byte inspiratoryDurationCommand[2];
912 toBytes16(inspiratoryDurationCommand, inspiratoryDurationCommandValue);
913 Serial6.write(inspiratoryDurationCommand, 2);
914 crc32.update(inspiratoryDurationCommand, 2);
917 crc32.update(
"\t", 1);
919 byte previousInspiratoryDuration[2];
920 toBytes16(previousInspiratoryDuration, previousInspiratoryDurationValue);
921 Serial6.write(previousInspiratoryDuration, 2);
922 crc32.update(previousInspiratoryDuration, 2);
925 crc32.update(
"\t", 1);
927 byte batteryLevel[2];
928 toBytes16(batteryLevel, batteryLevelValue);
929 Serial6.write(batteryLevel, 2);
930 crc32.update(batteryLevel, 2);
933 crc32.update(
"\t", 1);
938 crc32.update(locale, 2);
941 crc32.update(
"\t", 1);
944 crc32.update(patientHeight);
947 crc32.update(
"\t", 1);
950 crc32.update(patientGender);
953 crc32.update(
"\t", 1);
955 byte peakPressureAlarmThreshold[2];
956 toBytes16(peakPressureAlarmThreshold, peakPressureAlarmThresholdValue);
957 Serial6.write(peakPressureAlarmThreshold, 2);
958 crc32.update(peakPressureAlarmThreshold, 2);
961 crc32.update(
"\n", 1);