Index: firmware/App/Services/Messaging.c =================================================================== diff -u -r9fcd1ad071bcce7a592833367c103e235e49654f -rf99f8b365af2274d68d7f424cc9be9815b4db19c --- firmware/App/Services/Messaging.c (.../Messaging.c) (revision 9fcd1ad071bcce7a592833367c103e235e49654f) +++ firmware/App/Services/Messaging.c (.../Messaging.c) (revision f99f8b365af2274d68d7f424cc9be9815b4db19c) @@ -30,6 +30,7 @@ #include "FpgaTD.h" #include "LevelSensors.h" #include "Messaging.h" +#include "ModeInitPOST.h" #include "ModeStandby.h" #include "OperationModes.h" #include "PAL.h" @@ -122,7 +123,7 @@ { MSG_ID_UI_ADJUST_DISPOSABLES_CONFIRM_REQUEST, &handleAutoLoadRequest }, { MSG_ID_UI_ADJUST_DISPOSABLES_REMOVAL_CONFIRM_REQUEST, &handleAutoEjectRequest }, { MSG_ID_FFU_SIGNAL_TD_UPDATE_AVAILABLE, &handleUpdateAvailable }, - { MSG_ID_UI_CONFIRMATION_RESULT_RESPONSE, &handleUIConfirmationResponse }, + { MSG_ID_UI_GENERIC_CONFIRMATION_RESULT_RESPONSE, &handleUIConfirmationResponse }, { MSG_ID_TD_SOFTWARE_RESET_REQUEST, &testTDSoftwareResetRequest }, { MSG_ID_TD_BUBBLE_OVERRIDE_REQUEST, &testBubbleDetectOverride }, { MSG_ID_TD_BUBBLE_PUBLISH_INTERVAL_OVERRIDE_REQUEST, &testBubblesDataPublishIntervalOverride }, @@ -509,6 +510,29 @@ return result; } +/*********************************************************************//** + * @brief + * The handleUIVersionResponse function handles a response to request for + * UI version information. + * @details Inputs: none + * @details Outputs: message handled + * @param message a pointer to the message to handle. + * @return none + *************************************************************************/ +BOOL handleUIVersionResponse( MESSAGE_T *message ) +{ + BOOL result = TRUE; + // Get UI version data and have it recorded + if ( sizeof(UI_VERSIONS_T) == message->hdr.payloadLen ) + { + UI_VERSIONS_T uiVersion; + + memcpy( &uiVersion, &message->payload[0], sizeof(UI_VERSIONS_T) ); + signalUIVersion( uiVersion ); + } + return result; +} + // *********************************************************************** // ***************** Message Sending Helper Functions ******************** // *********************************************************************** @@ -553,44 +577,11 @@ /*********************************************************************//** * @brief - * The sendOffButtonMsgToUI function constructs an off button msg to the UI - * and queues the msg for transmit on the appropriate CAN channel. - * @details \b Message \b Sent: MSG_ID_OFF_BUTTON_PRESS_REQUEST - * @details \b Inputs: none - * @details \b Outputs: Off button msg constructed and queued. - * @param prompt 0=prompt user to confirm, 1=cancel prompt, 2=reject user off request - * @return TRUE if msg successfully queued for transmit, FALSE if not - *************************************************************************/ -BOOL sendOffButtonMsgToUI( GENERIC_CONFIRM_COMMAND_T prompt ) -{ - UI_OFF_BUTTON_RESPONSE_PAYLOAD_T cmd; - MSG_ID_T msgID = MSG_ID_TD_UI_CONFIRMATION_REQUEST; - cmd.userRequest = prompt; - U08 len = 1; - switch ( prompt ) - { - case GENERIC_CONFIRM_CMD_REQUEST_OPEN: - msgID = MSG_ID_TD_POWER_OFF_REQUEST; - break; - case GENERIC_CONFIRM_CMD_TIMEOUT_CLOSE: - case GENERIC_CONFIRM_CMD_REJECT: - case GENERIC_CONFIRM_CMD_ACCEPT_CLOSE: - msgID = MSG_ID_TD_UI_CONFIRMATION_REQUEST; - len = 4; - break; - default: - break; - } - // Use the generic send helper for transmission. - return sendMessage( msgID, COMM_BUFFER_OUT_CAN_TD_2_UI, (U08 *)&cmd, len ); -} - -/*********************************************************************//** - * @brief * The sendUIVersionRequest function constructs a UI version request msg * to the UI and queues the msg for transmit on the appropriate CAN channel. - * @details /b Inputs: none - * @details /b Outputs: UI version request msg constructed and queued. + * @details \b Message \b Sent: MSG_ID_TD_UI_VERSION_INFO_REQUEST + * @details \b Inputs: none + * @details \b Outputs: none * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL sendUIVersionRequest( void ) @@ -613,8 +604,8 @@ * @brief * The sendRequestForDDResendAlarms function sends out the TD request for * DG re-send all active alarms. - * @details Inputs: none - * @details Outputs: DD alarms re-send request msg constructed and queued + * @details \b Inputs: none + * @details \b Outputs: DD alarms re-send request msg constructed and queued * @return TRUE if msg successfully queued for transmit, FALSE if not *************************************************************************/ BOOL sendRequestForDDResendAlarms( void ) @@ -783,7 +774,6 @@ *************************************************************************/ BOOL sendPOSTTestResult( TD_POST_STATE_T test, BOOL passed ) { - U08 payload[ sizeof( BOOL ) + sizeof( U32 ) ]; U32 testID = (U32)test; @@ -792,7 +782,6 @@ // Use the generic send helper for transmission. return sendMessage( MSG_ID_TD_POST_SINGLE_TEST_RESULT, COMM_BUFFER_OUT_CAN_TD_BROADCAST, payload, sizeof( payload ) ); - } /*********************************************************************//**