Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -r3c0614e16047ada1ea30c9e7f883f78d98b363e3 -r06a16fec63eebb36633c42925aefecc8d452755f --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 3c0614e16047ada1ea30c9e7f883f78d98b363e3) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 06a16fec63eebb36633c42925aefecc8d452755f) @@ -1210,7 +1210,7 @@ break; case MSG_ID_UI_INSTITUTIONAL_RECORD_REQUEST: - sendInstitutionalRecordToUI( message ); + handleSendInstitutionalRecordToUI( message ); break; // NOTE: this always must be the last case Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r3741b7bb1a2e35a0b3618a9212f277f1937ee75f -r06a16fec63eebb36633c42925aefecc8d452755f --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3741b7bb1a2e35a0b3618a9212f277f1937ee75f) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 06a16fec63eebb36633c42925aefecc8d452755f) @@ -65,6 +65,35 @@ } BLOCKED_MSGS_DATA_T; #pragma pack(pop) +typedef struct +{ + U32 minBloodFlowMLPM; ///< Min blood flow in mL/min. + U32 maxBloodFlowMLPM; ///< Max blood flow in mL/min. + U32 minDialysateFlowMLPM; ///< Min dialysate flow in mL/min. + U32 maxDialysateFlowMLPM; ///< Max dialysate flow in mL/min. + U32 minTxDurationMIN; ///< Min treatment duration in minutes. + U32 maxTxDurationMIN; ///< Max treatment duration in minutes. + U32 minStopHeparinDispBeforeTxEndMIN; ///< Min stop heparin dispense before treatment end in minutes. + U32 maxStopHeparinDispBeforeTxEndMIN; ///< Max stop heparin dispense before treatment end in minutes. + U32 minSalineBolusVolumeML; ///< Min saline bolus volume in milliliters. + U32 maxSalineBolusVolumeML; ///< Max saline bolus volume in milliliters. + F32 minDialysateTempC; ///< Min dialysate temperature in C. + F32 maxDialysateTempC; ///< Max dialysate temperature in C. + S32 minArtPressLimitWindowMMHG; ///< Min arterial pressure limit window in mmHg. + S32 maxArtPressLimitWindowMMHG; ///< Max arterial pressure limit window in mmHg. + S32 minVenPressLimitWindowMMHG; ///< Min venous pressure limit window in mmHg. + S32 maxVenPressLimitWindowMMHG; ///< Max venous pressure limit window in mmHg. + S32 minVenAsymPressLimitMMHG; ///< Min venous asymmetric pressure limit in mmHg. + S32 maxVenAsymPressLimitMMHG; ///< Max venous asymmetric pressure limit in mmHg. + F32 minUFVolumeL; ///< Min ultrafiltration volume in mL. + F32 maxUFVolumeL; ///< Max ultrafiltration volume in mL. + F32 minHeparinDispRateMLPHR; ///< Min heparin dispense rate in mL/hr. + F32 maxHeparinDispRateMLPHR; ///< Max heparin dispense rate in mL/hr. + F32 minHeparinBolusVolumeML; ///< Min heparin bolus volume in mL. + F32 maxHeparinBolusVolumeML; ///< Max heparin bolus volume in mL. + U32 enableChemicalDisinfect; ///< Enable/disable chemical disinfect. +} HD_INSTITUTIONAL_LOCAL_RECORD_T; + // ********** private data ********** static BOOL testerLoggedIn = FALSE; ///< Flag indicates whether an external tester (connected PC) has sent a valid login message. @@ -78,6 +107,7 @@ static BOOL sendTestAckResponseMsg( MSG_ID_T msgID, BOOL ack ); static BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ); static BOOL sendUIResponseMsg( MSG_ID_T msgID, BOOL accepted, U32 reason ); +static void sendInstitutionalRecordToUI( HD_INSTITUTIONAL_LOCAL_RECORD_T* instit ); /*********************************************************************//** * @brief @@ -3595,33 +3625,54 @@ /*********************************************************************//** * @brief - * The sendInstitutionalRecordToUI function sends the institutional record to UI + * The handleSendInstitutionalRecordToUI function sends the institutional record to UI * @details Inputs: none * @details Outputs: none * @param message a pointer to the message to handle * @return none *************************************************************************/ -void sendInstitutionalRecordToUI( MESSAGE_T* message ) +void handleSendInstitutionalRecordToUI( MESSAGE_T* message ) { + if ( 0 == message->hdr.payloadLen ) + { + HD_INSTITUTIONAL_RECORD_T hdInstitutionalRecord; + HD_INSTITUTIONAL_LOCAL_RECORD_T hdInstitutionalLocalRecord; + + getNVRecord2Driver( GET_INSTITUTIONAL_RECORD, (U08*)&hdInstitutionalRecord, sizeof( HD_INSTITUTIONAL_RECORD_T ), 0, ALARM_ID_NO_ALARM ); + + memcpy( &hdInstitutionalLocalRecord, &hdInstitutionalRecord, sizeof( HD_INSTITUTIONAL_LOCAL_RECORD_T ) ); + + sendInstitutionalRecordToUI( &hdInstitutionalLocalRecord ); + } +} + +/*********************************************************************//** + * @brief + * The sendInstitutionalRecordToUI function sends the institutional record to UI + * @details Inputs: none + * @details Outputs: none + * @param instit a pointer to the local institutional recored in the system + * messages that is without calibration time and crc + * @return none + *************************************************************************/ +static void sendInstitutionalRecordToUI( HD_INSTITUTIONAL_LOCAL_RECORD_T* instit ) +{ MESSAGE_T msg; - U08 *payloadPtr = msg.payload; + U08 *payloadPtr = msg.payload; U32 accept = 1; - U32 reson = 0; - HD_INSTITUTIONAL_RECORD_T hdInstitutionalRecord; + U32 reason = 0; - getNVRecord2Driver( GET_INSTITUTIONAL_RECORD, (U08*)&hdInstitutionalRecord, sizeof( HD_INSTITUTIONAL_RECORD_T ), 0, ALARM_ID_NO_ALARM ); - // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_HD_INSTITUTIONAL_RECORD_RESPONSE; - msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ) + sizeof( HD_INSTITUTIONAL_RECORD_T ) - sizeof( U32 ) - sizeof( U16 ); + msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ) + sizeof( HD_INSTITUTIONAL_LOCAL_RECORD_T ); memcpy( payloadPtr, &accept, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); - memcpy( payloadPtr, &reson, sizeof( U32 ) ); + memcpy( payloadPtr, &reason, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); - memcpy( payloadPtr, &hdInstitutionalRecord, sizeof( HD_INSTITUTIONAL_RECORD_T ) - sizeof( U32 ) - sizeof( U16 ) ); + memcpy( payloadPtr, instit, sizeof( HD_INSTITUTIONAL_LOCAL_RECORD_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_UI, ACK_NOT_REQUIRED ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r3c0614e16047ada1ea30c9e7f883f78d98b363e3 -r06a16fec63eebb36633c42925aefecc8d452755f --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 3c0614e16047ada1ea30c9e7f883f78d98b363e3) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 06a16fec63eebb36633c42925aefecc8d452755f) @@ -559,7 +559,7 @@ void handleReceiveROPermeateSampleReadyToDispenseFromDG( MESSAGE_T* message ); // MSG_ID_UI_INSTITUTIONAL_RECORD_REQUEST -void sendInstitutionalRecordToUI( MESSAGE_T* message ); +void handleSendInstitutionalRecordToUI( MESSAGE_T* message ); // *********** public test support message functions **********