Index: firmware/App/Modes/ModePostTreat.c =================================================================== diff -u -rffaf9f13166d7a9beb4252fad804c488f870aaaa -rfc7328b2b8158c88e11a063204d7e87519f472ca --- firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision ffaf9f13166d7a9beb4252fad804c488f870aaaa) +++ firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision fc7328b2b8158c88e11a063204d7e87519f472ca) @@ -312,6 +312,32 @@ /*********************************************************************//** * @brief + * The requestPostTxNext requests to go to next screen after treatment record + * review screen in post-treatment mode + * @details Inputs: none + * @details Outputs: none + * @return none + *************************************************************************/ +void requestPostTxNext( void ) +{ + BOOL accepted = FALSE; + REQUEST_REJECT_REASON_CODE_T rejReason = REQUEST_REJECT_REASON_NONE; + + if ( currentPostTreatmentState >= HD_POST_TREATMENT_DISPOSABLE_REMOVAL_STATE ) + { + accepted = TRUE; + } + else + { + rejReason = REQUEST_REJECT_REASON_DRAIN_NOT_COMPLETE; + } + + // Respond to user request to move to next screen + sendPostTxNextCmdResponse( accepted, (U32)rejReason ); +} + +/*********************************************************************//** + * @brief * The signalUserConfirmDisposableRemoval signals post-treatment mode * user has confirmed disposable removal. * @details Inputs: none Index: firmware/App/Modes/ModePostTreat.h =================================================================== diff -u -r0a4dcd288d4347b85baaa0b07da568b6add5eac7 -rfc7328b2b8158c88e11a063204d7e87519f472ca --- firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision 0a4dcd288d4347b85baaa0b07da568b6add5eac7) +++ firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision fc7328b2b8158c88e11a063204d7e87519f472ca) @@ -95,6 +95,7 @@ void sendTreatmentLogDataToUI( void ); void signalUserConfirmPatientDisconnection( void ); +void requestPostTxNext( void ); void signalUserConfirmDisposableRemoval( void ); void signalAlarmActionToPostTreatmentMode( ALARM_ACTION_T action ); // Execute alarm action as appropriate for post-treatment mode Index: firmware/App/Services/SystemComm.c =================================================================== diff -u -rffaf9f13166d7a9beb4252fad804c488f870aaaa -rfc7328b2b8158c88e11a063204d7e87519f472ca --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision ffaf9f13166d7a9beb4252fad804c488f870aaaa) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision fc7328b2b8158c88e11a063204d7e87519f472ca) @@ -1099,6 +1099,10 @@ handleTreatmentRecircCmd( message ); break; + case MSG_ID_UI_POST_TX_NEXT_REQUEST: + handlePostTxNextCmd( message ); + break; + case MSG_ID_UI_TX_END_CMD_REQUEST: handleTreatmentEndCmd( message ); break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r0244adf04ccc6b154d5c81ecd9b0473584b97509 -rfc7328b2b8158c88e11a063204d7e87519f472ca --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 0244adf04ccc6b154d5c81ecd9b0473584b97509) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision fc7328b2b8158c88e11a063204d7e87519f472ca) @@ -3032,6 +3032,27 @@ /*********************************************************************//** * @brief + * The handlePostTxNextCmd function handles a post-treatment next request + * message from the UI. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handlePostTxNextCmd( MESSAGE_T *message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + requestPostTxNext(); + } + else + { + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + } +} + +/*********************************************************************//** + * @brief * The sendTreatmentRecircCmdResponse function constructs a treatment re-circulation * user action response to the UI and queues the msg for transmit on the appropriate * CAN channel. @@ -3064,6 +3085,38 @@ /*********************************************************************//** * @brief + * The sendPostTxNextCmdResponse function constructs a post-treatment next + * command response to the UI and queues the msg for transmit on the appropriate + * CAN channel. + * @details Inputs: none + * @details Outputs: Post-treatment next command response msg constructed and queued. + * @param accepted T/F - was request accepted? + * @param rejReason reason why request was rejected (or zero if accepted) + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendPostTxNextCmdResponse( BOOL accepted, U32 rejReason ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_POST_TX_NEXT_CMD_RESPONSE; + msg.hdr.payloadLen = sizeof( BOOL ) + sizeof( U32 ); + + memcpy( payloadPtr, &accepted, sizeof( BOOL ) ); + payloadPtr += sizeof( BOOL ); + memcpy( payloadPtr, &rejReason, sizeof( U32 ) ); + + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); + + return result; +} + +/*********************************************************************//** + * @brief * The handleTreatmentEndCmd function handles a treatment end user action command * message from the UI. * @details Inputs: none Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -rf1157c760b320bf088921a25eb78e973d6341578 -rfc7328b2b8158c88e11a063204d7e87519f472ca --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision f1157c760b320bf088921a25eb78e973d6341578) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision fc7328b2b8158c88e11a063204d7e87519f472ca) @@ -372,9 +372,15 @@ // MSG_ID_UI_RECIRC_CMD void handleTreatmentRecircCmd( MESSAGE_T *message ); +// MSG_ID_UI_POST_TX_NEXT_REQUEST +void handlePostTxNextCmd( MESSAGE_T *message ); + // MSG_ID_HD_RECIRC_CMD_RESPONSE BOOL sendTreatmentRecircCmdResponse( BOOL accepted, U32 rejReason ); +// MSG_ID_HD_POST_TX_NEXT_CMD_RESPONSE +BOOL sendPostTxNextCmdResponse( BOOL accepted, U32 rejReason ); + // MSG_ID_UI_TX_END_CMD: void handleTreatmentEndCmd( MESSAGE_T *message );