1 /*------------------------------------------------------------------------------------------------*/
2 /* UNICENS V2.1.0-3491 */
3 /* Copyright (c) 2017 Microchip Technology Germany II GmbH & Co. KG. */
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. */
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. */
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/>. */
18 /* You may also obtain this software under a propriety license from Microchip. */
19 /* Please contact Microchip for further information. */
20 /*------------------------------------------------------------------------------------------------*/
24 * \brief Internal header file of the Route Manager.
26 * \cond UCS_INTERNAL_DOC
34 /*------------------------------------------------------------------------------------------------*/
36 /*------------------------------------------------------------------------------------------------*/
38 #include "ucs_ret_pb.h"
48 /*------------------------------------------------------------------------------------------------*/
50 /*------------------------------------------------------------------------------------------------*/
51 /*! \brief Stores data required by RTM during initialization. */
52 typedef struct Rtm_InitData_
54 CBase *base_ptr; /*!< \brief Reference to base instance */
55 CEndpointManagement *epm_ptr; /*!< \brief Reference to the endpoint management instance */
56 CNetworkManagement *net_ptr; /*!< \brief Reference to Network instance */
57 Ucs_Rm_ReportCb_t report_fptr; /*!< \brief Reference to the report callback function */
61 /*! \brief Class structure of the Route Management. */
62 typedef struct CRouteManagement_
64 /*! \brief Reference to a base instance */
66 /*! \brief Reference to a network instance */
67 CEndpointManagement * epm_ptr;
68 /*!< \brief Reference to the timer management */
69 CTimerManagement * tm_ptr;
70 /*!< \brief Reference to Network instance */
71 CNetworkManagement *net_ptr;
72 /*!< \brief Timer for checking routes process */
74 /*!< \brief Reference to the routes list */
75 Ucs_Rm_Route_t * routes_list_ptr;
76 /*! \brief Points to the current routes to be handled */
77 Ucs_Rm_Route_t * curr_route_ptr;
78 /*! \brief Current route index */
79 uint16_t curr_route_index;
80 /*! \brief Size of the current routes list */
81 uint16_t routes_list_size;
82 /*! \brief Service instance for the scheduler */
84 /*! \brief Report callback of the routes list */
85 Ucs_Rm_ReportCb_t report_fptr;
86 /*! \brief Observe MOST Network status in Net module */
87 CMaskedObserver nwstatus_observer;
88 /*! \brief Observer used to monitor UCS initialization result */
89 CMaskedObserver ucsinit_observer;
90 /*! \brief Observer used to monitor UCS termination event */
91 CMaskedObserver ucstermination_observer;
92 /*! \brief Specifies used to monitor UCS termination event */
94 /*! \brief specifies whether the network status is available or not */
96 /*! \brief Flag to lock the API */
101 /*------------------------------------------------------------------------------------------------*/
102 /* Prototypes of class CRouteManagement */
103 /*------------------------------------------------------------------------------------------------*/
104 extern void Rtm_Ctor(CRouteManagement * self, Rtm_InitData_t * init_ptr);
105 extern Ucs_Return_t Rtm_StartProcess(CRouteManagement * self, Ucs_Rm_Route_t routes_list[], uint16_t size);
106 extern Ucs_Return_t Rtm_DeactivateRoute(CRouteManagement * self, Ucs_Rm_Route_t * route_ptr);
107 extern Ucs_Return_t Rtm_ActivateRoute(CRouteManagement * self, Ucs_Rm_Route_t * route_ptr);
108 extern Ucs_Return_t Rtm_SetNodeAvailable(CRouteManagement * self, Ucs_Rm_Node_t *node_ptr, bool available);
109 extern bool Rtm_GetNodeAvailable(CRouteManagement * self, Ucs_Rm_Node_t *node_ptr);
110 extern Ucs_Return_t Rtm_GetAttachedRoutes(CRouteManagement * self, Ucs_Rm_EndPoint_t * ep_inst, Ucs_Rm_Route_t * ext_routes_list[], uint16_t size_list);
111 extern uint16_t Rtm_GetConnectionLabel(CRouteManagement * self, Ucs_Rm_Route_t * route_ptr);
117 #endif /* #ifndef UCS_RTM_H */
124 /*------------------------------------------------------------------------------------------------*/
126 /*------------------------------------------------------------------------------------------------*/