Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r9224712d825c7ecee623abc78d704fbd3c2dbde8 -r361e8cae2edec18e5ba1a26690788b5c30ce4833 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 9224712d825c7ecee623abc78d704fbd3c2dbde8) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 361e8cae2edec18e5ba1a26690788b5c30ce4833) @@ -1127,10 +1127,6 @@ * @details * Inputs : none * Outputs : HD valves msg constructed and queued - * @param valve : HD valve ID - * @param currentPosEnum : Current position ID - * @param currentPosCount : Current position count - * @param current : Current of the valve * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL broadcastHDValves() @@ -1144,6 +1140,8 @@ 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 @@ -2453,22 +2451,32 @@ *************************************************************************/ DATA_OVERRIDE_HANDLER_FUNC_U32( U32, handleTestHDValvesBroadcastIntervalOverrideRequest, testSetValvesDataPublishInterval, testResetValvesDataPublishInterval ) - -void handleSetHDValvesPosition( MESSAGE_T *message ) +/*********************************************************************//** + * @brief + * The handleSetBloodValve function handles a request to set the HD air + * (blood) trap valve to open or close + * @details + * Inputs: none + * Outputs: message handled + * @param message a pointer to the message to handle + * @return none + *************************************************************************/ +void handleSetAirTrapValve( MESSAGE_T *message ) { - BOOL result; + BOOL result = FALSE; - if ( message->hdr.payloadLen == sizeof(LINEAR_F32_CAL_PAYLOAD_T) ) + if ( message->hdr.payloadLen == sizeof(U32) ) { - LINEAR_F32_CAL_PAYLOAD_T payload; + OPN_CLS_STATE_T payload; - memcpy( &payload, message->payload, sizeof(LINEAR_F32_CAL_PAYLOAD_T) ); - result = setDialInFlowCalibration( payload.gain, payload.offset ); + memcpy( &payload, message->payload, sizeof(U32) ); + setValveAirTrap( payload ); + + result = TRUE; } // respond to request sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); - } /*********************************************************************//** @@ -2481,16 +2489,16 @@ * @param message a pointer to the message to handle * @return none *************************************************************************/ -void handleSetBloodValve( MESSAGE_T *message ) +void handleSetHDValvePosition( MESSAGE_T *message ) { BOOL result = FALSE; - if ( message->hdr.payloadLen == sizeof(U32) ) + if ( message->hdr.payloadLen == (2 * sizeof(U32)) ) { - OPN_CLS_STATE_T payload; + VALVE_POSITION_T payload; memcpy( &payload, message->payload, sizeof(U32) ); - setValveBloodTrap( payload ); + //result = setValvePosition(); result = TRUE; }