Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -red962b050e6b9714318a0b9034742efc2ccb9e4f -r2f2419f67d9d458837893fef5cc1b21870021026 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision ed962b050e6b9714318a0b9034742efc2ccb9e4f) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 2f2419f67d9d458837893fef5cc1b21870021026) @@ -781,11 +781,12 @@ * The sendDGFillCommand function constructs a DG fill command message * and queues the msg for transmit on the appropriate CAN channel. * @details Inputs: none - * @details Outputs: DG fill command msg constructed and queued. + * @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 * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL sendDGFillCommand( U32 fillToVolumeMl ) +BOOL sendDGFillCommand( U32 cmd, U32 fillToVolumeMl ) { BOOL result; MESSAGE_T msg; @@ -794,10 +795,12 @@ // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_DG_FILL_CMD; - msg.hdr.payloadLen = sizeof( U32 ); + msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ); + + memcpy( payloadPtr, &fillToVolumeMl, sizeof( U32 ) ); + payloadPtr += sizeof( U32 ); + memcpy( payloadPtr, &cmd, sizeof( U32 ) ); - memcpy( payloadPtr, &fillToVolumeMl, sizeof( U32 ) ); - // 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 );