Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r766708fceb0bdf1af8c7897df29d4f5036bfd3db -rfa356a2bce909141f45c6832659fa1ceea5bfbba --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 766708fceb0bdf1af8c7897df29d4f5036bfd3db) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision fa356a2bce909141f45c6832659fa1ceea5bfbba) @@ -1042,10 +1042,13 @@ * @details Outputs: treatment state msg constructed and queued * @param subMode Current state (sub-mode) of treatment * @param uFState Current state of ultrafiltration - * @param salineBolusState 1=saline bolus in progress, 0=not, 2=max bolus volume reached + * @param salineBolusState 1=saline bolus in progress, 0=not, 2=max bolus volume reached + * @param hepState Current state of Heparin controller + * @param rinsebackState Current state of rinseback sub-mode + * @param txRecircState Current state of treatment re-circulate sub-mode * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL broadcastTreatmentState( U32 subMode, U32 uFState, U32 salineBolusState ) +BOOL broadcastTreatmentState( U32 subMode, U32 uFState, U32 salineBolusState, U32 hepState, U32 rinsebackState, U32 txRecircState ) { BOOL result; MESSAGE_T msg; @@ -1060,7 +1063,9 @@ payload.treatmentSubMode = subMode; payload.uFState = uFState; payload.salineBolusState = salineBolusState; - payload.heparinState = 0; // TODO - add this later + payload.heparinState = hepState; + payload.rinsebackState = rinsebackState; + payload.txRecircState = txRecircState; memcpy( payloadPtr, &payload, sizeof( TREATMENT_STATE_DATA_T ) ); @@ -1335,7 +1340,7 @@ memcpy( &cmd, payloadPtr, sizeof( U32 ) ); - signalAlarmSilence( cmd ); + signalAlarmSilence( (ALARM_SILENCE_CMD_T)cmd ); } else { @@ -1655,56 +1660,6 @@ /*********************************************************************//** * @brief - * The handleUIUserEndTreatmentRequest function handles a treatment end - * request message from the UI. - * @details Inputs: none - * @details Outputs: message handled - * @param message a pointer to the message to handle - * @return none - *************************************************************************/ -void handleUIUserEndTreatmentRequest( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - if ( message->hdr.payloadLen == 0 ) - { - result = userRequestEndTreatment(); - } - - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, result ); -} - -/*********************************************************************//** - * @brief - * The sendTreatmentEndResponseMsg function constructs a treatment end - * request response message to the UI and queues the msg for transmit on - * the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: Treatment end response msg constructed and queued. - * @param accepted T/F - request accepted? - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL sendTreatmentEndResponseMsg( BOOL accepted ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_HD_TREATMENT_END_RESPONSE; - msg.hdr.payloadLen = sizeof( BOOL ); - - memcpy( payloadPtr, &accepted, sizeof( BOOL ) ); - - // 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 handleTreatmentParametersFromUI function handles a treatment parameters * set and validate request message from the UI. * @details Inputs: none