Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r371355c43e19849e5b1dd27286f62f4424d07ccf -r7fe065949ae95d4151a6075ff2522a707b42784c --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 371355c43e19849e5b1dd27286f62f4424d07ccf) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 7fe065949ae95d4151a6075ff2522a707b42784c) @@ -93,6 +93,8 @@ F32 minHeparinBolusVolumeML; ///< Min heparin bolus volume in mL. F32 maxHeparinBolusVolumeML; ///< Max heparin bolus volume in mL. U32 enableChemicalDisinfect; ///< Enable/disable chemical disinfect. + U32 minRORejectionRatioPCT; ///< Min RO rejection ratio in percent. + F32 minInletWaterCondAlarmLimitUSPCM; ///< Min inlet water conductivity alarm limit in uS/cm. } HD_INSTITUTIONAL_LOCAL_RECORD_T; typedef struct @@ -3758,7 +3760,38 @@ return result; } +/*********************************************************************//** + * @brief + * The handleDGRequestInstitutionalValues function handles the DG request + * to receive the DG institutional values from HD institutional record. + * @details Inputs: none + * @details Outputs: none + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleDGRequestInstitutionalValues( MESSAGE_T* message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + MESSAGE_T msg; + DG_INSTITUTIONAL_VALUES_T dgInstitValues; + dgInstitValues.minRORejectionRatioPCT = getMinRORejectionRatioInInstitRecordPCT(); + dgInstitValues.minInletWaterCondAlarmLimitUSPCM = getMinInletWaterConductivityLimitInstitRecordUSPCM(); + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_INSTIT_VALUES_FROM_HD_INSTIT_RECORD_RESPONSE; + msg.hdr.payloadLen = sizeof( DG_INSTITUTIONAL_VALUES_T ); + + memcpy( msg.payload, &dgInstitValues, sizeof( DG_INSTITUTIONAL_VALUES_T ) ); + + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_DG, ACK_REQUIRED ); + } +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/