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 CManager class
26 * \cond UCS_INTERNAL_DOC
34 /*------------------------------------------------------------------------------------------------*/
36 /*------------------------------------------------------------------------------------------------*/
42 #include "ucs_nodedis.h"
49 /*------------------------------------------------------------------------------------------------*/
50 /* Internal constants */
51 /*------------------------------------------------------------------------------------------------*/
52 /*! \brief The default value of the desired packet bandwidth for startup command */
53 #define MGR_PACKET_BW_DEFAULT 52U
55 /*------------------------------------------------------------------------------------------------*/
57 /*------------------------------------------------------------------------------------------------*/
60 /*------------------------------------------------------------------------------------------------*/
62 /*------------------------------------------------------------------------------------------------*/
64 /*! \brief Manager Class
65 * \details Implements the UNICENS Manager State Machine
67 typedef struct CManager_
69 bool listening; /*!< \brief Listening is active */
70 CFsm fsm; /*!< \brief State machine object */
71 CJobService job_service;
72 CSingleObserver job_q_obs;
76 CJobQ job_q_force_startup;
77 /* CJobQ job_q_shutdown; */
79 CJob job_leave_forced_na;
80 /* CJob job_shutdown; */
82 CJob *list_startup[2];
83 CJob *list_force_startup[3];
84 /* CJob *list_shutdown[2]; */
86 CMaskedObserver event_observer; /*!< \brief Observes init complete event */
87 CMaskedObserver nwstatus_mobs; /*!< \brief Observe network status */
89 uint16_t packet_bw; /*!< \brief The desired packet bandwidth */
90 CBase *base_ptr; /*!< \brief Reference to base services */
91 CInic *inic_ptr; /*!< \brief Reference to class CInic */
92 CNetworkManagement *net_ptr; /*!< \brief Reference to network management */
93 CNodeDiscovery *nd_ptr; /*!< \brief Reference to node discovery */
95 CSingleObserver startup_obs; /*!< \brief Startup result callback */
96 /* CSingleObserver shutdown_obs; */ /*!< \brief Shutdown result callback */
97 CSingleObserver force_na_obs; /*!< \brief ForceNA result callback */
98 bool initial; /*!< \brief Is \c true for the initial network status "available" */
102 /*------------------------------------------------------------------------------------------------*/
104 /*------------------------------------------------------------------------------------------------*/
105 extern void Mgr_Ctor(CManager *self, CBase *base_ptr, CInic *inic_ptr, CNetworkManagement *net_ptr, CNodeDiscovery *nd_ptr, uint16_t packet_bw);
111 #endif /* UCS_MGR_H */
118 /*------------------------------------------------------------------------------------------------*/
120 /*------------------------------------------------------------------------------------------------*/