Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r00b0fcefb9f74e7c050b5c83ad5c285e6769ef78 -r4638fd77792d0c7ecbeca3c84369cbed6c2ecee1 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 00b0fcefb9f74e7c050b5c83ad5c285e6769ef78) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 4638fd77792d0c7ecbeca3c84369cbed6c2ecee1) @@ -1885,36 +1885,39 @@ /*********************************************************************//** * @brief -* The handleStartStopInletUVReactor function handles a request to turn on/off -* the inlet UV reactor. +* The handleStartStopUVReactors function handles a request to turn on/off +* the UV reactors. * @details Inputs: none * @details Outputs: message handled * @param message a pointer to the message to handle * @return none *************************************************************************/ -BOOL handleStartStopInletUVReactor( MESSAGE_T *message ) +void handleStartStopUVReactors( MESSAGE_T *message ) { + TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; BOOL result = FALSE; - if ( message->hdr.payloadLen == sizeof(U32) ) + // verify payload length + if ( sizeof( TEST_OVERRIDE_ARRAY_PAYLOAD_T ) == message->hdr.payloadLen ) { - BOOL startingReactor; - - memcpy( &startingReactor, message->payload, sizeof(U32) ); - - if ( TRUE == startingReactor ) + memcpy( &payload, message->payload, sizeof( TEST_OVERRIDE_ARRAY_PAYLOAD_T ) ); + if ( payload.index < NUM_OF_UV_REACTORS ) { - result = turnOnUVReactor( INLET_UV_REACTOR ); + switch ( payload.state.u32 ) + { + case TURN_OFF: + result = turnOffUVReactor( (UV_REACTORS_T)payload.index ); + break; + + case TURN_ON: + result = turnOnUVReactor( (UV_REACTORS_T)payload.index ); + break; + } } - else - { - result = turnOffUVReactor( INLET_UV_REACTOR ); - } } - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, result ); - - return result; + // respond to request + sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } /*********************************************************************//** @@ -1926,7 +1929,7 @@ * @param message a pointer to the message to handle * @return none *************************************************************************/ -void handleUVReactorsDataPublishIntervalOverride( MESSAGE_T *message ) +void handleTestUVReactorsDataPublishIntervalOverride( MESSAGE_T *message ) { TEST_OVERRIDE_PAYLOAD_T payload; BOOL result = FALSE; @@ -1951,48 +1954,14 @@ /*********************************************************************//** * @brief -* The handleStartStopOutletUVReactor function handles a request to turn -* on/off the outlet UV reactor. -* @details Inputs: none -* @details Outputs: message handled -* @param message a pointer to the message to handle -* @return none -*************************************************************************/ -BOOL handleStartStopOutletUVReactor( MESSAGE_T *message ) -{ - BOOL result = FALSE; - - if ( message->hdr.payloadLen == sizeof(U32) ) - { - BOOL startingReactor; - - memcpy( &startingReactor, message->payload, sizeof(U32) ); - - if ( TRUE == startingReactor ) - { - result = turnOnUVReactor( OUTLET_UV_REACTOR ); - } - else - { - result = turnOffUVReactor( OUTLET_UV_REACTOR ); - } - } - - sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, result ); - - return result; -} - -/*********************************************************************//** -* @brief * The handleUVReactorsHealthOverride function handles UV reactors health * status override. * @details Inputs: none * @details Outputs: message handled * @param message a pointer to the message to handle * @return none *************************************************************************/ -void handleUVReactorsHealthOverride( MESSAGE_T *message ) +void handleTestUVReactorsHealthOverride( MESSAGE_T *message ) { TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; BOOL result = FALSE;