Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r2acda0ccdd00334bec87bfbe61c4e78e867925de -r515a40fb83e3fc13384dae12dba25b45aeeea904 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2acda0ccdd00334bec87bfbe61c4e78e867925de) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 515a40fb83e3fc13384dae12dba25b45aeeea904) @@ -286,8 +286,8 @@ result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_REQUIRED ); return result; -} - +} + /*********************************************************************//** * @brief * The sendChangeUFSettingsResponse function constructs a UF change settings @@ -1485,6 +1485,38 @@ /*********************************************************************//** * @brief + * The sendUFPauseResumeResponse function constructs a UF pause/resume + * response to the UI and queues the msg for transmit on the appropriate CAN + * channel. + * @details Inputs: none + * @details Outputs: UF pause/resume response msg constructed and queued. + * @param accepted was pause/resume request accepted + * @param reason reason rejected (if not accepted) + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendUFPauseResumeResponse( BOOL accepted, U32 reason ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_USER_UF_PAUSE_RESUME_RESPONSE; + msg.hdr.payloadLen = sizeof( BOOL ) + sizeof( U32 ); + + memcpy( payloadPtr, &accepted, sizeof( BOOL ) ); + payloadPtr += sizeof( BOOL ); + memcpy( payloadPtr, &reason, 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 handleUIStartTreatmentMsg function handles a treatment start/cancel * message from the UI. * @details