Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r23ff586bf450a0fe6dd88bdac1fb433cfeb7e6e8 -r4979bda4723da492e500f380a0e2b33517843c28 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 23ff586bf450a0fe6dd88bdac1fb433cfeb7e6e8) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 4979bda4723da492e500f380a0e2b33517843c28) @@ -7,8 +7,8 @@ * * @file SystemCommMessages.c * -* @author (last) Dara Navaei -* @date (last) 20-Mar-2023 +* @author (last) Michael Garthwaite +* @date (last) 17-Mar-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -840,22 +840,18 @@ memcpy( &cmd, message->payload, sizeof(U32) ); - if ( DG_DISINFECT_FLUSH_STATE == cmd ) // Command 0 = Flush + if ( 0 == cmd ) // Command 0 = Flush { result = signalUserInitiateFlushMode(); } - else if ( DG_DISINFECT_HEAT_STATE == cmd ) // Command 1 = Heat disinfect + else if ( 1 == cmd ) // Command 1 = Heat disinfect { result = signalUserInitiateHeatDisinfectMode(); } - else if ( DG_DISINFECT_CHEM_STATE == cmd ) // Command 2 = chemical disinfect + else if ( 2 == cmd ) // Command 2 = chemical disinfect { result = signalUserInitiateChemicalDisinfectMode(); } - else if ( DG_DISINFECT_CHEM_FLUSH_STATE == cmd ) // Command 3 = chemical disinfect flush - { - result = signalUserInitiateChemcialDisinfectFlushMode(); - } } sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_HD_2_UI, result ); @@ -1798,35 +1794,6 @@ /*********************************************************************//** * @brief - * The sendDGStartChemicalDisinfectFlushModeCommand function constructs a DG - * start/stop chemical disinfect flush mode command message and queues the msg - * for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: DG start chemical disinfect flush mode command msg - * constructed and queued. - * @param start TRUE indicates start chemical disinfect flush mode - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL sendDGStartChemicalDisinfectFlushModeCommand( BOOL start ) -{ - BOOL result; - MESSAGE_T msg; - - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_START_STOP_CHEM_DISINFECT_FLUSH; - msg.hdr.payloadLen = sizeof( BOOL ); - - memcpy( msg.payload, &start, sizeof( BOOL ) ); - - // 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; -} - -/*********************************************************************//** - * @brief * The broadcastAlarmStatus function constructs an alarm status msg to * be broadcast and queues the msg for transmit on the appropriate CAN channel. * @details Inputs: none @@ -3351,7 +3318,7 @@ if ( ( CONFIRMATION_REQUEST_STATUS_REJECTED == status ) || ( CONFIRMATION_REQUEST_STATUS_ACCEPTED == status ) ) { - setConfirmationRequestStatus( (GENERIC_CONFIRM_ID_T)request_id, (CONFIRMATION_REQUEST_STATUS_T)status ); + setConfirmationRequestStatus( (GENERIC_CONFIRM_ID_T) request_id, (CONFIRMATION_REQUEST_STATUS_T) status ); } } @@ -3391,33 +3358,7 @@ serializeMessage( msg, COMM_BUFFER_OUT_CAN_HD_2_UI, ACK_NOT_REQUIRED ); } -/*********************************************************************//** - * @brief - * The handleSendChemFlushPassFailToDG function sends the result of the - * chemical disinfect flush sample pass/fail to DG - * @details Inputs: none - * @details Outputs: none - * @param status which is the status of the result - * @return none - *************************************************************************/ -void handleSendChemFlushPassFailToDG( U32 status ) -{ - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_HD_SEND_CHEM_FLUSH_SAMPLE_PASS_FAIL_TO_DG; - // The payload length is U32 Request ID, U32 Type - msg.hdr.payloadLen = sizeof( U32 ); - - memcpy( payloadPtr, &status, 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_HD_2_DG, ACK_NOT_REQUIRED ); -} - - /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ @@ -8013,75 +7954,6 @@ /*********************************************************************//** * @brief - * The handleDialInPumpHardStopRequest function handles a - * request to stop the dial in pump. - * @details Inputs: none - * @details Outputs: message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -void handleDialInPumpHardStopRequest( MESSAGE_T * message ) -{ - BOOL result = FALSE; - - // Verify payload length - if ( ( 0 == message->hdr.payloadLen ) && ( TRUE == isTestingActivated() ) ) - { - signalDialInPumpHardStop(); - } - - // Respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** - * @brief - * The handleDialOutPumpHardStopRequest function handles a - * request to stop the dial out pump. - * @details Inputs: none - * @details Outputs: message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -void handleDialOutPumpHardStopRequest( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // Verify payload length - if ( ( 0 == message->hdr.payloadLen ) && ( TRUE == isTestingActivated() ) ) - { - signalDialOutPumpHardStop(); - } - - // Respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** - * @brief - * The handleBloodPumpHardStopRequest function handles a - * request to stop the blood pump. - * @details Inputs: none - * @details Outputs: message handled - * @param message : a pointer to the message to handle - * @return none - *************************************************************************/ -void handleBloodPumpHardStopRequest( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - // Verify payload length - if ( ( 0 == message->hdr.payloadLen ) && ( TRUE == isTestingActivated() ) ) - { - signalBloodPumpHardStop(); - } - - // Respond to request - sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); -} - -/*********************************************************************//** - * @brief * The handleSetBootloaderRequest function handles a * request to set the flag to trigger update mode * after a reboot. @@ -8094,11 +7966,8 @@ { BOOL result = FALSE; - // verify payload length - if ( 0 == message->hdr.payloadLen ) - { - result = setBootloaderFlag(); - } + // For now, there's no flag to set to stay in bootloader, + // this might change in the future, so leave message. // respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); @@ -8130,7 +7999,8 @@ /*********************************************************************//** * @brief * The handleEnterBootloaderNowRequest function handles a - * request immediately jump to the bootloader application. + * request to reboot the system. A software reset will cause the bootloader + * to stay active for XX seconds. * @details Inputs: none * @details Outputs: message handled * @param message : a pointer to the message to handle @@ -8146,7 +8016,7 @@ if (result) { // Jump to the bootloader, there is no coming back from this. - startBootloader(); + rebootSystemNow(); } }