Index: firmware/App/Modes/ModeTreatment.c =================================================================== diff -u -r11a668a2f4a0401eed544be570d9102d143b6f00 -r316cb40192e5d6be69682d5c9df01d890e2c213f --- firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 11a668a2f4a0401eed544be570d9102d143b6f00) +++ firmware/App/Modes/ModeTreatment.c (.../ModeTreatment.c) (revision 316cb40192e5d6be69682d5c9df01d890e2c213f) @@ -20,6 +20,7 @@ #include "Bubbles.h" #include "Buttons.h" #include "DDInterface.h" +#include "Messaging.h" #include "ModeService.h" #include "ModeTreatment.h" //#include "NVDataMgmt.h" @@ -29,7 +30,6 @@ #include "StateTxDialysis.h" #include "StateTxPaused.h" //#include "Switches.h" -#include "SystemCommTD.h" #include "TaskGeneral.h" #include "Timers.h" #include "TxParams.h" @@ -516,6 +516,35 @@ /*********************************************************************//** * @brief + * The sendPressureLimitsChangeResponse function constructs a change + * pressure limits response to the UI and queues the msg for transmit on the + * appropriate CAN channel. + * @details Inputs: none + * @details Outputs: Pressure limits change response msg constructed and queued. + * @param data response data record + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendPressureLimitsChangeResponse( PRESSURE_LIMIT_CHANGE_RESPONSE_T *data ) +{ + BOOL result; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_TD_PRESSURE_LIMITS_CHANGE_RESPONSE; + msg.hdr.payloadLen = sizeof( PRESSURE_LIMIT_CHANGE_RESPONSE_T ); + + memcpy( payloadPtr, (U08*)data, sizeof( PRESSURE_LIMIT_CHANGE_RESPONSE_T ) ); + + // 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_TD_2_UI, ACK_REQUIRED ); + + return result; +} + +/*********************************************************************//** + * @brief * The handleTreatmentStartState function handles the Start state of * the Treatment Mode state machine. Should only pass through this state * once at very beginning of treatment.