Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r7fa65a3aae9c4ef70a6e53f3e3bb20f0425bd681 -re197cc27ab80e2250597746427725671f3491945 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 7fa65a3aae9c4ef70a6e53f3e3bb20f0425bd681) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision e197cc27ab80e2250597746427725671f3491945) @@ -327,7 +327,7 @@ * @details * Inputs : none * Outputs : UF change settings response msg constructed and queued. - * @param accepted : alarm status record + * @param accepted : T/F - are settings ok? * @param reason : reason rejected (if not accepted) * @param volume_mL : * @param time_min : @@ -373,13 +373,56 @@ /************************************************************************* * @brief + * The sendChangeUFSettingsResponse function constructs a UF change settings \n + * option response to the UI and queues the msg for transmit on the appropriate CAN \n + * channel. + * @details + * Inputs : none + * Outputs : UF change settings option response msg constructed and queued. + * @param accepted : T/F - are settings ok? + * @param reason : reason rejected (if not accepted) + * @param volume_mL : + * @param time_min : + * @param ufRate_mL_min : + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendChangeUFSettingsOptionResponse( BOOL accepted, U32 reason, F32 volume_mL, U32 time_min, F32 ufRate_mL_min ) +{ + BOOL result; + F32 volume_L = volume_mL / (F32)ML_PER_LITER; + MESSAGE_T msg; + U08 *payloadPtr = msg.payload; + + // create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_USER_UF_SETTINGS_CHANGE_CONFIRMATION_RESPONSE; + msg.hdr.payloadLen = sizeof( BOOL ) + sizeof( U32 ) + sizeof( F32 ) + sizeof( U32 ) + sizeof( F32 ); + + memcpy( payloadPtr, &accepted, sizeof( BOOL ) ); + payloadPtr += sizeof( BOOL ); + memcpy( payloadPtr, &reason, sizeof( U32) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &volume_L, sizeof( F32 ) ); + payloadPtr += sizeof( F32 ); + memcpy( payloadPtr, &time_min, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &ufRate_mL_min, sizeof( F32 ) ); + + // 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 sendChangeTreatmentDurationResponse function constructs a treatment \n * duration change response to the UI and queues the msg for transmit on the \n * appropriate CAN channel. * @details * Inputs : none * Outputs : treatment duration change settings response msg constructed and queued. - * @param accepted : alarm status record + * @param accepted : T/F - are settings ok? * @param reason : reason rejected (if not accepted) * @param time_min : alarm status record * @param volume_mL : alarm status record @@ -419,7 +462,7 @@ * @details * Inputs : none * Outputs : Blood & dialysate rate change response msg constructed and queued. - * @param accepted : alarm status record + * @param accepted : T/F - are settings ok? * @param reason : reason code for rejection or unused if accepted * @param bloodRate : new blood flow rate * @param dialRate : new dialysate flow rate