Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r09cde48e11d32be58fe9e1e7c88ada33cff664f5 -r7d4711edd7b40cd3e29f43e766f79a8a09586fe9 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 09cde48e11d32be58fe9e1e7c88ada33cff664f5) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 7d4711edd7b40cd3e29f43e766f79a8a09586fe9) @@ -1,14 +1,14 @@ /************************************************************************** * -* Copyright (c) 2019-2023 Diality Inc. - All Rights Reserved. +* Copyright (c) 2019-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file SystemCommMessages.c * -* @author (last) Michael Garthwaite -* @date (last) 21-Aug-2023 +* @author (last) Dara Navaei +* @date (last) 20-Oct-2023 * * @author (original) Dara Navaei * @date (original) 05-Nov-2019 @@ -1132,6 +1132,27 @@ /*********************************************************************//** * @brief + * The handleParkConecentratePumpsCmd function handles a DG concentrate pumps park + * command message from the HD. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleParkConecentratePumpsCmd( MESSAGE_T *message ) +{ + BOOL result = FALSE; + + if ( message->hdr.payloadLen == 0 ) + { + result = handleConcentratePumpParkRequest(); + } + + sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, result ); +} + +/*********************************************************************//** + * @brief * The handleStartStopTrimmerHeaterCmd function handles a trimmer heater start/stop * command message from the HD. * @details Inputs: none @@ -1229,7 +1250,7 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } -/************************************************************************* +/*********************************************************************//** * @brief * The handleStartStopDGHeatDisinfect function handles a request start or * stop DG heat disifect mode. @@ -1686,7 +1707,7 @@ sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_UI, result ); } -/************************************************************************* +/*********************************************************************//** * @brief * The handleStartStopDGHeatDisinfectActiveCool function handles a request * start or stop DG heat disinfect active cool mode. @@ -1814,7 +1835,7 @@ serializeMessage( msg, COMM_BUFFER_OUT_CAN_DG_2_UI, ACK_REQUIRED ); } -/************************************************************************* +/*********************************************************************//** * @brief * The handleStartStopDGROPermeateSample function handles a request to * start or stop DG RO permeate sample mode. @@ -2006,6 +2027,8 @@ if ( ( 3 == message->hdr.payloadLen ) && ( 0x31 == message->payload[ 0 ] ) && ( 0x32 == message->payload[ 1 ] ) && ( 0x33 == message->payload[ 2 ] ) ) { testerLoggedIn = TRUE; + // The user logged in, so the set the dialin expiration date until the first check in from dialin is received + setDialinCheckInTimeStamp(); } else { @@ -2538,7 +2561,7 @@ BOOL result = FALSE; // verify payload length - if ( 0 == message->hdr.payloadLen ) + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) { memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); if ( FALSE == payload.reset ) @@ -2557,7 +2580,7 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } -/************************************************************************* +/*********************************************************************//** * @brief * The handleSetDrainPumpTargetOutletFlowLPM function handles a * request to set the drain pump outlet flow in L/min. @@ -2583,7 +2606,7 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } -/************************************************************************* +/*********************************************************************//** * @brief * The handleSetSwitchesStatusOverrideRequest function handles a * request to override the status of a switch in DG. @@ -3413,7 +3436,8 @@ U32 totalMessages; U32 payloadLength; - if ( message->hdr.payloadLen >= ( sizeof(currentMessage) + sizeof(totalMessages) + sizeof(payloadLength) ) ) + if ( ( message->hdr.payloadLen >= ( sizeof(currentMessage) + sizeof(totalMessages) + sizeof(payloadLength) ) ) && + ( DG_MODE_SERV == getCurrentOperationMode() ) ) { memcpy(¤tMessage, payloadPtr, sizeof(U32)); payloadPtr += sizeof(U32); @@ -3475,7 +3499,8 @@ U32 totalMessages; U32 payloadLength; - if ( message->hdr.payloadLen >= ( sizeof(currentMessage) + sizeof(totalMessages) + sizeof(payloadLength) ) ) + if ( ( message->hdr.payloadLen >= ( sizeof(currentMessage) + sizeof(totalMessages) + sizeof(payloadLength) ) ) && + ( DG_MODE_SERV == getCurrentOperationMode() ) ) { memcpy(¤tMessage, payloadPtr, sizeof(U32)); payloadPtr += sizeof(U32); @@ -3564,7 +3589,8 @@ U32 totalMessages; U32 payloadLength; - if ( message->hdr.payloadLen >= ( sizeof(currentMessage) + sizeof(totalMessages) + sizeof(payloadLength) ) ) + if ( ( message->hdr.payloadLen >= ( sizeof(currentMessage) + sizeof(totalMessages) + sizeof(payloadLength) ) ) && + ( DG_MODE_SERV == getCurrentOperationMode() ) ) { memcpy(¤tMessage, payloadPtr, sizeof(U32)); payloadPtr += sizeof(U32); @@ -5044,4 +5070,99 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } +/*********************************************************************//** + * @brief + * The handleTestDG77CStateTimerOverride function handles a request + * to override the heat disinfection timer at 77 C + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestDG77CStateTimerOverride( MESSAGE_T * message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetDG77CStateTimerOverride( payload.state.u32 ); + } + else + { + result = testResetDG77CStateTimerOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestDG82CStateTimerOverride function handles a request + * to override the heat disinfection timer at 82 C + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestDG82CStateTimerOverride( MESSAGE_T * message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetDG82CStateTimerOverride( payload.state.u32 ); + } + else + { + result = testResetDG82CStateTimerOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} + +/*********************************************************************//** + * @brief + * The handleTestChemDisinfectAcidOverride function handles a request + * to override the CD2 moving average in Chem disinfection. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleTestChemDisinfectAcidOverride( MESSAGE_T * message ) +{ + TEST_OVERRIDE_PAYLOAD_T payload; + BOOL result = FALSE; + + // verify payload length + if ( sizeof( TEST_OVERRIDE_PAYLOAD_T ) == message->hdr.payloadLen ) + { + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_PAYLOAD_T ) ); + if ( FALSE == payload.reset ) + { + result = testSetChemDisinfectionCD2AvgOverride( payload.state.f32 ); + } + else + { + result = testResetChemDisinfectionCD2AvgOverride(); + } + } + + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); +} /**@}*/