Index: firmware/App/Services/MsgQueues.h =================================================================== diff -u -rb64c49fdcf2b6d95e61e63f8e258c4e600935bbd -r7d4711edd7b40cd3e29f43e766f79a8a09586fe9 --- firmware/App/Services/MsgQueues.h (.../MsgQueues.h) (revision b64c49fdcf2b6d95e61e63f8e258c4e600935bbd) +++ firmware/App/Services/MsgQueues.h (.../MsgQueues.h) (revision 7d4711edd7b40cd3e29f43e766f79a8a09586fe9) @@ -1,56 +1,70 @@ -/************************************************************************** - * - * Copyright (c) 2019-2020 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 MsgQueues.h - * - * @date 08-Oct-2019 - * @author S. Nash - * - * @brief header file for Message Queues service . - * - **************************************************************************/ +/************************************************************************** +* +* Copyright (c) 2019-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 MsgQueues.h +* +* @author (last) Dara Navaei +* @date (last) 02-Feb-2021 +* +* @author (original) Dara Navaei +* @date (original) 05-Nov-2019 +* +***************************************************************************/ #ifndef __MSG_QUEUES_H__ #define __MSG_QUEUES_H__ #include "DGCommon.h" + +/** + * @defgroup MsgQueues MsgQueues + * @brief Message queues service module. Provides message queue functionality + * including support functions for adding and getting a message. + * + * @addtogroup MsgQueues + * @{ + */ // ********** public definitions ********** -#define MAX_MSG_PAYLOAD_SIZE 100 // bytes - +#define MAX_MSG_PAYLOAD_SIZE 250 ///< Maximum message payload size in bytes. + +/// List of message queues. typedef enum Msg_Queues { - MSG_Q_IN = 0, - NUM_OF_MSG_QUEUES + MSG_Q_IN = 0, ///< Incoming message queue + NUM_OF_MSG_QUEUES ///< Number of message queues } MSG_QUEUE_T; -#pragma pack(push,1) +#pragma pack(push,1) +/// Message header struct. typedef struct { - S16 seqNo; // sequence # (and ACK required bit) of message - U16 msgID; // ID of message - U08 payloadLen; // length of payload in bytes + S16 seqNo; ///< Sequence number (and ACK required bit) of message + U16 msgID; ///< ID of message + U08 payloadLen; ///< Length of payload in bytes } MESSAGE_HEADER_T; - + +/// Message struct. typedef struct { - MESSAGE_HEADER_T hdr; // message header - U08 payload[ MAX_MSG_PAYLOAD_SIZE ]; // message payload + MESSAGE_HEADER_T hdr; ///< Message header + U08 payload[ MAX_MSG_PAYLOAD_SIZE ]; ///< Message payload } MESSAGE_T; - + +/// Message wrapper struct. typedef struct { - MESSAGE_T msg; // message - U08 crc; // message CRC + MESSAGE_T msg; ///< Message struct + U08 crc; ///< Message's crc } MESSAGE_WRAPPER_T; #pragma pack(pop) -#define MESSAGE_OVERHEAD_SIZE (sizeof(MESSAGE_HEADER_T) + sizeof(U08)) +#define MESSAGE_OVERHEAD_SIZE (sizeof(MESSAGE_HEADER_T) + sizeof(U08)) ///< Message overhead size // ********** public function prototypes ********** @@ -61,5 +75,7 @@ BOOL isMsgQueueFull( MSG_QUEUE_T queue ); void blankMessage( MESSAGE_T *message ); void blankMessageInWrapper( MESSAGE_WRAPPER_T *message ); + +/**@}*/ #endif