#include // for memcpy() #include "BoostPump.h" #include "Compatible.h" #include "Conductivity.h" #include "DDInterface.h" #include "Flow.h" #include "Level.h" #include "Messaging.h" #include "ModeWaterGen.h" #include "ModeWaterPreGen.h" #include "OperationModes.h" #include "PAL.h" #include "Pressure.h" #include "ROPump.h" #include "SystemCommRO.h" #include "Temperature.h" #include "Utilities.h" #include "Valves.h" /** * @addtogroup Messaging * @{ */ // ********** private definitions ********** #define MAX_MSGS_BLOCKED_FOR_XMIT 8 ///< Maximum number of messages to block transmission for. #pragma pack(push,1) /// Payload record structure for block message transmission request. typedef struct { U16 blockedMessages[ MAX_MSGS_BLOCKED_FOR_XMIT ]; ///< Blocked messages array. } BLOCKED_MSGS_DATA_T; #pragma pack(pop) /// Array of CAN communication buffers to respond on (aligned with enum Comm_Buffers). static const COMM_BUFFER_T tdResponseBuffers[ NUM_OF_COMM_BUFFERS ] = { COMM_BUFFER_NOT_USED, ///< CAN message boxes start at 1 so we will not use this buffer COMM_BUFFER_OUT_CAN_RO_ALARM, ///< Buffer for responding to incoming TD alarm messages COMM_BUFFER_OUT_CAN_RO_ALARM, ///< Buffer for responding to incoming DD alarm messages COMM_BUFFER_NOT_USED, ///< Buffer for outgoing RO alarm messages so no response buffer COMM_BUFFER_OUT_CAN_RO_ALARM, ///< Buffer for responding to incoming UI alarm messages COMM_BUFFER_OUT_CAN_RO_2_DD, ///< Buffer for responding to incoming DD to RO messages COMM_BUFFER_NOT_USED, ///< Buffer for outgoing RO to DD messages so no response buffer COMM_BUFFER_OUT_CAN_RO_BROADCAST, ///< Buffer for responding to incoming TD broadcast messages COMM_BUFFER_OUT_CAN_RO_BROADCAST, ///< Buffer for responding to incoming DD broadcast messages COMM_BUFFER_NOT_USED, ///< Buffer for outgoing RO broadcast messages so no response buffer COMM_BUFFER_OUT_CAN_RO_BROADCAST, ///< Buffer for responding to incoming UI broadcast messages COMM_BUFFER_OUT_CAN_PC, ///< Buffer for responding to incoming PC to RO messages COMM_BUFFER_NOT_USED, ///< Buffer for outgoing RO to PC messages so no response buffer }; typedef BOOL (*MsgFuncPtr)( MESSAGE_T* ); /// Message handling function lookup table static const U16 MSG_FUNCTION_HANDLER_LOOKUP[] = { MSG_ID_RO_TESTER_LOGIN_REQUEST, MSG_ID_RO_SOFTWARE_RESET_REQUEST, MSG_ID_RO_SEND_TEST_CONFIGURATION, MSG_ID_RO_VALVE_PUBLISH_INTERVAL_OVERRIDE_REQUEST, MSG_ID_RO_VALVE_CMD_STATE_OVERRIDE_REQUEST, //5 MSG_ID_RO_VALVE_SENSED_STATE_OVERRIDE_REQUEST, MSG_ID_RO_BOOST_PUMP_SET_PWM_REQUEST, MSG_ID_RO_BOOST_PUMP_READ_PWM_OVERRIDE_REQUEST, MSG_ID_RO_BOOST_PUMP_SPEED_OVERRIDE_REQUEST, MSG_ID_RO_BOOST_PUMPS_PUBLISH_INTERVAL_OVERRIDE_REQUEST, //10 MSG_ID_RO_PRESSURE_OVERRIDE_REQUEST, MSG_ID_RO_PRESSURE_TEMP_OVERRIDE_REQUEST, MSG_ID_RO_PRESSURE_READ_COUNT_OVERRIDE_REQUEST, MSG_ID_RO_PRESSURE_ERROR_COUNT_OVERRIDE_REQUEST, MSG_ID_RO_PRESSURE_PUBLISH_INTERVAL_OVERRIDE_REQUEST, //15 MSG_ID_RO_DEBUG_EVENT, MSG_ID_RO_LEVEL_PUBLISH_INTERVAL_OVERRIDE_REQUEST, MSG_ID_RO_LEVEL_OVERRIDE_REQUEST, MSG_ID_RO_FLOWS_PUBLISH_INTERVAL_OVERRIDE_REQUEST, MSG_ID_RO_FLOW_RATE_OVERRIDE_REQUEST, //20 MSG_ID_RO_FLOW_TEMP_OVERRIDE_REQUEST, MSG_ID_RO_FILTERED_FLOW_RATE_OVERRIDE_REQUEST, MSG_ID_RO_FILTERED_FLOW_TEMP_OVERRIDE_REQUEST, MSG_ID_RO_CONDUCTIVITY_PUBLISH_INTERVAL_OVERRIDE_REQUEST, MSG_ID_RO_CONDUCTIVITY_OVERRIDE_REQUEST, //25 MSG_ID_RO_CONDUCTIVITY_TEMP_OVERRIDE_REQUEST, MSG_ID_RO_CONDUCTIVITY_READ_COUNT_OVERRIDE_REQUEST, MSG_ID_RO_CONDUCTIVITY_ERROR_COUNT_OVERRIDE_REQUEST, MSG_ID_RO_TEMPERATURE_OVERRIDE_REQUEST, MSG_ID_DD_RO_START_STOP_CMD_REQUEST, //30 MSG_ID_RO_PRE_GEN_PUBLISH_INTERVAL_OVERRIDE_REQUEST }; /// Message handling function table static const MsgFuncPtr MSG_FUNCTION_HANDLERS[] = { &handleTesterLogInRequest, &handleROSoftwareResetRequest, &handleROTestConfiguration, &testValvesStatesPublishIntervalOverride, &testValveStateOverride, //5 &testValveSensedStateOverride, &testSetBoostPumpPWM, &testBoostPumpPWMOverride, &testBoostPumpRPMOverride, &testROPumpDataPublishIntervalOverride, //10 &testPressureSensorReadingsOverride, &testPressureSensorTemperatureReadingsOverride, &testPressureSensorReadCounterOverride, &testPressureSensorErrorCounterOverride, &testPressureSensorDataPublishIntervalOverride, //15 &handleUnhandledMsg, &testLevelsDataPublishIntervalOverride, &testLevelStateOverride, &testFlowSensorDataPublishIntervalOverride, &testFlowSensorReadingsOverride, //20 &testFlowSensorTemperatureReadingsOverride, &testFlowSensorFilteredReadingsOverride, &testFlowSensorFilteredTemperatureReadingsOverride, &testConductivitySensorDataPublishIntervalOverride, &testConductivitySensorReadingsOverride, //25 &testConductivitySensorTemperatureReadingsOverride, &testConductivitySensorReadCounterOverride, &testConductivitySensorErrorCounterOverride, &testMeasuredTemperatureOverride, &handleGenerateWaterRequestMsg, //30 &testPreGenWaterDataPublishIntervalOverride }; #define NUM_OF_FUNCTION_HANDLERS (sizeof(MSG_FUNCTION_HANDLERS) / sizeof(MsgFuncPtr)) // ********** private data ********** static BOOL testerLoggedIn = FALSE; ///< Flag indicates whether tester logged in or not. static volatile U16 nextSeqNo = 1; ///< Next sequence number. /// List of message IDs that are requested not to be transmitted. //static BLOCKED_MSGS_DATA_T blockedMessagesForXmit = { 0, 0, 0, 0, 0, 0, 0, 0 }; // ********** private function prototypes ********** static MsgFuncPtr getMsgHandler( U16 msgID ); static BOOL sendTestAckResponseMsg( MSG_ID_T msgID, BOOL ack ); static BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ); /*********************************************************************//** * @brief * The serializeMessage function serializes a given message into a given * array of bytes. A sequence # is added to the message here and the ACK * bit of the sequence # is set if ACK is required per parameter. A sync byte * is inserted at the beginning of the message and an 8-bit CRC is appended to * the end of the message. The message is queued for transmission in the given buffer. * @details \b Inputs: none * @details \b Outputs: given data array populated with serialized message data and * queued for transmit. * @details \b Alarm: ALARM_ID_DD_SOFTWARE_FAULT when pending ACK list is full. * @param msg message to serialize * @param buffer outgoing buffer that message should be queued in * @param ackReq is an acknowledgement from receiver required? * @return size (in bytes) of serialized message populated in given data array. *************************************************************************/ U32 serializeMessage( MESSAGE_T msg, COMM_BUFFER_T buffer, BOOL ackReq ) { BOOL result = FALSE; BOOL error = FALSE; U32 msgSize = 0; U32 sizeMod, sizePad; U32 i; U08 crc; U08 data[ MAX_ACK_MSG_SIZE ]; // byte array to populate with message data // prefix data with message sync byte data[ msgSize++ ] = MESSAGE_SYNC_BYTE; // set sequence # and ACK bit (unless this is an ACK to a received message) if ( msg.hdr.msgID != MSG_ID_ACK_MESSAGE_THAT_REQUIRES_ACK ) { // thread protect next sequence # access & increment _disable_IRQ(); msg.hdr.seqNo = nextSeqNo; nextSeqNo = INC_WRAP( nextSeqNo, MIN_MSG_SEQ_NO, MAX_MSG_SEQ_NO ); _enable_IRQ(); if ( TRUE == ackReq ) { msg.hdr.seqNo *= -1; } } // calculate message CRC crc = crc8( (U08*)(&msg), sizeof( MESSAGE_HEADER_T ) + msg.hdr.payloadLen ); // serialize message header data memcpy( &data[ msgSize ], &( msg.hdr ), sizeof( MESSAGE_HEADER_T ) ); msgSize += sizeof( MESSAGE_HEADER_T ); // serialize message payload (only used bytes per payloadLen field) memcpy( &data[ msgSize ], &( msg.payload ), msg.hdr.payloadLen ); msgSize += msg.hdr.payloadLen; // add 8-bit CRC data[ msgSize++ ] = crc; // pad with zero bytes to get length a multiple of CAN_FRAME_PAYLOAD_SIZE (8) sizeMod = msgSize % CAN_FRAME_PAYLOAD_SIZE; sizePad = ( sizeMod == 0 ? 0 : CAN_FRAME_PAYLOAD_SIZE - sizeMod ); for ( i = 0; i < sizePad; i++ ) { data[ msgSize++ ] = 0; } // if ACK required, add to pending ACK list if ( TRUE == ackReq ) { if ( FALSE == addMsgToPendingACKList( &msg, buffer, data, msgSize ) ) { error = TRUE; SET_ALARM_WITH_1_U32_DATA( ALARM_ID_RO_SOFTWARE_FAULT, SW_FAULT_ID_MSG_PENDING_ACK_LIST_FULL ) } } if ( FALSE == error ) { // add serialized message data to appropriate out-going comm buffer result = addToCommBuffer( buffer, data, msgSize ); } return result; } /*********************************************************************//** * @brief * The sendACKMsg function constructs and queues for transmit an ACK message * for a given received message. * @details \b Inputs: none * @details \b Outputs: ACK message queued for transmit on broadcast CAN channel. * @param message message to send an ACK for * @return TRUE if ACK message queued successfully, FALSE if not *************************************************************************/ BOOL sendACKMsg( MESSAGE_T *message ) { BOOL result; MESSAGE_T msg; // create a message record blankMessage( &msg ); // send ACK back with same seq. #, but w/o ACK bit msg.hdr.seqNo = message->hdr.seqNo * -1; // ACK messages always have this ID msg.hdr.msgID = MSG_ID_ACK_MESSAGE_THAT_REQUIRES_ACK; // ACK messages always have no payload msg.hdr.payloadLen = 0; // serialize and queue the message for transmit on broadcast channel result = serializeMessage( msg, COMM_BUFFER_OUT_CAN_RO_BROADCAST, ACK_NOT_REQUIRED ); return result; } /*********************************************************************//** * @brief * The sendTestAckResponseMsg function constructs a simple response message for * a handled test message and queues it for transmit on the appropriate CAN channel. * @details \b Inputs: none * @details \b Outputs: response message constructed and queued for transmit. * @param msgID ID of handled message that we are responding to * @param buffer outgoing buffer that message should be queued in * @param ack TRUE if test message was handled successfully, FALSE if not * @return TRUE if response message successfully queued for transmit, FALSE if not *************************************************************************/ BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ) { BOOL result; MESSAGE_T msg; // create a message record blankMessage( &msg ); msg.hdr.msgID = msgID; msg.hdr.payloadLen = sizeof( U08 ); msg.payload[ 0 ] = (U08)ack; // serialize the message (w/ sync, CRC, and appropriate CAN padding) and add serialized message data to appropriate comm buffer result = serializeMessage( msg, buffer, ACK_NOT_REQUIRED ); return result; } /*********************************************************************//** * @brief * The getMsgHandler function finds the appropriate handler function * for the given message. * @details \b Inputs: MSG_FUNCTION_HANDLER_LOOKUP[], MSG_FUNCTION_HANDLERS[] * @details \b Outputs: none * @param msgID ID of message to find handler function for * @return pointer to appropriate function to handle given message *************************************************************************/ static MsgFuncPtr getMsgHandler( U16 msgID ) { U32 i; MsgFuncPtr func = 0; // Search for the index associated with the given override command message ID and then use index to get the handling function for ( i = 0; i < NUM_OF_FUNCTION_HANDLERS; i++ ) { if ( MSG_FUNCTION_HANDLER_LOOKUP[i] == msgID ) { func = MSG_FUNCTION_HANDLERS[i]; break; } } return func; } /*********************************************************************//** * @brief * The handleIncomingMessage function calls the appropriate handler function * for the given message. * @details \b Inputs: none * @details \b Outputs: Appropriate message handler function called * @param message Incoming message to handle * @return none *************************************************************************/ void handleIncomingMessage( MESSAGE_T *message ) { BOOL ack = FALSE; // assume we will NAK until we have successful handling of message COMM_BUFFER_T respBuffer = tdResponseBuffers[ message->in_buffer ]; // if Dialin message, ensure Dialin is logged in before processing it if ( ( message->hdr.msgID < MSG_ID_FIRST_TD_TESTER_MESSAGE ) || ( MSG_ID_RO_TESTER_LOGIN_REQUEST == message->hdr.msgID ) || ( TRUE == isTestingActivated() ) ) { MsgFuncPtr msgFuncPtr; // Find the appropriate message handling function to call msgFuncPtr = getMsgHandler( message->hdr.msgID ); // Ensure a handler is found before calling it if ( msgFuncPtr != 0 ) { // Call the appropriate message handling function ack = (*msgFuncPtr)( message ); } } // ACK/NAK request if ( message->hdr.msgID < MSG_ID_FIRST_TD_TESTER_MESSAGE ) { if ( respBuffer != COMM_BUFFER_NOT_USED ) { sendAckResponseMsg( (MSG_ID_T)message->hdr.msgID, respBuffer, ack ); } } else { sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, ack ); } } /*********************************************************************//** * @brief * The handleUnhandledMsg function handles messages that are not handled (yet or ever). * @details \b Inputs: none * @details \b Outputs: none * @param message Incoming message to not handle * @return FALSE (indicating message not handled). *************************************************************************/ BOOL handleUnhandledMsg( MESSAGE_T *message ) { return FALSE; // message not handled or handling for message not implemented yet } // *********************************************************************** // ***************** Message Sending Helper Functions ******************** // *********************************************************************** /*********************************************************************//** * @brief * The broadcastAlarmTriggered function constructs an alarm triggered msg to * be broadcast and queues the msg for transmit on the appropriate CAN channel. * @details \b Inputs: none * @details \b Outputs: alarm triggered msg constructed and queued. * @param alarm ID of alarm triggered * @param almData1 1st data associated with alarm * @param almData2 2nd data associated with alarm * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL broadcastAlarmTriggered( U32 alarm, ALARM_DATA_T almData1, ALARM_DATA_T almData2 ) { BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; U32 data; // create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_ALARM_TRIGGERED; msg.hdr.payloadLen = sizeof( U32 ) * 8; memcpy( payloadPtr, &alarm, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); data = (U32)almData1.dataType; memcpy( payloadPtr, &data, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); data = almData1.data.uInt.data; memcpy( payloadPtr, &data, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); data = (U32)almData2.dataType; memcpy( payloadPtr, &data, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); data = almData2.data.uInt.data; memcpy( payloadPtr, &data, sizeof( U32 ) ); // Pad with space for 3 U32s - set to zero - unused for DG payloadPtr += ( sizeof( U32) * 3 ); memset( payloadPtr, 0, sizeof( U32) * 3 ); // 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_RO_ALARM, ACK_REQUIRED ); return result; } /*********************************************************************//** * @brief * The broadcastAlarmCleared function constructs an alarm cleared msg to be * broadcast and queues the msg for transmit on the appropriate CAN channel. * @details \b Inputs: none * @details \b Outputs: alarm cleared msg constructed and queued. * @param alarm ID of alarm cleared * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL broadcastAlarmCleared( U32 alarm ) { BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; // create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_ALARM_CLEARED; msg.hdr.payloadLen = sizeof( U32 ); memcpy( payloadPtr, &alarm, 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_RO_ALARM, ACK_REQUIRED ); return result; } /*********************************************************************//** * @brief * The broadcastAlarmConditionCleared function constructs an alarm condition * cleared msg to be broadcast and queues the msg for transmit on the * appropriate CAN channel. * @details \b Inputs: none * @details \b Outputs: alarm condition cleared msg constructed and queued. * @param alarm ID of alarm which alarm condition is cleared * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL broadcastAlarmConditionCleared( U32 alarm ) { BOOL result; MESSAGE_T msg; U08 *payloadPtr = msg.payload; // create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_ALARM_CONDITION_CLEARED; msg.hdr.payloadLen = sizeof( U32 ); memcpy( payloadPtr, &alarm, 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_RO_ALARM, ACK_REQUIRED ); return result; } /*********************************************************************//** * @brief * The sendEvent function constructs an DG event message to the UI and * queues the msg for transmit on the appropriate CAN channel. * @details \b Inputs: none * @details \b Outputs: DG event msg constructed and queued. * @param event Enumeration of event type that occurred * @param dat1 First data associated with event * @param dat2 Second data associated with event * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL sendEvent( RO_EVENT_ID_T event, EVENT_DATA_T dat1, EVENT_DATA_T dat2 ) { BOOL result; MESSAGE_T msg; EVENT_PAYLOAD_T eventStruct; eventStruct.event = (U32)event; eventStruct.dataType1 = (U32)dat1.dataType; eventStruct.data1 = dat1.data; eventStruct.dataType2 = (U32)dat2.dataType; eventStruct.data2 = dat2.data; // Create a message record blankMessage( &msg ); msg.hdr.msgID = MSG_ID_RO_EVENT; msg.hdr.payloadLen = sizeof( EVENT_PAYLOAD_T ); memcpy( &msg.payload, &eventStruct, sizeof( EVENT_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_RO_BROADCAST, ACK_NOT_REQUIRED ); return result; } // *********************************************************************** // **************** Message Handling Helper Functions ******************** // *********************************************************************** /*********************************************************************//** * @brief * The handleSetTDOperationMode function receives the TD operation modes data * publish message. * @details \b Inputs: none * @details \b Outputs: none * @param message a pointer to the message to handle * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL handleSetROOperationMode( MESSAGE_T *message ) { BOOL status = FALSE; U08* payloadPtr = message->payload; // HD mode broadcast is operations mode and submode so 8 bytes if ( message->hdr.payloadLen == sizeof( U32 ) + sizeof( U32 ) ) { U32 mode = 0; U32 subMode = 0; memcpy( &mode, payloadPtr, sizeof( U32 ) ); payloadPtr += sizeof( U32 ); memcpy( &subMode, payloadPtr, sizeof( U32 ) ); //setTDOperationMode( mode, subMode ); // ToDO uncomment status = TRUE; } return status; } /************************************************************************* * TEST SUPPORT FUNCTIONS *************************************************************************/ /*********************************************************************//** * @brief * The isTestingActivated function determines whether a tester has successfully * logged in to activate testing functionality. * @details \b Inputs: testerLoggedIn * @details \b Outputs: none * @return TRUE if a tester has logged in to activate testing, FALSE if not *************************************************************************/ BOOL isTestingActivated( void ) { return testerLoggedIn; } /*********************************************************************//** * @brief * The setTesterStatusToLoggedOut function sets the status of the tester to * logged out. * @details \b Inputs: none * @details \b Outputs: testerLoggedIn * @return none *************************************************************************/ void setTesterStatusToLoggedOut( void ) { testerLoggedIn = FALSE; } /*********************************************************************//** * @brief * The sendTestAckResponseMsg function constructs a simple response message for * a handled test message and queues it for transmit on the appropriate UART channel. * @details \b Inputs: none * @details \b Outputs: response message constructed and queued for transmit. * @param msgID ID of handled message that we are responding to * @param ack TRUE if test message was handled successfully, FALSE if not * @return TRUE if response message successfully queued for transmit, FALSE if not *************************************************************************/ static BOOL sendTestAckResponseMsg( MSG_ID_T msgID, BOOL ack ) { BOOL result; MESSAGE_T msg; // create a message record blankMessage( &msg ); msg.hdr.msgID = msgID; msg.hdr.payloadLen = sizeof( U08 ); msg.payload[ 0 ] = (U08)ack; // 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_PC, ACK_NOT_REQUIRED ); return result; } /*********************************************************************//** * @brief * The handleTesterLogInRequest function handles a request to login as a tester. * @details \b Inputs: none * @details \b Outputs: message handled * @param message a pointer to the message to handle * @return none *************************************************************************/ BOOL handleTesterLogInRequest( MESSAGE_T *message ) { // verify pass code // TODO - placeholder - how do we want to authenticate tester? 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 { testerLoggedIn = FALSE; } return testerLoggedIn; } /*********************************************************************//** * @brief * The handleTDSoftwareResetRequest function handles a request to reset the * TD firmware processor. * @details \b Inputs: none * @details \b Outputs: message handled * @param message a pointer to the message to handle * @return FALSE if reset command rejected (won't return if reset successful) *************************************************************************/ BOOL handleROSoftwareResetRequest( MESSAGE_T *message ) { BOOL result = FALSE; // Verify payload length if ( 0 == message->hdr.payloadLen ) { // S/w reset of processor result = TRUE; // Reset will prevent this from getting transmitted though setSystemREG1_SYSECR( (0x2) << 14 ); // Reset processor } sendTestAckResponseMsg( (MSG_ID_T)message->hdr.msgID, result ); return result; } /*********************************************************************//** * @brief * The handleROTestConfiguration function handles a request to set an RO test * configuration flag. * @details \b Inputs: none * @details \b Outputs: message handled * @param message a pointer to the set test configuration message to handle * @return TRUE if test configuration flag set successfully, FALSE if not. *************************************************************************/ BOOL handleROTestConfiguration( MESSAGE_T *message ) { BOOL result = FALSE; // TODO - implement. return result; } /**@}*/