Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r85457b793bef9f18e2d04cbc8f901c138eae3609 -r3477dd649f67442ad4bdea810ce5a251c1b0a2bf --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 85457b793bef9f18e2d04cbc8f901c138eae3609) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 3477dd649f67442ad4bdea810ce5a251c1b0a2bf) @@ -1140,8 +1140,6 @@ msg.hdr.msgID = MSG_ID_HD_VALVES_DATA; msg.hdr.payloadLen = sizeof( HD_VALVE_DATA_T ); - //HD_VALVE_DATA_T valveData; - memcpy( payloadPtr, valveData, sizeof( HD_VALVE_DATA_T ) ); // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer @@ -2427,10 +2425,10 @@ if ( message->hdr.payloadLen == sizeof(U32) ) { - VALVE_T payload; + U32 valve; - memcpy( &payload, message->payload, sizeof(U32) ); - homeValve( payload ); + memcpy( &valve, message->payload, sizeof(U32) ); + homeValve( (VALVE_T)valve ); result = TRUE; } @@ -2467,10 +2465,10 @@ if ( message->hdr.payloadLen == sizeof(U32) ) { - OPN_CLS_STATE_T payload; + U32 valveState; - memcpy( &payload, message->payload, sizeof(U32) ); - setValveAirTrap( payload ); + memcpy( &valveState, message->payload, sizeof(U32) ); + setValveAirTrap( (OPN_CLS_STATE_T)valveState ); result = TRUE; } @@ -2479,30 +2477,33 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } -/*********************************************************************//** +/************************************************************************* * @brief - * The handleSetBloodValve function handles a request to set the HD air - * (blood) trap valve to open or close + * The handleSetHDValvePositionOverrideRequest function handles a request to + * override the position of a valve * @details - * Inputs: none - * Outputs: message handled - * @param message a pointer to the message to handle + * Inputs : none + * Outputs : message handled + * @param message : a pointer to the message to handle * @return none *************************************************************************/ -void handleSetHDValvePosition( MESSAGE_T *message ) +void handleSetHDValvePositionOverrideRequest( MESSAGE_T *message ) { - BOOL result = FALSE; - - if ( message->hdr.payloadLen == (2 * sizeof(U32)) ) + TEST_OVERRIDE_ARRAY_PAYLOAD_T payload; + BOOL result = 0; + /* verify payload length */ + if ( sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) == message->hdr.payloadLen ) { - VALVE_POSITION_T payload; - - memcpy( &payload, message->payload, sizeof(U32) ); - //result = setValvePosition(); - - result = TRUE; + memcpy( &payload, message->payload, sizeof(TEST_OVERRIDE_ARRAY_PAYLOAD_T) ); + if ( 0 == payload.reset ) + { + result = testSetValvesPositionOverride( payload.index, (BOOL)(payload.state.u32) ); + } + else + { + result = testResetValvesPositionOverride( payload.index ); + } } - - // respond to request + /* respond to request */ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); }