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 Declaration of CAttachService class
26 * \cond UCS_INTERNAL_DOC
34 /*------------------------------------------------------------------------------------------------*/
36 /*------------------------------------------------------------------------------------------------*/
40 #include "ucs_pmfifos.h"
41 #include "ucs_pmevent.h"
43 #include "ucs_ret_pb.h"
50 /*------------------------------------------------------------------------------------------------*/
52 /*------------------------------------------------------------------------------------------------*/
53 /*! \brief Initialization structure of the attach service. */
54 typedef struct Ats_InitData_
56 CBase *base_ptr; /*!< \brief Reference to UCS base instance */
57 CPmFifos *fifos_ptr; /*!< \brief Reference to PMS FIFOs */
58 CPmEventHandler *pme_ptr; /*!< \brief Reference to PMS Event Handler */
59 CInic *inic_ptr; /*!< \brief Reference to INIC Management instance */
63 /*! \brief Class structure of the attach service. */
64 typedef struct CAttachService_
66 Ats_InitData_t init_data; /*!< \brief Objects required for attach process */
67 CFsm fsm; /*!< \brief Attach state machine */
68 CService ats_srv; /*!< \brief Service instance for the scheduler */
69 CObserver obs; /*!< \brief Observer used for asynchronous events */
70 CObserver obs2; /*!< \brief Observer used for asynchronous events */
71 CSingleObserver sobs; /*!< \brief Single-observer used for asynchronous
73 CMaskedObserver internal_error_obs; /*!< \brief Error observer to handle INIC errors
74 during the attach process */
75 CTimer timer; /*!< \brief Timer to check for init timeout */
76 CSingleSubject ats_result_subject; /*!< \brief Subject to report the result of the
78 Ucs_InitResult_t report_result; /*!< \brief Internal result/error code memory */
82 /*------------------------------------------------------------------------------------------------*/
83 /* Prototypes of class CAttach */
84 /*------------------------------------------------------------------------------------------------*/
85 extern void Ats_Ctor(CAttachService *self, Ats_InitData_t *init_ptr);
86 extern void Ats_Start(void *self, CSingleObserver *obs_ptr);
92 #endif /* #ifndef UCS_ATTACH_H */
99 /*------------------------------------------------------------------------------------------------*/
101 /*------------------------------------------------------------------------------------------------*/