/************************************************************************** * * Copyright (c) 2024-2024 Diality Inc. - All Rights Reserved. * * THIS CODE MAY NOT BE COPIED OR REPRODUCED IN ANY FORM, IN PART OR IN * WHOLE, WITHOUT THE EXPLICIT PERMISSION OF THE COPYRIGHT OWNER. * * @file Messaging.h * * @author (last) Vinayakam Mani * @date (last) 30-Jul-2024 * * @author (original) Sean * @date (original) 30-Jul-2024 * ***************************************************************************/ #ifndef __MESSAGING_H__ #define __MESSAGING_H__ #include "DDCommon.h" #include "DDDefs.h" #include "MessageSupport.h" #include "MsgQueues.h" /** * @defgroup Messaging Messaging * @brief The system communication messages unit provides helper functions * for sending outgoing system message and handling incoming system messages. * * @addtogroup Messaging * @{ */ // ********** public definitions ********** #define ACK_REQUIRED TRUE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. #define ACK_NOT_REQUIRED FALSE ///< Macro for functions that want to know if an outgoing message requires acknowledgement from receiver. /// UI response payload data structure typedef struct { BOOL accepted; ///< Accepted/Rejected U32 rejectionReason; ///< Rejection reason if not accepted. U32 fwValue; ///< Value in the firmware. } UI_RESPONSE_PAYLOAD_T; // ********** public function prototypes ********** // Serialize message U32 serializeMessage( MESSAGE_T msg, COMM_BUFFER_T buffer, BOOL ackReq ); BOOL broadcastAlarmTriggered( U32 alarm, ALARM_DATA_T almData1, ALARM_DATA_T almData2 ); BOOL broadcastAlarmCleared( U32 alarm ); BOOL broadcastAlarmConditionCleared( U32 alarm ); void handleIncomingMessage( MESSAGE_T *message ); // ACK MSG BOOL sendACKMsg( MESSAGE_T *message ); BOOL sendAckResponseMsg( MSG_ID_T msgID, COMM_BUFFER_T buffer, BOOL ack ); void handleUITDResetInServiceModeRequest( MESSAGE_T* message ); // handler functions **************************************** BOOL handleSetTDOperationMode( MESSAGE_T *message ); BOOL handleVersionRequestMessage( MESSAGE_T *message ); // Test Support Messaging Functions ************************** BOOL isTestingActivated( void ); void setTesterStatusToLoggedOut( void ); BOOL sendEvent( DD_EVENT_ID_T event, EVENT_DATA_T dat1, EVENT_DATA_T dat2 ); BOOL handleTesterLogInRequest( MESSAGE_T *message ); BOOL handleDDSoftwareResetRequest( MESSAGE_T *message ); BOOL handleSetTestConfiguration( MESSAGE_T *message ); BOOL handleGetTestConfiguration( MESSAGE_T *message ); //BOOL handleSendTestConfiguration( MESSAGE_T *message ); BOOL handleResetAllTestConfigurations( MESSAGE_T *message ); /**@}*/ #endif