Index: firmware/App/Modes/OperationModes.c =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r2c47c42b293b3fbfbab0930561bed2eb436bee2d --- firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Modes/OperationModes.c (.../OperationModes.c) (revision 2c47c42b293b3fbfbab0930561bed2eb436bee2d) @@ -451,7 +451,14 @@ U32 pendingIndex = 0; CONFIRMATION_REQUEST_STATUS_T status = CONFIRMATION_REQUEST_STATUS_PENDING; U32 i; + GENERIC_CONFIRMATION_REQUEST_T genConfRqst; + genConfRqst.rejectReason = 0; + genConfRqst.genericPayload1 = 0.0F; + genConfRqst.genericPayload2 = 0.0F; + genConfRqst.genericPayload3 = 0.0F; + genConfRqst.genericPayload4 = 0.0F; + for ( i = 0; i < MAX_PENDING_CONFIRM_REQUESTS; i++ ) { if ( confirmRequests[ i ].requestID == requestID ) @@ -462,18 +469,24 @@ // Send UI clear if ( CONFIRMATION_REQUEST_STATUS_TIMEOUT == status ) { - sendConfirmationRequest( confirmRequests[ i ].requestID, GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE, 0 ); + genConfRqst.requestID = confirmRequests[ i ].requestID; + genConfRqst.requestType = GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE; + + sendConfirmationRequest( &genConfRqst ); } else { - sendConfirmationRequest( confirmRequests[ i ].requestID, GENERIC_CONFIRM_CMD_ACCEPT_CLOSE, 0 ); + genConfRqst.requestID = confirmRequests[ i ].requestID; + genConfRqst.requestType = GENERIC_CONFIRM_CMD_ACCEPT_CLOSE; + + sendConfirmationRequest( &genConfRqst ); } // Clear the confirmation request, it is done and consumed - confirmRequests[ i ].requestID = GENERIC_CONFIRM_ID_NONE; + confirmRequests[ i ].requestID = GENERIC_CONFIRM_ID_NONE; confirmRequests[ i ].requestType = GENERIC_CONFIRM_CMD_REQUEST_OPEN; - confirmRequests[ i ].timeStamp = 0; - confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_UNUSED; + confirmRequests[ i ].timeStamp = 0; + confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_UNUSED; } } else if ( CONFIRMATION_REQUEST_STATUS_PENDING == confirmRequests[ i ].status ) @@ -496,8 +509,11 @@ if ( ( CONFIRMATION_REQUEST_STATUS_PENDING != status ) && ( TRUE == pending ) ) { + genConfRqst.requestID = confirmRequests[ i ].requestID; + genConfRqst.requestType = confirmRequests[ pendingIndex ].requestType; + // Last confirmation cleared, pending request must be resent to UI - sendConfirmationRequest( confirmRequests[ pendingIndex ].requestID, confirmRequests[ pendingIndex ].requestType, 0 ); + sendConfirmationRequest( &genConfRqst ); } return status; @@ -556,17 +572,30 @@ // If not already pending, add confirmation to list of pending confirmations and send to UI to be displayed if ( confirmAlreadyPending != TRUE ) { + GENERIC_CONFIRMATION_REQUEST_T genConfRqst; + + genConfRqst.rejectReason = rejectReason; + genConfRqst.genericPayload1 = 0.0F; + genConfRqst.genericPayload2 = 0.0F; + genConfRqst.genericPayload3 = 0.0F; + genConfRqst.genericPayload4 = 0.0F; + for ( i = 0; i < MAX_PENDING_CONFIRM_REQUESTS; i++ ) { if ( CONFIRMATION_REQUEST_STATUS_UNUSED == confirmRequests[ i ].status ) { // Save the confirmation request info - confirmRequests[ i ].requestID = requestID; + confirmRequests[ i ].requestID = requestID; confirmRequests[ i ].requestType = requestType; - confirmRequests[ i ].timeStamp = getMSTimerCount(); - confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_PENDING; - newID = requestID; - sendConfirmationRequest( requestID, requestType, rejectReason ); + confirmRequests[ i ].timeStamp = getMSTimerCount(); + confirmRequests[ i ].status = CONFIRMATION_REQUEST_STATUS_PENDING; + newID = requestID; + + // Get ready for the generic confirmation request + genConfRqst.requestID = requestID; + genConfRqst.requestType = requestType; + + sendConfirmationRequest( &genConfRqst ); break; } } Index: firmware/App/Modes/SalineBolus.c =================================================================== diff -u -r5ed6831faa470509f0946fff85fe8e33c9d32eab -r2c47c42b293b3fbfbab0930561bed2eb436bee2d --- firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision 5ed6831faa470509f0946fff85fe8e33c9d32eab) +++ firmware/App/Modes/SalineBolus.c (.../SalineBolus.c) (revision 2c47c42b293b3fbfbab0930561bed2eb436bee2d) @@ -198,7 +198,7 @@ // If in treatment stop submode but also in blood recover the software cannot do saline bolus rejReason = REQUEST_REJECT_REASON_INVALID_TREATMENT_STATE; } - else if ( ( TRUE == isAnyAlarmActive() ) && ( ( TRUE == isBloodRecircBlocked() ) || ( TRUE == isDialysateRecircBlocked() ) ) ) + else if ( ( TRUE == isAnyAlarmActive() ) && ( ( TRUE == isBloodRecircBlocked() ) || ( TRUE == isRinseBackBlocked() ) ) ) { // Any alarm can be active but blood recirculation and dialysate recirculation cannot be blocked in their properties in order // to do saline bolus Index: firmware/App/Services/AlarmMgmt.c =================================================================== diff -u -r849fffb475b8be4c24963e1c694e382a0a96ba1b -r2c47c42b293b3fbfbab0930561bed2eb436bee2d --- firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 849fffb475b8be4c24963e1c694e382a0a96ba1b) +++ firmware/App/Services/AlarmMgmt.c (.../AlarmMgmt.c) (revision 2c47c42b293b3fbfbab0930561bed2eb436bee2d) @@ -782,6 +782,19 @@ /*********************************************************************//** * @brief + * The isRinseBackBlocked function determines whether any currently + * active alarm is blocking rinseback. + * @details Inputs: alarmStatus + * @details Outputs: none + * @return TRUE if any active alarm prevents rinseback, FALSE if not + *************************************************************************/ +BOOL isRinseBackBlocked( void ) +{ + return alarmStatus.noRinseback; +} + +/*********************************************************************//** + * @brief * The doesAlarmStatusIndicateEndTxOnly function determines whether any currently * active alarm has ( stop && noRes && /noET ) property, that is end treatment is * the only choice from full stop. Index: firmware/App/Services/AlarmMgmt.h =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r2c47c42b293b3fbfbab0930561bed2eb436bee2d --- firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Services/AlarmMgmt.h (.../AlarmMgmt.h) (revision 2c47c42b293b3fbfbab0930561bed2eb436bee2d) @@ -210,6 +210,7 @@ BOOL isAnyAlarmActive( void ); BOOL isBloodRecircBlocked( void ); BOOL isDialysateRecircBlocked( void ); +BOOL isRinseBackBlocked( void ); BOOL doesAlarmStatusIndicateStop( void ); BOOL doesAlarmIndicateNoResume( void ); BOOL doesAlarmStatusIndicateEndTxOnly( void ); Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -rc9890bc0bc9a1d779be9fec7e0478cfc6fba1cfb -r2c47c42b293b3fbfbab0930561bed2eb436bee2d --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision c9890bc0bc9a1d779be9fec7e0478cfc6fba1cfb) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2c47c42b293b3fbfbab0930561bed2eb436bee2d) @@ -3504,29 +3504,21 @@ * The sendConfirmationRequest function sends a confirmation request to UI * @details Inputs: none * @details Outputs: none - * @param requestID ID of confirmation being requested - * @param requestType Type of confirmation being requested - * @param rejectReason Reason Reason for reject if type is reject + * @param request ID pointer to generic message request structure * @return none *************************************************************************/ -void sendConfirmationRequest( GENERIC_CONFIRM_ID_T requestID, GENERIC_CONFIRM_COMMAND_T requestType, U32 rejectReason ) +void sendConfirmationRequest( GENERIC_CONFIRMATION_REQUEST_T *request ) { MESSAGE_T msg; U08 *payloadPtr = msg.payload; - U32 temp_request = requestID; // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_HD_UI_CONFIRMATION_REQUEST; // The payload length is U32 Request ID, U32 Type, U32 Reject Reason - msg.hdr.payloadLen = 3 * sizeof( U32 ); + msg.hdr.payloadLen = sizeof( GENERIC_CONFIRMATION_REQUEST_T ); - memcpy( payloadPtr, &temp_request, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - temp_request = requestType; - memcpy( payloadPtr, &temp_request, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - memcpy( payloadPtr, &rejectReason, sizeof( U32 ) ); + memcpy( payloadPtr, request, sizeof( GENERIC_CONFIRMATION_REQUEST_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_REQUIRED ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -rfba69244d94307e50fefaa1e88bcbb979584461e -r2c47c42b293b3fbfbab0930561bed2eb436bee2d --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision fba69244d94307e50fefaa1e88bcbb979584461e) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 2c47c42b293b3fbfbab0930561bed2eb436bee2d) @@ -136,6 +136,18 @@ U32 minDialRate; ///< Minimum dialysate flow rate (in mL/min) U32 maxDialRate; ///< Maximum dialysate flow rate (in mL/min) } TREATMENT_PARAM_BROADCAST_PAYLOAD_T; + +/// Payload structure for generic confirmation request +typedef struct +{ + GENERIC_CONFIRM_ID_T requestID; ///< Generic request ID. + GENERIC_CONFIRM_COMMAND_T requestType; ///< Generic request type. + U32 rejectReason; ///< Reject reason. + F32 genericPayload1; ///< Generic payload 1. + F32 genericPayload2; ///< Generic payload 2. + F32 genericPayload3; ///< Generic payload 3. + F32 genericPayload4; ///< Generic payload 4. +} GENERIC_CONFIRMATION_REQUEST_T; // ********** public function prototypes ********** @@ -523,7 +535,7 @@ void handleUIConfirmationResponse( MESSAGE_T *message ); // MSG_ID_HD_REQUEST_UI_CONFIRMATION -void sendConfirmationRequest( GENERIC_CONFIRM_ID_T request_id, GENERIC_CONFIRM_COMMAND_T request_type, U32 reject_reason ); +void sendConfirmationRequest( GENERIC_CONFIRMATION_REQUEST_T *request ); // MSG_ID_HD_REQUEST_DG_ALARMS BOOL sendRequestForDGResendAlarms( void );