Index: firmware/App/Services/Messaging.c =================================================================== diff -u -red21c935443549b87ab6665e76ce1d32d9867082 -rbcc80fde38b8b94c64a7ad615f9ca3cb6e98c77e --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision ed21c935443549b87ab6665e76ce1d32d9867082) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision bcc80fde38b8b94c64a7ad615f9ca3cb6e98c77e) @@ -142,6 +142,7 @@ { MSG_ID_FFU_SIGNAL_TD_UPDATE_AVAILABLE, &handleUpdateAvailable }, { MSG_ID_UI_FLUID_BOLUS_REQUEST, &handleFluidBolusRequest }, { MSG_ID_UI_GENERIC_CONFIRMATION_RESULT_RESPONSE, &handleUIConfirmationResponse }, + { MSG_ID_UI_DISINFECT_REQUEST, &handleUIDisinfectRequest }, { MSG_ID_UI_PATIENT_DISCONNECT_CONFIRM_REQUEST, &handlePatientDisconnectionConfirmCmd }, { MSG_ID_UI_POST_TREATMENT_DISPOSABLE_REMOVAL_CONFIRM_REQUEST, &handleDisposableRemovalConfirmCmd }, { MSG_ID_UI_POST_TREATMENT_DISINFECTION_SELECTION_REQUEST, &handleDisinfectionConfirmCmd }, @@ -560,14 +561,68 @@ /*********************************************************************//** * @brief + * The handleUIDisinfectRequest function handles a disinfect/flush user + * action command message from the UI. + * @details \b Inputs: none + * @details \b Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +BOOL handleUIDisinfectRequest( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + if ( message->hdr.payloadLen == sizeof(U32) ) + { + U32 cmd; + + memcpy( &cmd, message->payload, sizeof(U32) ); + + if ( DD_DISINFECT_FLUSH_STATE == cmd ) // Command 0 = Flush + { + result = signalUserInitiateFlushMode(); + } +// else if ( DD_DISINFECT_HEAT_STATE_ACTIVE_COOL == cmd ) // Command 1 = Heat disinfect active cool +// { +// result = signalUserInitiateHeatDisinfectActiveCoolMode(); +// } +// else if ( DD_DISINFECT_CHEM_STATE == cmd ) // Command 2 = chemical disinfect +// { +// result = signalUserInitiateChemicalDisinfectMode(); +// } +// else if ( DD_DISINFECT_CHEM_FLUSH_STATE == cmd ) // Command 3 = chemical disinfect flush +// { +// result = signalUserInitiateChemicalDisinfectFlushMode(); +// } +// else if ( DD_DISINFECT_RO_PERMEATE_SAMPLE_STATE == cmd ) // Command 4 = RO permeate sample +// { +// result = signalUserInitiateROPermeateSampleMode(); +// } +// else if ( DD_DISINFECT_HEAT_STATE_PASSIVE_COOL == cmd ) // Command 5 = Heat disinfect passive coode +// { +// result = signalUserInitiateHeatDisinfectPassiveCoolMode(); +// } +// else if ( DD_DISINFECT_ACTIVE_COOL == cmd ) // Command 6 = Active cool +// { +// result = signalUserInitiateActiveCoolMode(); +// } + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_TD_2_UI, result ); + + return result; +} + +/*********************************************************************//** + * @brief * The handlePatientDisconnectionConfirmCmd function handles user * confirmation of patient disconnection. * @details \b Inputs: Patient disconnection confirmation message. * @details \b Outputs: Acceptance response and patient disconnection signal. * @param message Pointer to the message to handle. * @return TRUE if the confirmation is accepted, FALSE otherwise. *************************************************************************/ -static BOOL handlePatientDisconnectionConfirmCmd( MESSAGE_T *message ) +BOOL handlePatientDisconnectionConfirmCmd( MESSAGE_T *message ) { BOOL result = FALSE; BOOL modeValid = FALSE; @@ -596,7 +651,9 @@ } response.accepted = result; - sendMessage( MSG_ID_TD_PATIENT_DISCONNECT_CONFIRM_RESPONSE, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08*)(&response), sizeof( UI_RESPONSE_PAYLOAD_T ) ); + sendMessage( MSG_ID_TD_PATIENT_DISCONNECT_CONFIRM_RESPONSE, + COMM_BUFFER_OUT_CAN_TD_2_UI, (U08*)(&response), + sizeof( UI_RESPONSE_PAYLOAD_T ) ); return result; } @@ -610,7 +667,7 @@ * @param message Pointer to the message to handle. * @return TRUE if the confirmation is accepted, FALSE otherwise. *************************************************************************/ -static BOOL handleDisposableRemovalConfirmCmd( MESSAGE_T *message ) +BOOL handleDisposableRemovalConfirmCmd( MESSAGE_T *message ) { BOOL result = FALSE; BOOL modeValid = FALSE; @@ -652,23 +709,24 @@ /*********************************************************************//** * @brief - * The handleDisinfectionConfirmCmd function handles user confirmation - * of the disinfection selection. - * @details \b Inputs: Disinfection confirmation message. - * @details \b Outputs: Acceptance response and disinfection confirmation signal. + * The handleDisinfectionConfirmCmd function handles user selection + * of the Post-Treatment disinfection operation. + * @details \b Inputs: Disinfection selection message. + * @details \b Outputs: Acceptance response and selected disinfection command. * @param message Pointer to the message to handle. - * @return TRUE if the confirmation is accepted, FALSE otherwise. + * @return TRUE if the selection is accepted, FALSE otherwise. *************************************************************************/ -static BOOL handleDisinfectionConfirmCmd( MESSAGE_T *message ) +BOOL handleDisinfectionConfirmCmd( MESSAGE_T *message ) { BOOL result = FALSE; BOOL modeValid = FALSE; TD_OP_MODE_T mode = getCurrentOperationMode(); UI_RESPONSE_PAYLOAD_T response; + DD_COMMAND_T command = DD_CMD_NONE; response.rejectionReason = REQUEST_REJECT_REASON_NONE; - if ( 0 == message->hdr.payloadLen ) + if ( sizeof( U32 ) == message->hdr.payloadLen ) { modeValid = ( MODE_POST == mode ) ? TRUE : FALSE; @@ -679,7 +737,8 @@ } else { - signalUserConfirmDisinfection(); + memcpy( &command , &message->payload[ 0 ], sizeof(U32) ); + signalUserConfirmDisinfection( command ); result = TRUE; } }