Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rd390fa596f0f36086d017d462924dfd2b46ac56a -r07f5eacb31de016583256f704acaec3ff2196176 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision d390fa596f0f36086d017d462924dfd2b46ac56a) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 07f5eacb31de016583256f704acaec3ff2196176) @@ -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 *************************************************************************/