Index: firmware/App/Services/SystemCommMessages.c =================================================================== diff -u -r26f63d0260a3c35277e3e6dbca3573c253775318 -r622eebf6fb7f1c6c232ffd82bc072dd30a7b3f94 --- firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 26f63d0260a3c35277e3e6dbca3573c253775318) +++ firmware/App/Services/SystemCommMessages.c (.../SystemCommMessages.c) (revision 622eebf6fb7f1c6c232ffd82bc072dd30a7b3f94) @@ -344,375 +344,7 @@ return result; } -/*********************************************************************//** - * @brief - * The broadcastAccelData function constructs an accelerometer data msg to - * be broadcast and queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: accelerometer data broadcast msg constructed and queued. - * @param x X axis vector magnitude (in g) - * @param y Y axis vector magnitude (in g) - * @param z Z axis vector magnitude (in g) - * @param xm max X axis vector magnitude (in g) - * @param ym max Y axis vector magnitude (in g) - * @param zm max Z axis vector magnitude (in g) - * @param xt X axis tilt (in degrees) - * @param yt Y axis tilt (in degrees) - * @param zt Z axis tilt (in degrees) - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastAccelData( F32 x, F32 y, F32 z, F32 xm, F32 ym, F32 zm, F32 xt, F32 yt, F32 zt ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - ACCEL_DATA_PAYLOAD_T payload; - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_ACCELEROMETER_DATA; - msg.hdr.payloadLen = sizeof( ACCEL_DATA_PAYLOAD_T ); - payload.x = x; - payload.y = y; - payload.z = z; - payload.xMax = xm; - payload.yMax = ym; - payload.zMax = zm; - payload.xTilt = xt; - payload.yTilt = yt; - payload.zTilt = zt; - - memcpy( payloadPtr, &payload, sizeof( ACCEL_DATA_PAYLOAD_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastRTCEpoch function constructs an epoch msg to be broadcast - * and queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: RTC time and date in epoch - * @param epoch Current time and date in epoch - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastRTCEpoch( U32 epoch ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_RTC_EPOCH; - msg.hdr.payloadLen = sizeof( U32 ); - - memcpy( payloadPtr, &epoch, sizeof( U32 ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastLoadCellData function sends out load cell data. - * @details Inputs: none - * @details Outputs: load cell data msg constructed and queued - * @param loadCell which is the loadcells data structure pointer - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastLoadCellData( LOAD_CELL_DATA_T *loadCell ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_LOAD_CELL_READINGS; - msg.hdr.payloadLen = sizeof( LOAD_CELL_DATA_T ); - - memcpy( payloadPtr, loadCell, sizeof( LOAD_CELL_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastValvesStates function sends out DG valves states. - * @details Inputs: none - * @details Outputs: Valves states msg constructed and queued - * @param valvesStates valves states - * refer to setFPGAValveStates function in FPGA.c for details - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastValvesStates( U16 valvesStates ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_VALVES_STATES; - msg.hdr.payloadLen = sizeof( U16 ); - - memcpy( payloadPtr, &valvesStates, sizeof( U16 ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastDrainPumpData function sends out the drain pump data. - * @details Inputs: none - * @details Outputs: Drain pump data msg constructed and queued - * @param drainPumpData which is the drain pump data structure pointer - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastDrainPumpData( DRAIN_PUMP_DATA_T *drainPumpData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DRAIN_PUMP_DATA; - msg.hdr.payloadLen = sizeof( DRAIN_PUMP_DATA_T ); - - memcpy( payloadPtr, drainPumpData, sizeof( DRAIN_PUMP_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastDGHDOperationMode function constructs a DG operation mode - * broadcast message and queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: DG operation mode msg constructed and queued - * @param mode current operation mode of the DG. - * @param subMode current sub-mode of the current operation mode of the DG. - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastDGOperationMode( U32 mode, U32 subMode ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_OP_MODE; - msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ); - - memcpy( payloadPtr, &mode, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - memcpy( payloadPtr, &subMode, sizeof( U32 ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastROPumpData function sends out RO pump data. - * @details Inputs: none - * @details Outputs: RO pump data msg constructed and queued - * @param tgtPressure target pressure for RO pump in PSI - * @param measFlow measure RO flow rate in LPM - * @param setPWM set PWM duty cycle in % - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastROPumpData( RO_PUMP_DATA_T *pumpData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_RO_PUMP_DATA; - msg.hdr.payloadLen = sizeof( RO_PUMP_DATA_T ); - - memcpy( payloadPtr, pumpData, sizeof( RO_PUMP_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastPressureSensorsData function sends out DG pressure data. - * @details Inputs: none - * @details Outputs: Pressure data msg constructed and queued - * @param measROIn measured RO pump inlet pressure in PSI - * @param measROOut measured RO pump outlet pressure in PSI - * @param measDrainIn measured Drain pump inlet pressure in PSI - * @param measDrainOut measured Drain pump outlet pressure in PSI - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastPressureSensorsData( F32 measROIn, F32 measROOut, F32 measDrainIn, F32 measDrainOut ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - PRESSURES_DATA_T payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_PRESSURES_DATA; - msg.hdr.payloadLen = sizeof( PRESSURES_DATA_T ); - - payload.roPumpInletPressure = measROIn; - payload.roPumpOutletPressure = measROOut; - payload.drainPumpInletPressure = measDrainIn; - payload.drainPumpOutletPressure = measDrainOut; - - memcpy( payloadPtr, &payload, sizeof( PRESSURES_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastReservoirData function broadcasts the DG reservoir data. - * @details Inputs: none - * @details Outputs: Reservoir data msg constructed and queued - * @param resID ID of currently active reservoir - * @param fillToVol Current target fill to volume for inactive reservoir - * @param drainToVol Current target drain to volume for inactive reservoir - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastReservoirData( U32 resID, U32 fillToVol, U32 drainToVol ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - RESERVOIR_DATA_T payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_RESERVOIR_DATA; - msg.hdr.payloadLen = sizeof( RESERVOIR_DATA_T ); - - payload.activeReservoir = resID; - payload.fillToVolumeMl = fillToVol; - payload.drainToVolumeMl = drainToVol; - - memcpy( payloadPtr, &payload, sizeof( RESERVOIR_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastTemperatureSensorsData function sends out DG temperature - * sensors data. - * @details Inputs: none - * @details Outputs: temperature sensors data message constructed and queued - * @param tempSensorsData which is constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastTemperatureSensorsData ( TEMPERATURE_SENSORS_DATA_T* tempSensorsData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_TEMPERATURE_DATA; - msg.hdr.payloadLen = sizeof( TEMPERATURE_SENSORS_DATA_T ); - - memcpy( payloadPtr, tempSensorsData, sizeof( TEMPERATURE_SENSORS_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastThermistorsData function sends out the thermistors data. - * @details - * @details Inputs: none - * @details Outputs: thermistors data msg constructed and queued - * @param thermistorsData which is constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastThermistorsData( THERMISTORS_DATA_T *thermistorsData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_THERMISTORS_DATA; - msg.hdr.payloadLen = sizeof( THERMISTORS_DATA_T ); - - memcpy( payloadPtr, thermistorsData, sizeof( THERMISTORS_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastFansData function sends out the fans data. - * @details Inputs: none - * @details Outputs: fans data msg constructed and queued - * @param fansData which is constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastFansData( FANS_DATA_T *fansData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_FANS_DATA; - msg.hdr.payloadLen = sizeof( FANS_DATA_T ); - - memcpy( payloadPtr, fansData, sizeof( FANS_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - // *********************************************************************** // **************** Message Handling Helper Functions ******************** // *********************************************************************** @@ -877,117 +509,6 @@ /*********************************************************************//** * @brief - * The broadcastConductivityData function sends out conductivity data. - * @details Inputs: none - * @details Outputs: conductivity data message constructed and queued - * @param conductivityDataPtr which is the data msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastConductivityData( void * conductivityDataPtr ) -{ - BOOL result; - MESSAGE_T msg; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_CONDUCTIVITY_DATA; - msg.hdr.payloadLen = sizeof( CONDUCTIVITY_DATA_T ); - - memcpy( &msg.payload, conductivityDataPtr, sizeof( CONDUCTIVITY_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastUVReactorsData function sends out the UV reactors data. - * @details Inputs: none - * @details Outputs: UV reactors data msg constructed and queued - * @param uvReactorsData which is UV reactors msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastUVReactorsData( UV_REACTORS_DATA_T *uvReactorsData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_UV_REACTORS_DATA; - msg.hdr.payloadLen = sizeof( UV_REACTORS_DATA_T ); - - memcpy( payloadPtr, uvReactorsData, sizeof( UV_REACTORS_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastHeatDisinfectData function sends out the heat disinfect - * mode data. - * @details Inputs: none - * @details Outputs: heat disinfect data msg constructed and queued - * @param heatDisinfectData which is heat disinfect msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastHeatDisinfectData( MODE_HEAT_DISINFECT_DATA_T *heatDisinfectData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_HEAT_DISINFECT_DATA; - msg.hdr.payloadLen = sizeof( MODE_HEAT_DISINFECT_DATA_T ); - - memcpy( payloadPtr, heatDisinfectData, sizeof( MODE_HEAT_DISINFECT_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastFilterFlushData function sends out the filter flush progress data. - * @details Inputs: none - * @details Outputs: filter flush data msg constructed and queued - * @param timeout flush filter timeout (in sec) - * @param countdown flush filter timeout count down (in sec) - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastFilterFlushData( U32 timeout, U32 countdown ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_FILTER_FLUSH_PROGRESS; - msg.hdr.payloadLen = sizeof( U32 ) + sizeof( U32 ); - - memcpy( payloadPtr, &timeout, sizeof( U32 ) ); - payloadPtr += sizeof( U32 ); - memcpy( payloadPtr, &countdown, sizeof( U32 ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief * The sendDGCalibrationRecord function sends out the DG calibration * record. * @details Inputs: none @@ -1026,203 +547,9 @@ return result; } -/***********************************************************************//** - * @brief - * The broadcastFluidLeakState function constructs a DG fluid leak state msg to \n - * be broadcasted and queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: fluid leak state msg constructed and queued - * @param state fluid leak state - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastFluidLeakState( FLUID_LEAK_STATES_T state ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - U32 leakState = (U32)state; - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_FLUID_LEAK_STATE; - msg.hdr.payloadLen = sizeof( U32 ); - - memcpy( payloadPtr, &leakState, sizeof( U32 ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - /*********************************************************************//** * @brief - * The broadcastVoltagesData function constructs a monitored voltages data msg to - * be broadcast and queues the msg for transmit on the appropriate CAN channel. - * @details Inputs: none - * @details Outputs: monitored voltages data msg constructed and queued. - * @param data Latest monitored voltage values. - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastVoltagesData( VOLTAGES_DATA_PAYLOAD_T data ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // Create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_VOLTAGES_DATA; - msg.hdr.payloadLen = sizeof( VOLTAGES_DATA_PAYLOAD_T ); - - memcpy( payloadPtr, &data, sizeof( VOLTAGES_DATA_PAYLOAD_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - - /*********************************************************************//** - * @brief - * The broadcastFlushData function sends out the flush mode data. - * @details Inputs: none - * @details Outputs: flush data msg constructed and queued - * @param flushData which is flush msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastFlushData( MODE_FLUSH_DATA_T *flushData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_FLUSH_DATA; - msg.hdr.payloadLen = sizeof( MODE_FLUSH_DATA_T ); - - memcpy( payloadPtr, flushData, sizeof( MODE_FLUSH_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastChemicalDisinfectData function sends out the chemical - * disinfect mode data. - * @details Inputs: none - * @details Outputs: chemical disinfect data msg constructed and queued - * @param chemDisinfectData which is flush msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastChemicalDisinfectData( MODE_CHEMICAL_DISINFECT_DATA_T *chemDisinfectData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_CHEM_DISINFECT_DATA; - msg.hdr.payloadLen = sizeof( MODE_CHEMICAL_DISINFECT_DATA_T ); - - memcpy( payloadPtr, chemDisinfectData, sizeof( MODE_CHEMICAL_DISINFECT_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastChemicalDisinfectData2UI function sends out the chemical - * disinfect mode data to the UI. - * @details Inputs: none - * @details Outputs: chemical disinfect UI data msg constructed and queued - * @param chemDisinfectUIData which is flush msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastChemicalDisinfectData2UI( MODE_CHEMICAL_DISINFECT_UI_DATA_T *chemDisinfectUIData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_CHEM_DISINFECT_TIME_DATA; - msg.hdr.payloadLen = sizeof( MODE_CHEMICAL_DISINFECT_UI_DATA_T ); - - memcpy( payloadPtr, chemDisinfectUIData, sizeof( MODE_CHEMICAL_DISINFECT_UI_DATA_T ) ); - - // 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_DG_2_UI, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastChemicalDisinfectData2UI function sends out the heat - * disinfect mode data to the UI. - * @details Inputs: none - * @details Outputs: heat disinfect UI data msg constructed and queued - * @param heatDisinfectUIData which is flush msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastHeatDisinfectData2UI( MODE_HEAT_DISINFECT_UI_DATA_T *heatDisinfectUIData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_HEAT_DISINFECT_TIME_DATA; - msg.hdr.payloadLen = sizeof( MODE_HEAT_DISINFECT_UI_DATA_T ); - - memcpy( payloadPtr, heatDisinfectUIData, sizeof( MODE_HEAT_DISINFECT_UI_DATA_T ) ); - - // 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_DG_2_UI, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief - * The broadcastSwitchesData function sends out switches data. - * @details Inputs: none - * @details Outputs: switches data msg constructed and queued - * @param switchesData which is switches msg constructed and queued - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL broadcastSwitchesData( SWITCHES_DATA_T *switchesData ) -{ - BOOL result; - MESSAGE_T msg; - U08 *payloadPtr = msg.payload; - - // create a message record - blankMessage( &msg ); - msg.hdr.msgID = MSG_ID_DG_SWITCHES_DATA; - msg.hdr.payloadLen = sizeof( SWITCHES_DATA_T ); - - memcpy( payloadPtr, switchesData, sizeof( SWITCHES_DATA_T ) ); - - // 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_DG_BROADCAST, ACK_NOT_REQUIRED ); - - return result; -} - -/*********************************************************************//** - * @brief * The sendDGSystemRecord function sends out the DG system record. * @details Inputs: none * @details Outputs: DG system record msg constructed and queued @@ -1454,7 +781,6 @@ sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, COMM_BUFFER_OUT_CAN_DG_2_HD, result ); } - /*********************************************************************//** * @brief * The handleChangeValveSettingCmd function handles a switch reservoirs command @@ -3035,7 +2361,15 @@ sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); } -//*******************************************************************/ +/*********************************************************************//** +* @brief +* The handleTestROPumpTargetFlowOverride function handles a request to +* set the RO pump target flow. +* @details Inputs: none +* @details Outputs: message handled +* @param message a pointer to the message to handle +* @return none +*************************************************************************/ void handleTestROPumpTargetFlowOverride( MESSAGE_T *message ) { BOOL result = FALSE;