Init basesystem source codes.
[staging/basesystem.git] / systemservice / config / library / system_manager_config / include / system_service / ss_system_manager_conf.h
1 /*
2  * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 /**
17  * @file ss_system_manager_conf.h
18  * @brief \~english This file contains declaration of structures T_SS_SM_INIT_HOOK_IN_PARAM, T_SS_SM_INIT_HOOK_OUT_PARAM and api initial Hook
19  */
20 /** @addtogroup BaseSystem
21  *  @{
22  */
23 /** @addtogroup system_service
24  *  @ingroup BaseSystem
25  *  @{
26  */
27 /** @addtogroup config
28  *  @ingroup system_service
29  *  @{
30  */
31 #ifndef CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
32 #define CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
33
34 #include <native_service/frameworkunified_types.h>
35 #include <vector>
36 #include <string>
37
38 /**
39  * @struct T_SS_SM_INIT_HOOK
40  * @brief \~english  Version up mode, Callback function
41  */
42 typedef struct T_SS_SM_INIT_HOOK {
43   //! \~english Version up mode
44   BOOL bIsVupMode;
45   //! \~english Call back function
46   EFrameworkunifiedStatus (*cbRebootNoticeFunc)(HANDLE hApp);
47
48   T_SS_SM_INIT_HOOK()
49     : bIsVupMode(FALSE),
50       cbRebootNoticeFunc(NULL) {
51   }
52 } T_SS_SM_INIT_HOOK_IN_PARAM;
53
54
55 /**
56  * @struct T_SS_SM_INIT_HOOK_OUT_PARAM
57  * @brief \~english  Not in OOM Killer's service object, Group Relaunch service.
58  */
59 typedef struct {
60   std::vector<std::string> protectedSvcs;
61   //! \~english Not in OOM Killer's service object.
62   std::vector<std::string> groupRelaunchSvcs;
63   //! \~english Group Relaunch service.
64 } T_SS_SM_INIT_HOOK_OUT_PARAM;
65
66 /////////////////////////////////////////////////////////////////////////////////////
67 /// \ingroup ss_sm_initHook
68 /// \~english @par Summary
69 ///
70 /// \~english @param [in] hApp
71 ///       HANDLE - HANDLE Application
72 /// \~english @param [in] inPrm
73 ///       T_SS_SM_INIT_HOOK_IN_PARAM -
74 /// \~english @param [in] outPrm
75 ///       T_SS_SM_INIT_HOOK_OUT_PARAM -
76 /// \~english @par
77 ///            T_SS_SM_INIT_HOOK_IN_PARAM struct
78 /// \~english @code
79 ///            typedef struct T_SS_SM_INIT_HOOK {
80 ///              BOOL bIsVupMode;                               /* version up model */
81 ///              EFrameworkunifiedStatus (*cbRebootNoticeFunc)(HANDLE hApp); /* call back function */
82 ///              T_SS_SM_INIT_HOOK()
83 ///                : bIsVupMode(FALSE),
84 ///                cbRebootNoticeFunc(NULL) {
85 ///              }                                              /* constructor  */
86 ///            } T_SS_SM_INIT_HOOK_IN_PARAM;
87 ///            @endcode
88 /// \~english @par
89 ///            T_SS_SM_INIT_HOOK_IN_PARAM struct
90 /// \~english @code
91 ///            typedef struct {
92 ///              std::vector<std::string> protectedSvcs;     /* OOM Killer's protected service */
93 ///              std::vector<std::string> groupRelaunchSvcs; /* group relunch service */
94 ///            } T_SS_SM_INIT_HOOK_OUT_PARAM;
95 ///            @endcode
96 /// \~english @retval eFrameworkunifiedStatusOK Success
97 /// \~english @retval eFrameworkunifiedStatusInvldParam Invalid parameter
98 /// \~english @retval eFrameworkunifiedStatusNullPointer Invalid pointer
99 /// \~english @retval eFrameworkunifiedStatusInvldHandle Invalid handle
100 /// \~english @retval eFrameworkunifiedStatusInvldHndlType Invalid type of handle
101 /// \~english @retval eFrameworkunifiedStatusMsgQFull Message queue is full
102 /// \~english @retval eFrameworkunifiedStatusErrNoEBADF Invalid File-Descriptor
103 /// \~english @retval eFrameworkunifiedStatusErrNoEINTR An interrupt is generated by the system call (signal)
104 /// \~english @retval eFrameworkunifiedStatusInvldBufSize Invalid buffer-size
105 /// \~english @retval eFrameworkunifiedStatusFail Some sort of error occurred
106 /// \~english @retval eFrameworkunifiedStatusErrOther Other error(It failed to open/allocation of shared memory)
107 /// \~english @par Preconditions
108 ///       - None
109 /// \~english @par Change of the internal state
110 ///       - save inPrm->cbRebootNoticeFunc to s_confCtx.cbRebootNoticeFunc.
111 /// \~english @par Causes of failures
112 ///       -
113 ///       - System Manager of the session does not exist. [eFrameworkunifiedStatusNullPointer]
114 ///       - System Manager handle for the session is NULL. [eFrameworkunifiedStatusInvldHandle]
115 ///       - System Manager handle type for the session is not a transmission type. [eFrameworkunifiedStatusInvldHndlType]
116 ///       - System Manager message queue for the session is full. [eFrameworkunifiedStatusMsgQFull]
117 ///       - Transmission for the file descriptor of System Manager message for the session is invalid. \n
118 ///         [eFrameworkunifiedStatusErrNoEBADF]
119 ///       - Place to interrupt by the system call (signal) has occurred during the transmission of \n
120 ///         the System Manager message for the session. [eFrameworkunifiedStatusErrNoEINTR]
121 ///       - Size of the transmission buffer of the System Manager message for the session is invalid. \n
122 ///         [eFrameworkunifiedStatusInvldBufSize]
123 ///       - Any error has occurred at the time of transmission of the System Manager message for the session. \n
124 ///         [eFrameworkunifiedStatusFail]
125 ///       - Transmission of System Manager message for the session fails to shared memory access. \n
126 ///         [eFrameworkunifiedStatusErrOther]
127 /// \~english @par Classification
128 ///       Public
129 /// \~english @par Type
130 ///       Sync
131 /// \~english @par Detail
132 ///           get env val from application,and write these to Launch Config file.
133 /// \~english @par
134 ///             eFrameworkunifiedStatus:Result
135 ///                - eFrameworkunifiedStatusOK:Success
136 ///                - Except eFrameworkunifiedStatusOK:Fail
137 /// \~english @see  None
138 ////////////////////////////////////////////////////////////////////////////////////
139 EFrameworkunifiedStatus ss_sm_initHook(HANDLE hApp, const T_SS_SM_INIT_HOOK_IN_PARAM *inPrm,
140                           T_SS_SM_INIT_HOOK_OUT_PARAM *outPrm);
141
142 #endif  // CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
143 /** @}*/
144 /** @}*/
145 /** @}*/