Index: firmware/App/Controllers/BloodLeak.c =================================================================== diff -u -raa7b1f5f68aae23c1c52b32658fcb625c29accfb -r0444258d6627e442d76ae6519802a334c73a141d --- firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision aa7b1f5f68aae23c1c52b32658fcb625c29accfb) +++ firmware/App/Controllers/BloodLeak.c (.../BloodLeak.c) (revision 0444258d6627e442d76ae6519802a334c73a141d) @@ -84,6 +84,8 @@ #define BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE 12 ///< Blood leak embedded mode command queue maximum size. #define BLOOD_LEAK_EMB_MODE_ZERO_CMD_RQRD_Q 5 ///< Blood leak embedded mode zero command required queue count. #define BLOOD_LEAK_EMB_MODE_NUM_OF_RETRIES 3 ///< Blood leak embedded mode number of retries to enqueue. +#define BLOOD_LEAK_EMB_MODE_INFO_CMD_TIMOUE_MS ( 2 * MS_PER_SECOND ) ///< Blood leak embedded mode informative command timeout in milliseconds. +#define BLOOD_LEAK_EMB_MODE_NUM_OF_INFO_CMDS 3 ///< Blood leak embedded mode number of informative commands. #define BLOOD_LEAK_FPGA_ERROR_TIMEOUT_MS ( 2 * MS_PER_SECOND ) ///< Blood leak embedded mode FPGA error timeout in milliseconds. @@ -170,6 +172,8 @@ static U08 bloodLeakEmbModeCmdQCount; ///< Blood leak embedded mode command queue count. static BOOL bloodLeakEmbModeHasZeroBeenRqustd; ///< Blood leak embedded mode flag to indicate zero has been requested. static U32 bloodLeakEmbModeCmdEnqueueCount; ///< Blood leak embedded mode command enqueue count. +static U32 bloodLeakEmbModeInfoCmdEnqueueTimer; ///< Blood leak embedded mode informative command (i.e. I, V, D) timer. +static U32 bloodLeakEmbModeInfoCmdCounter; ///< Blood leak embedded mode informative command counter. // ********** private function prototypes ********** @@ -192,6 +196,7 @@ static U08 dequeueEmbModeCmd( void ); static BOOL isEmbModeCmdQueueEmpty( void ); static U32 getAvailableEmbModeQueueCount( void ); +static void enqueueInfoEmbModeCmds( void ); /*********************************************************************//** * @brief @@ -204,37 +209,40 @@ * bloodLeakPersistenceCtr, bloodLeakSignalEmbModeReq, * bloodLeakEmbModeRqstedCmd, bloodLeakEmbModeOpsStartTime, bloodLeakEmbModeRespBuffer, * bloodLeakEmbModeRespIndex, bloodLeakExitNormalRequested, - * bloodLeakEmbModeCmdSeqLength, bloodLeakEmbModeHasRxRqstBeenSent + * bloodLeakEmbModeCmdSeqLength, bloodLeakEmbModeHasRxRqstBeenSent, + * bloodLeakEmbModeInfoCmdEnqueueTimer, bloodLeakEmbModeInfoCmdCounter * @return none *************************************************************************/ void initBloodLeak( void ) { // Initialize the embedded mode specifications initEmbModeSpecs(); - bloodLeakDataPublicationCounter = DATA_PUBLISH_COUNTER_START_COUNT; - bloodLeakState = BLOOD_LEAK_WAIT_FOR_POST_STATE; - bloodLeakStatus.data = BLOOD_LEAK_NOT_DETECTED; - bloodLeakStatus.ovInitData = BLOOD_LEAK_NOT_DETECTED; - bloodLeakStatus.ovData = BLOOD_LEAK_NOT_DETECTED; - bloodLeakStatus.override = OVERRIDE_RESET; - bloodLeakSelfTestStatus = SELF_TEST_STATUS_IN_PROGRESS; - bloodLeakUARTCmdIndex = 0; - bloodLeakSetPointSeqLength = 0; - bloodLeakPersistenceCtr = 0; - bloodLeakSignalEmbModeReq = FALSE; - bloodLeakEmbModeRqstedCmd = NU_EMB_MODE_CMD; - bloodLeakEmbModeSubstate = BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMAND_STATE; - bloodLeakEmbModeOpsStartTime = 0; - bloodLeakEmbModeRespIndex = 0; - bloodLeakExitNormalRequested = FALSE; - bloodLeakEmbModeCmdSeqLength = 0; - bloodLeakEmbModeHasRxRqstBeenSent = FALSE; - bloodLeakEmbModeCmdQFrontIndex = 0; - bloodLeakEmbModeCmdQRearIndex = 0; - bloodLeakEmbModeCmdQCount = 0; - bloodLeakEmbModeHasZeroBeenRqustd = FALSE; - bloodLeakEmbModeCmdEnqueueCount = 0; + bloodLeakDataPublicationCounter = DATA_PUBLISH_COUNTER_START_COUNT; + bloodLeakState = BLOOD_LEAK_WAIT_FOR_POST_STATE; + bloodLeakStatus.data = BLOOD_LEAK_NOT_DETECTED; + bloodLeakStatus.ovInitData = BLOOD_LEAK_NOT_DETECTED; + bloodLeakStatus.ovData = BLOOD_LEAK_NOT_DETECTED; + bloodLeakStatus.override = OVERRIDE_RESET; + bloodLeakSelfTestStatus = SELF_TEST_STATUS_IN_PROGRESS; + bloodLeakUARTCmdIndex = 0; + bloodLeakSetPointSeqLength = 0; + bloodLeakPersistenceCtr = 0; + bloodLeakSignalEmbModeReq = FALSE; + bloodLeakEmbModeRqstedCmd = NU_EMB_MODE_CMD; + bloodLeakEmbModeSubstate = BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMAND_STATE; + bloodLeakEmbModeOpsStartTime = 0; + bloodLeakEmbModeRespIndex = 0; + bloodLeakExitNormalRequested = FALSE; + bloodLeakEmbModeCmdSeqLength = 0; + bloodLeakEmbModeHasRxRqstBeenSent = FALSE; + bloodLeakEmbModeCmdQFrontIndex = 0; + bloodLeakEmbModeCmdQRearIndex = 0; + bloodLeakEmbModeCmdQCount = 0; + bloodLeakEmbModeHasZeroBeenRqustd = FALSE; + bloodLeakEmbModeCmdEnqueueCount = 0; + bloodLeakEmbModeInfoCmdEnqueueTimer = getMSTimerCount(); + bloodLeakEmbModeInfoCmdCounter = 0; // Set the blood leak embedded mode command queue to zero memset( bloodLeakEmbModeCmdQ, 0x0, BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE ); @@ -300,6 +308,8 @@ break; } + enqueueInfoEmbModeCmds(); + checkFPGAPersistentErrorCountAlarm( FPGA_PERS_ERROR_BLOOD_LEAK_SENSOR, getFPGABloodLeakRxErrorCount() ); // Publish blood leak data if due @@ -975,11 +985,11 @@ convertString2Integer( bloodLeakEmbModeRqstedCmd, length ); + sendBloodLeakEmbeddedModeCommandResponse( bloodLeakEmbModeRqstedCmd, length, bloodLeakEmbModeRespBuffer ); + // Done with receiving the data bloodLeakEmbModeRqstedCmd = NU_EMB_MODE_CMD; state = BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMAND_STATE; - - sendBloodLeakEmbeddedModeCommandResponse( length, bloodLeakEmbModeRespBuffer ); } if ( TRUE == didTimeout( bloodLeakEmbModeOpsStartTime, commandTimeoutMS ) ) @@ -993,10 +1003,10 @@ convertString2Integer( bloodLeakEmbModeRqstedCmd, length ); + sendBloodLeakEmbeddedModeCommandResponse( bloodLeakEmbModeRqstedCmd, length, bloodLeakEmbModeRespBuffer ); + bloodLeakEmbModeRqstedCmd = NU_EMB_MODE_CMD; state = BLOOD_LEAK_EMB_MODE_WAIT_FOR_COMAND_STATE; - - sendBloodLeakEmbeddedModeCommandResponse( length, bloodLeakEmbModeRespBuffer ); } return state; @@ -1403,7 +1413,44 @@ return BLOOD_LEAK_EMB_MODE_CMD_Q_MAX_SIZE - bloodLeakEmbModeCmdQCount; } +/*********************************************************************//** + * @brief + * The enqueueInfoEmbModeCmds function enqueues the informative embedded + * mode commands. + * @details Inputs: bloodLeakEmbModeInfoCmdEnqueueTimer, bloodLeakState, + * bloodLeakEmbModeInfoCmdCounter + * @details Outputs: bloodLeakEmbModeInfoCmdEnqueueTimer, bloodLeakState, + * bloodLeakEmbModeInfoCmdCounter + * @return none + *************************************************************************/ +static void enqueueInfoEmbModeCmds( void ) +{ + if ( ( TRUE == didTimeout( bloodLeakEmbModeInfoCmdEnqueueTimer, BLOOD_LEAK_EMB_MODE_INFO_CMD_TIMOUE_MS ) ) && + ( bloodLeakState >= BLOOD_LEAK_INIT_STATE ) ) + { + // Enqueue the next command. Make sure the blood leak state is greater than init state since in the post state and + // check for set point, other commands are being enqueued for checking + if ( 0 == bloodLeakEmbModeInfoCmdCounter ) + { + enqueueEmbModeCmd( I_EMB_MODE_CMD ); + } + else if ( 1 == bloodLeakEmbModeInfoCmdCounter ) + { + enqueueEmbModeCmd( V_EMB_MODE_CMD ); + } + else if ( 2 == bloodLeakEmbModeInfoCmdCounter ) + { + enqueueEmbModeCmd( D_EMB_MODE_CMD ); + } + // Set the timer for the next time out to enqueue + // Reset the counter. The counter starts from 0 + bloodLeakEmbModeInfoCmdEnqueueTimer = getMSTimerCount(); + bloodLeakEmbModeInfoCmdCounter = INC_WRAP( bloodLeakEmbModeInfoCmdCounter, 0, BLOOD_LEAK_EMB_MODE_NUM_OF_INFO_CMDS - 1 ); + } +} + + /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ Index: firmware/App/Modes/SelfTests.c =================================================================== diff -u -rcd21cbb4e733bfdf52f83bdca7a905645022c572 -r0444258d6627e442d76ae6519802a334c73a141d --- firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision cd21cbb4e733bfdf52f83bdca7a905645022c572) +++ firmware/App/Modes/SelfTests.c (.../SelfTests.c) (revision 0444258d6627e442d76ae6519802a334c73a141d) @@ -68,7 +68,6 @@ #define DIP_FLOW_RATE_FIRST_DISPLACEMENT_ML_MIN 100 ///< Dialysate inlet pump flow rate during the first displacement in wet self-test. #define DIP_FLOW_RATE_SECOND_DISPLACEMENT_ML_MIN 600 ///< Dialysate inlet pump flow rate during the second displacement in wet self-test. -#define WET_SELF_TEST_RESERVOIR_ONE_SETUP_VOLUME_ML 1200.0F ///< Setup volume for reservoir one before wet self-test in ml. #define WET_SELF_TEST_FIRST_DISPLACEMENT_TARGET_VOLUME_ML 100.0F ///< Target of first displacement volume in ml. #define WET_SELF_TEST_SECOND_DISPLACEMENT_TARGET_VOLUME_ML 600.0F ///< Target of second displacement volume in ml. #define WET_SELF_TEST_INTEGRATED_VOLUME_PCT_TOLERANCE 0.05F ///< Tolerance on integrated volume as a percentage (5%). @@ -86,9 +85,6 @@ #define PRESSURE_CHECK_START_PRESSURE_TOLERANCE_MMHG 10.0F ///< Prior to dry pressure leak test, arterial and venous pressure sensors should read zero +/- this tolerance. #define MAX_EMPTY_RESERVOIR_WEIGHT_G 15.0F ///< Maximum reservoir weight to be considered empty for cartridge pressure leak test. -/// Multiplier to conver flow (mL/min) into volume (mL) for period of general task interval. -static const F32 SELF_TEST_FLOW_INTEGRATOR = ( ( 1.0F * TASK_GENERAL_INTERVAL ) / ( SEC_PER_MIN * MS_PER_SECOND ) ); - // ********** private data ********** static NO_CART_SELF_TESTS_STATE_T currentNoCartSelfTestsState; ///< Current state of the no cartridge self-tests state machine. @@ -114,7 +110,6 @@ static U32 displacementStartTime; ///< Dialysate displacement starting time. static F32 fmdIntegratedVolume; ///< FMD integrated volume over displacement time. static F32 reservoirVolume[ NUM_OF_DG_RESERVOIRS ]; ///< Hold the current volume of all reservoirs. -static F32 setupDisplacementVolume; ///< Hold the setup displacement volume to get reservoir one to target volume. static BOOL isValvesSettingSent; ///< Flag indicates valve setting change has been send to DG. static U32 selfTestStartTime; ///< Starting time of self-test (in ms). @@ -1426,24 +1421,20 @@ *************************************************************************/ static WET_SELF_TESTS_STATE_T handleWetSelfTestStartState( void ) { - WET_SELF_TESTS_STATE_T state = WET_SELF_TESTS_START_STATE; + WET_SELF_TESTS_STATE_T state = WET_SELF_TESTS_SETUP_STATE; F32 resOneWeight = getReservoirWeightLargeFilter( DG_RESERVOIR_1 ); - setupDisplacementVolume = fabs( resOneWeight - WET_SELF_TEST_RESERVOIR_ONE_SETUP_VOLUME_ML ); F32 bolusVol = getTreatmentParameterF32( TREATMENT_PARAM_HEPARIN_BOLUS_VOLUME ); isValvesSettingSent = TRUE; setValvePosition( VDI, VALVE_POSITION_C_CLOSE ); setValvePosition( VDO, VALVE_POSITION_C_CLOSE ); - setDialInPumpTargetFlowRate( DIP_FLOW_RATE_SETUP_ML_MIN, MOTOR_DIR_FORWARD, PUMP_CONTROL_MODE_OPEN_LOOP ); fmdIntegratedVolume = 0.0F; if ( ( bolusVol > 0.0F ) && ( getSyringePumpVolumeDelivered() < bolusVol ) ) { startHeparinBolus(); // moved here from startHeparinPump() in Dialysis.c } - state = WET_SELF_TESTS_SETUP_STATE; - if ( TRUE == doesAlarmStatusIndicateStop() ) { state = WET_SELF_TESTS_STOPPED_STATE; @@ -1463,17 +1454,10 @@ *************************************************************************/ static WET_SELF_TESTS_STATE_T handleWetSelfTestSetupState( void ) { - WET_SELF_TESTS_STATE_T state = WET_SELF_TESTS_SETUP_STATE; + WET_SELF_TESTS_STATE_T state = WET_SELF_TESTS_BUBBLES_STATE; - setupDisplacementVolume -= ( SELF_TEST_FLOW_INTEGRATOR * getMeasuredDialInFlowRate() ); + selfTestBubble( ADV ); - if ( setupDisplacementVolume <= 0.0 ) - { - signalDialInPumpHardStop(); - selfTestBubble( ADV ); - state = WET_SELF_TESTS_BUBBLES_STATE; - } - if ( TRUE == doesAlarmStatusIndicateStop() ) { state = WET_SELF_TESTS_STOPPED_STATE; Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r758497628fa5839a2b6661a9d7c32fd3b11db2bd -r0444258d6627e442d76ae6519802a334c73a141d --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 758497628fa5839a2b6661a9d7c32fd3b11db2bd) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 0444258d6627e442d76ae6519802a334c73a141d) @@ -802,7 +802,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -999,7 +999,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1147,7 +1147,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1185,7 +1185,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1206,7 +1206,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1242,7 +1242,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1263,7 +1263,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1299,7 +1299,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1335,7 +1335,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -1370,7 +1370,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2113,7 +2113,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2141,7 +2141,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2226,7 +2226,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2276,7 +2276,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2682,7 +2682,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2707,7 +2707,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2731,7 +2731,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2760,7 +2760,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2785,7 +2785,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2810,7 +2810,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2835,7 +2835,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2867,7 +2867,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2926,7 +2926,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -2982,7 +2982,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -3039,7 +3039,7 @@ } else { - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, FALSE ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } } @@ -3272,7 +3272,6 @@ *************************************************************************/ void handleUIConfirmationResponse( MESSAGE_T *message ) { - BOOL result = FALSE; U08* payloadPtr = message->payload; if ( message->hdr.payloadLen == 2 * sizeof(U32) ) @@ -3291,7 +3290,7 @@ } } - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, result ); + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } /*********************************************************************//** @@ -7520,11 +7519,12 @@ * the blood leak embedded mode command response. * @details Inputs: none * @details Outputs: blood leak embedded mode command response msg constructed and queued + * @param cmd: the command its response is being sent * @param responseLen: the length of the buffer * @param response: pointer to the response buffer * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ -BOOL sendBloodLeakEmbeddedModeCommandResponse( U32 responseLen, U08* response ) +BOOL sendBloodLeakEmbeddedModeCommandResponse( U08 cmd, U32 responseLen, U08* response ) { BOOL result; MESSAGE_T msg; @@ -7533,8 +7533,10 @@ // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_HD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE; - msg.hdr.payloadLen = sizeof( U32 ) + responseLen; + msg.hdr.payloadLen = sizeof( U08 ) + sizeof( U32 ) + responseLen; + memcpy( payloadPtr, &cmd, sizeof( U08 ) ); + payloadPtr += sizeof( U08 ); memcpy( payloadPtr, &responseLen, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); memcpy( payloadPtr, response, responseLen ); Index: firmware/App/Services/SystemCommMessages.h =================================================================== diff -u -r758497628fa5839a2b6661a9d7c32fd3b11db2bd -r0444258d6627e442d76ae6519802a334c73a141d --- firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 758497628fa5839a2b6661a9d7c32fd3b11db2bd) +++ firmware/App/Services/SystemCommMessages.h (.../SystemCommMessages.h) (revision 0444258d6627e442d76ae6519802a334c73a141d) @@ -837,7 +837,7 @@ void handleSetBloodLeakEmbeddedModeCommand( MESSAGE_T* message ); // MSG_ID_HD_SEND_BLOOD_LEAK_EMB_MODE_RESPONSE -BOOL sendBloodLeakEmbeddedModeCommandResponse( U32 responseLen, U08* response ); +BOOL sendBloodLeakEmbeddedModeCommandResponse( U08 cmd, U32 responseLen, U08* response ); // MSG_ID_HD_SEND_ALARMS_COMMAND void handleResendAllAlarmsCommand( MESSAGE_T* message );