Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r4add377f60d45effbdc064b110a59c1b8afd0ab8 -red3e4d4180a4c0f08af285426c247aadfc685847 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 4add377f60d45effbdc064b110a59c1b8afd0ab8) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision ed3e4d4180a4c0f08af285426c247aadfc685847) @@ -179,9 +179,9 @@ /*********************************************************************//** * @brief - * The sendTestAckResponseMsg function constructs a simple response - * message for a handled test message and queues it for transmit on the - * appropriate UART channel. + * The sendAckResponseMsg function constructs a simple response + * message for a handled message and queues it for transmit on the + * appropriate CAN channel. * @details Inputs: none * @details Outputs: response message constructed and queued for transmit. * @param msgID ID of handled message that we are responding to @@ -525,13 +525,10 @@ U32 cmd; memcpy( &cmd, &message->payload[0], sizeof( U32 ) ); - signalSampleWaterUserAction( (REQUESTED_SAMPLE_WATER_USER_ACTIONS_T)cmd ); } - else - { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); - } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); } /*********************************************************************//** @@ -565,13 +562,10 @@ U32 result; memcpy( &result, &message->payload[0], sizeof( U32 ) ); - setSampleWaterResult( (BOOL) result ); } - else - { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); - } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); } /*********************************************************************//** @@ -585,7 +579,12 @@ *************************************************************************/ void handleInstallationConfirm( MESSAGE_T *message ) { - signalUserConfirmInstallation(); + if ( 0 == message->hdr.payloadLen ) + { + signalUserConfirmInstallation(); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); } /*********************************************************************//** @@ -599,7 +598,12 @@ *************************************************************************/ void handleStartPrimeCmd( MESSAGE_T *message ) { - signalStartPrime(); + if ( 0 == message->hdr.payloadLen ) + { + signalStartPrime(); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); } /*********************************************************************//** @@ -628,7 +632,12 @@ *************************************************************************/ void handleContinueToTreatmentCmd( MESSAGE_T *message ) { - signalUserContinueToTreatment(); + if ( 0 == message->hdr.payloadLen ) + { + signalUserContinueToTreatment(); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); } /*********************************************************************//** @@ -645,7 +654,41 @@ { return sendUIResponseMsg( MSG_ID_HD_CONTINUE_TO_TREATMENT_REQUEST_RESPONSE, accepted, reason ); } - + +/*********************************************************************//** + * @brief + * The handlePatientConnectionConfirmCmd function handles user confirms + * patient connection. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none. + *************************************************************************/ +void handlePatientConnectionConfirmCmd( MESSAGE_T *message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + signalUserConfirmPatientConnection(); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); +} + +/*********************************************************************//** + * @brief + * The sendPatientConnectionConfirmCmdResponse function constructs a patient connection confirm + * user action response to the UI and queues the msg for transmit on the appropriate CAN channel. + * @details Inputs: none + * @details Outputs: Patient connection confirm response msg constructed and queued. + * @param accepted T/F - was patient connection confirm accepted? + * @param reason reason why request was rejected (or zero if accepted) + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendPatientConnectionConfirmCmdResponse( BOOL accepted, U32 reason ) +{ + return sendUIResponseMsg( MSG_ID_HD_PATIENT_CONNECTION_CONFIRM_RESPONSE, accepted, reason ); +} + /*********************************************************************//** * @brief * The sendDialysateTempTargetsToDG function constructs a dialysate temperature @@ -1928,7 +1971,7 @@ } else if ( 2 == cmd ) // Start treatment { - result = signalUserBeginningTreatment(); + result = signalUserStartTreatment(); } } @@ -2075,6 +2118,7 @@ memcpy( &uFVolumeMl, message->payload, sizeof(F32) ); result = validateAndSetUFVolume( uFVolumeMl ); + setUserSetUFVolumeStatus( result ); } sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, result );