Merge pull request #2 from ronan22/master
[apps/agl-service-unicens.git] / ucs2-lib / inc / ucs_rtm_pv.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 Public header file of the Extended Resource Manager.
25  * \cond UCS_INTERNAL_DOC
26  * \addtogroup G_RTM
27  * @{
28  */
29
30 #ifndef UCS_RTM_PV_H
31 #define UCS_RTM_PV_H
32
33 /*------------------------------------------------------------------------------------------------*/
34 /* Includes                                                                                       */
35 /*------------------------------------------------------------------------------------------------*/
36 #include "ucs_epm_pv.h"
37 #include "ucs_obs.h"
38
39 #ifdef __cplusplus
40 extern "C"
41 {
42 #endif
43
44 /*------------------------------------------------------------------------------------------------*/
45 /* Enumerators                                                                                    */
46 /*------------------------------------------------------------------------------------------------*/
47 /*! \brief This enumerator specifies the kind of result - Internal, Target or Transmission. */
48 typedef enum Ucs_Rm_RouteState_
49 {
50     UCS_RM_ROUTE_IDLE         = 0x00U,      /*!< \brief Specifies that the Route is in idle state, i.e. not handled yet. */
51     UCS_RM_ROUTE_CONSTRUCTION = 0x01U,      /*!< \brief Specifies that the Route is under Construction. */
52     UCS_RM_ROUTE_BUILT        = 0x02U,      /*!< \brief Specifies that the Route is built. */
53     UCS_RM_ROUTE_DETERIORATED = 0x03U,      /*!< \brief Specifies that the Route is Deteriorated. */
54     UCS_RM_ROUTE_DESTRUCTION  = 0x04U,      /*!< \brief Specifies that the Route is under Destruction. */
55     UCS_RM_ROUTE_SUSPENDED    = 0x05U       /*!< \brief Specifies that the Route is Suspended. */
56
57 } Ucs_Rm_RouteState_t;
58
59 /*! \brief This enumerator specifies the kind of result - Internal, Target or Transmission. */
60 typedef enum Ucs_Rm_RouteResult_
61 {
62     UCS_RM_ROUTE_NOERROR     = 0x00U,      /*!< \brief Specifies that the result is error free. */
63     UCS_RM_ROUTE_UNCRITICAL  = 0x01U,      /*!< \brief Specifies that the result is uncritical. A retry is necessary. */
64     UCS_RM_ROUTE_CRITICAL    = 0x02U       /*!< \brief Specifies that the result is critical. No retry necessary. */
65
66 } Ucs_Rm_RouteResult_t;
67
68 /*------------------------------------------------------------------------------------------------*/
69 /* Structures                                                                                     */
70 /*------------------------------------------------------------------------------------------------*/
71 /* Rtm_Inst_t requires incomplete forward declaration, to hide internal data type.
72  * The Rtm_Inst_t object is allocated internally, the core library must access only the pointer to Rtm_Inst_t. */
73 struct Rtm_Inst_;
74
75 /*!\brief   RouteManagement instance */
76 typedef struct Rtm_Inst_ Rtm_Inst_t;
77
78 /*! \brief Internal configuration structure of a Route. */
79 typedef struct Ucs_Rm_RouteInt_
80 {
81     /*! \brief Specifies the RTM instance that manages this route. */
82     Rtm_Inst_t * rtm_inst;
83     /*! \brief Specifies the route state. */
84     Ucs_Rm_RouteState_t route_state;
85     /*! \brief Specifies the last route result. */
86     Ucs_Rm_RouteResult_t last_route_result;
87     /*! \brief Specifies the observer object for source endpoint. */
88     CObserver source_ep_observer;
89     /*! \brief Specifies whether the sink observer object is initialized or not. */
90     uint8_t sink_obsvr_initialized;
91     /*! \brief Specifies whether the source observer object is initialized or not. */
92     uint8_t src_obsvr_initialized;
93     /*! \brief Specifies whether or not the UCS termination has been notified for this route. */
94     uint8_t notify_termination;
95     /*! \brief Specifies the observer object for sink endpoint. */
96     CObserver sink_ep_observer;
97
98 } Ucs_Rm_RouteInt_t;
99
100 #ifdef __cplusplus
101 }   /* extern "C" */
102 #endif
103
104 #endif  /* #ifndef UCS_RTM_PV_H */
105
106 /*!
107  * @}
108  * \endcond
109  */
110
111
112
113 /*------------------------------------------------------------------------------------------------*/
114 /* End of file                                                                                    */
115 /*------------------------------------------------------------------------------------------------*/
116