Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r71e2ca2cd5cc70a6b9c0c258b1445c57f1445fca -r894d80dda120f7b319c212dd1857f203daa27b07 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 71e2ca2cd5cc70a6b9c0c258b1445c57f1445fca) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 894d80dda120f7b319c212dd1857f203daa27b07) @@ -521,6 +521,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 @@ -839,7 +874,7 @@ if ( DG_CMD_START == fillCmd.cmd ) { - startFillCmd( fillCmd.fillToVolumeMl ); + startFillCmd( fillCmd.fillToVolumeMl, fillCmd.targetFlowLPM ); } else {