555ee8b441494106255f8565fdb8a08771cb7d0a
[apps/agl-service-unicens.git] / ucs2-lib / inc / ucs_telqueue.h
1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491                                                                            */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG.                              */
4 /*                                                                                                */
5 /* This program is free software: you can redistribute it and/or modify                           */
6 /* it under the terms of the GNU General Public License as published by                           */
7 /* the Free Software Foundation, either version 2 of the License, or                              */
8 /* (at your option) any later version.                                                            */
9 /*                                                                                                */
10 /* This program is distributed in the hope that it will be useful,                                */
11 /* but WITHOUT ANY WARRANTY; without even the implied warranty of                                 */
12 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the                                  */
13 /* GNU General Public License for more details.                                                   */
14 /*                                                                                                */
15 /* You should have received a copy of the GNU General Public License                              */
16 /* along with this program.  If not, see <http://www.gnu.org/licenses/>.                          */
17 /*                                                                                                */
18 /* You may also obtain this software under a propriety license from Microchip.                    */
19 /* Please contact Microchip for further information.                                              */
20 /*------------------------------------------------------------------------------------------------*/
21
22 /*!
23  * \file
24  * \brief Declaration of class CTelQueue
25  *
26  * \cond UCS_INTERNAL_DOC
27  * \addtogroup  G_MSG_QUEUE
28  * @{
29  */
30
31 #ifndef UCS_MSGQUEUE_H
32 #define UCS_MSGQUEUE_H
33
34 /*------------------------------------------------------------------------------------------------*/
35 /* Includes                                                                                       */
36 /*------------------------------------------------------------------------------------------------*/
37 #include "ucs_message.h"
38 #include "ucs_dl.h"
39
40 #ifdef __cplusplus
41 extern "C"
42 {
43 #endif
44
45 /*------------------------------------------------------------------------------------------------*/
46 /* Types                                                                                          */
47 /*------------------------------------------------------------------------------------------------*/
48
49
50 /*------------------------------------------------------------------------------------------------*/
51 /* Macros                                                                                         */
52 /*------------------------------------------------------------------------------------------------*/
53
54 /*------------------------------------------------------------------------------------------------*/
55 /* Class CTelQueue                                                                                */
56 /*------------------------------------------------------------------------------------------------*/
57 /*! \brief   Class CTelQueue 
58  *  \details Internal class to queue MOST telegrams
59  */
60 typedef struct CTelQueue_
61 {
62     CDlList     list;           /*! \brief  Doubly linked list */
63     void       *ucs_user_ptr;   /*!< \brief User reference that needs to be passed in every callback function */
64
65 } CTelQueue;
66
67
68 /*------------------------------------------------------------------------------------------------*/
69 /* Methods                                                                                        */
70 /*------------------------------------------------------------------------------------------------*/
71 extern void Telq_Ctor(CTelQueue *self, void *ucs_user_ptr);
72 extern Msg_MostTel_t* Telq_Dequeue(CTelQueue *self);
73 extern Msg_MostTel_t* Telq_Peek(CTelQueue *self);
74 extern void Telq_Enqueue(CTelQueue *self, Msg_MostTel_t *tel_ptr);
75 extern uint8_t Telq_GetSize(CTelQueue *self);
76
77 #ifdef __cplusplus
78 }                                                   /* extern "C" */
79 #endif
80
81 #endif /* #ifndef UCS_MSGQUEUE_H */
82
83 /*!
84  * @}
85  * \endcond
86  */
87
88 /*------------------------------------------------------------------------------------------------*/
89 /* End of file                                                                                    */
90 /*------------------------------------------------------------------------------------------------*/
91