Index: firmware/App/Modes/ModePostTreat.c =================================================================== diff -u -r16b178ff7528cb09c66413d19980a4eb0d13b48e -r368e2fde80a5cc108f61c021830c684e05fb62d5 --- firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 16b178ff7528cb09c66413d19980a4eb0d13b48e) +++ firmware/App/Modes/ModePostTreat.c (.../ModePostTreat.c) (revision 368e2fde80a5cc108f61c021830c684e05fb62d5) @@ -129,9 +129,6 @@ signalDialInPumpHardStop(); stopSyringePump(); - - // Send treatment log data to UI - sendTreatmentLogData( &treatmentLogData ); } /*********************************************************************//** @@ -168,6 +165,23 @@ /*********************************************************************//** * @brief + * The handleTreatmentLogDataRequest sends treatment log data to UI upon + * UI requests. + * @details Inputs: treatmentLogData + * @details Outputs: Sent treatment log data to UI + * @return none + *************************************************************************/ +void handleTreatmentLogDataRequest( void ) +{ + BOOL accepted = TRUE; + REQUEST_REJECT_REASON_CODE_T rejReason = REQUEST_REJECT_REASON_NONE; + + // Send treatment log data to UI + sendTreatmentLogData( accepted, rejReason, &treatmentLogData ); +} + +/*********************************************************************//** + * @brief * The signalUserConfirmPatientDisconnection signals post-treatment mode * user has confirmed patient disconnection. * @details Inputs: none Index: firmware/App/Modes/ModePostTreat.h =================================================================== diff -u -r711e8c1a6d5024fa7d013ae37e632f59dc2268fe -r368e2fde80a5cc108f61c021830c684e05fb62d5 --- firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision 711e8c1a6d5024fa7d013ae37e632f59dc2268fe) +++ firmware/App/Modes/ModePostTreat.h (.../ModePostTreat.h) (revision 368e2fde80a5cc108f61c021830c684e05fb62d5) @@ -83,6 +83,7 @@ void transitionToPostTreatmentMode( void ); // Prepares for transition to post-treatment mode U32 execPostTreatmentMode( void ); // Execute the post-treatment mode state machine (call from OperationModes) +void handleTreatmentLogDataRequest( void ); void signalUserConfirmPatientDisconnection( 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 -r2346a0cb59957d90fe61cb3bff4ec7ffc3df10a4 -r368e2fde80a5cc108f61c021830c684e05fb62d5 --- firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 2346a0cb59957d90fe61cb3bff4ec7ffc3df10a4) +++ firmware/App/Services/SystemComm.c (.../SystemComm.c) (revision 368e2fde80a5cc108f61c021830c684e05fb62d5) @@ -1225,6 +1225,10 @@ handleDisposableRemovalConfirmCmd( message ); break; + case MSG_ID_UI_TREATMENT_LOG_DATA_REQUEST: + handleUITreatmentLogDataRequest( message ); + break; + case MSG_ID_DG_COMMAND_RESPONSE: handleDGCmdResp( message ); break; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r16b178ff7528cb09c66413d19980a4eb0d13b48e -r368e2fde80a5cc108f61c021830c684e05fb62d5 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 16b178ff7528cb09c66413d19980a4eb0d13b48e) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 368e2fde80a5cc108f61c021830c684e05fb62d5) @@ -596,10 +596,28 @@ *************************************************************************/ BOOL sendDisposableRemovalConfirmResponse( BOOL accepted, U32 reason ) { - return sendUIResponseMsg( MSG_ID_UI_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE, accepted, reason ); + return sendUIResponseMsg( MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE, accepted, reason ); } /*********************************************************************//** + * @brief + * The handleUITreatmentLogDataRequest function handles UI treatment log data request. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none. + *************************************************************************/ +void handleUITreatmentLogDataRequest( MESSAGE_T *message ) +{ + if ( 0 == message->hdr.payloadLen ) + { + handleTreatmentLogDataRequest(); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); +} + +/*********************************************************************//** * @brief * The sendTreatmentLogData function constructs a treatment log data message * for UI and queues the msg for transmit on the appropriate CAN channel. @@ -608,16 +626,21 @@ * @param logDataPtr treatment log data record pointer * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL sendTreatmentLogData( TREATMENT_LOG_DATA_PAYLOAD_T *logDataPtr ) +BOOL sendTreatmentLogData( BOOL accepted, U32 reason, TREATMENT_LOG_DATA_PAYLOAD_T *logDataPtr ) { MESSAGE_T msg; + U08 *payloadPtr = msg.payload; // Create a message record blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_HD_TREATMENT_LOG_DATA; - msg.hdr.payloadLen = sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ); + msg.hdr.msgID = MSG_ID_HD_TREATMENT_LOG_DATA_RESPONSE; + msg.hdr.payloadLen = sizeof( BOOL ) + sizeof( U32 ) + sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ); - memcpy( msg.payload, logDataPtr, sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ) ); + memcpy( payloadPtr, &accepted, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &reason, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, logDataPtr, sizeof( TREATMENT_LOG_DATA_PAYLOAD_T ) ); // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer return serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r16b178ff7528cb09c66413d19980a4eb0d13b48e -r368e2fde80a5cc108f61c021830c684e05fb62d5 --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 16b178ff7528cb09c66413d19980a4eb0d13b48e) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 368e2fde80a5cc108f61c021830c684e05fb62d5) @@ -194,12 +194,15 @@ // MSG_ID_UI_DISPOSABLE_REMOVAL_CONFIRM void handleDisposableRemovalConfirmCmd( MESSAGE_T *message ); -// MSG_ID_UI_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE +// MSG_ID_HD_DISPOSABLE_REMOVAL_CONFIRM_RESPONSE BOOL sendDisposableRemovalConfirmResponse( BOOL accepted, U32 reason ); -// MSG_ID_HD_TREATMENT_LOG_DATA -BOOL sendTreatmentLogData( TREATMENT_LOG_DATA_PAYLOAD_T *logDataPtr ); +// MSG_ID_UI_TREATMENT_LOG_DATA_REQUEST +void handleUITreatmentLogDataRequest( MESSAGE_T *message ); +// MSG_ID_HD_TREATMENT_LOG_DATA_RESPONSE +BOOL sendTreatmentLogData( BOOL accepted, U32 reason, TREATMENT_LOG_DATA_PAYLOAD_T *logDataPtr ); + // MSG_ID_SET_DG_DIALYSATE_TEMP_TARGETS BOOL sendDialysateTempTargetsToDG( F32 primary, F32 trimmer );