Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r09e6cf9de34acf18f6e1138bf56ac0edb4821186 -r9a45dcbdfae33fc06479d99b8d52bada8f682194 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 09e6cf9de34acf18f6e1138bf56ac0edb4821186) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9a45dcbdfae33fc06479d99b8d52bada8f682194) @@ -1461,10 +1461,11 @@ * @details Inputs: none * @details Outputs: DG fill command msg constructed and queued. * @param cmd start or stop fill command - * @param fillToVolumeMl volume (in mL) to fill inactive reservoir to + * @param fillToVolumeMl volume (in mL) to fill inactive reservoir to + * @param targetFlowLRatePM target fill flow rate in L/min * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL sendDGFillCommand( U32 cmd, U32 fillToVolumeMl ) +BOOL sendDGFillCommand( U32 cmd, U32 fillToVolumeMl, F32 targetFlowRateLPM ) { BOOL result; MESSAGE_T msg; @@ -1473,11 +1474,13 @@ // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_FILL_CMD; - msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ); + msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ) + sizeof( F32 ); memcpy( payloadPtr, &fillToVolumeMl, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); - memcpy( payloadPtr, &cmd, sizeof( U32 ) ); + memcpy( payloadPtr, &cmd, sizeof( U32 ) ); + payloadPtr += sizeof( F32 ); + memcpy( payloadPtr, &targetFlowRateLPM, 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_DG, ACK_REQUIRED ); @@ -1935,6 +1938,31 @@ return result; } +/*********************************************************************//** + * @brief + * The sendDGConcentrateMixingRatiosRequest function constructs a request msg + * to the DG to request the concentrate ratios and queues the msg for transmit + * on the appropriate CAN channel. + * @details Inputs: none + * @details Outputs: DG POST result request msg constructed and queued. + * @return TRUE if msg successfully queued for transmit, FALSE if not + *************************************************************************/ +BOOL sendDGConcentrateMixingRatiosRequest( void ) +{ + BOOL result; + MESSAGE_T msg; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_HD_REQUEST_DG_CONCENTRATE_MIXING_RATIOS; + msg.hdr.payloadLen = 0; + + // 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_DG, ACK_REQUIRED ); + + return result; +} + #ifdef EMC_TEST_BUILD BOOL broadcastCANErrorCount( U32 count ) { @@ -6730,7 +6758,6 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } - /*********************************************************************//** * @brief * The handleStopHDRTCClock function handles a request to stop the RTC clock. @@ -6752,4 +6779,23 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +/*********************************************************************//** + * @brief + * The handleDGMixingRatios function handles a concentrate mixing ratios and + * prepare fill time broadcast from DG. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleDGMixingRatios( MESSAGE_T *message ) +{ + if ( message->hdr.payloadLen == sizeof( DG_MIXING_RATIOS_T ) ) + { + DG_MIXING_RATIOS_T payload; + + memcpy( &payload, message->payload, sizeof( DG_MIXING_RATIOS_T ) ); + } +} + /**@}*/