Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r6bb7cd715299d16c131ab074fac0e62d8022f235 -r7d293e18ea5ac0fce443c68525100e44df80b4fd --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 6bb7cd715299d16c131ab074fac0e62d8022f235) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 7d293e18ea5ac0fce443c68525100e44df80b4fd) @@ -523,6 +523,41 @@ /*********************************************************************//** * @brief + * The handleDGServiceScheduleRequest function handles a request for DG + * service information. + * @details Inputs: none + * @details Outputs: message handled, response constructed and queued for + * transmit. + * @return none + *************************************************************************/ +void handleDGSendConcentrateMixingRatios( MESSAGE_T *message ) +{ + MESSAGE_T msg; + + DG_ACID_CONCENTRATES_RECORD_T acid = getAcidConcentrateCalRecord(); + DG_BICARB_CONCENTRATES_RECORD_T bicarb = getBicarbConcentrateCalRecord(); + U32 fillPrepTimeMS = 9000; // TODO make a get for this in mode fill + + U08 *payloadPtr = msg.payload; + + // Create a message record + blankMessage( &msg ); + msg.hdr.msgID = MSG_ID_DG_CONCENTRATE_MIXING_RATIOS_DATA; + msg.hdr.payloadLen = sizeof( F32 ) + sizeof( F32 ) + sizeof( U32 ); + + // Fill message payload + memcpy( payloadPtr, &acid.acidConcentrate[ CAL_DATA_ACID_CONCENTRATE_1 ].acidConcMixRatio, sizeof( F32 ) ); + payloadPtr += sizeof( F32 ); + memcpy( payloadPtr, &bicarb.bicarbConcentrate[ CAL_DATA_BICARB_CONCENTRATE_1 ].bicarbConcMixRatio, sizeof( F32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &fillPrepTimeMS, sizeof( U32 ) ); + + // Serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer + serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_2_HD, ACK_REQUIRED ); +} + +/*********************************************************************//** + * @brief * The sendDGCalibrationRecord function sends out the DG calibration * record. * @details Inputs: none @@ -841,7 +876,7 @@ if ( DG_CMD_START == fillCmd.cmd ) { - startFillCmd( fillCmd.fillToVolumeMl ); + startFillCmd( fillCmd.fillToVolumeMl, fillCmd.targetFlowLPM ); } else {