summaryrefslogtreecommitdiffstats
path: root/systemservice/config/library/system_manager_config/include/system_service/ss_system_manager_conf.h
blob: 5354da8523d27884d36ccbd9b016e978c1492817 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
/*
 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @file ss_system_manager_conf.h
 * @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
 */
/** @addtogroup BaseSystem
 *  @{
 */
/** @addtogroup system_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup config
 *  @ingroup system_service
 *  @{
 */
#ifndef CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
#define CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_

#include <native_service/frameworkunified_types.h>
#include <vector>
#include <string>

/**
 * @struct T_SS_SM_INIT_HOOK
 * @brief \~english  Version up mode, Callback function
 */
typedef struct T_SS_SM_INIT_HOOK {
  //! \~english Version up mode
  BOOL bIsVupMode;
  //! \~english Call back function
  EFrameworkunifiedStatus (*cbRebootNoticeFunc)(HANDLE hApp);

  T_SS_SM_INIT_HOOK()
    : bIsVupMode(FALSE),
      cbRebootNoticeFunc(NULL) {
  }
} T_SS_SM_INIT_HOOK_IN_PARAM;


/**
 * @struct T_SS_SM_INIT_HOOK_OUT_PARAM
 * @brief \~english  Not in OOM Killer's service object, Group Relaunch service.
 */
typedef struct {
  std::vector<std::string> protectedSvcs;
  //! \~english Not in OOM Killer's service object.
  std::vector<std::string> groupRelaunchSvcs;
  //! \~english Group Relaunch service.
} T_SS_SM_INIT_HOOK_OUT_PARAM;

/////////////////////////////////////////////////////////////////////////////////////
/// \ingroup ss_sm_initHook
/// \~english @par Summary
///
/// \~english @param [in] hApp
///       HANDLE - HANDLE Application
/// \~english @param [in] inPrm
///       T_SS_SM_INIT_HOOK_IN_PARAM -
/// \~english @param [in] outPrm
///       T_SS_SM_INIT_HOOK_OUT_PARAM -
/// \~english @par
///            T_SS_SM_INIT_HOOK_IN_PARAM struct
/// \~english @code
///            typedef struct T_SS_SM_INIT_HOOK {
///              BOOL bIsVupMode;                               /* version up model */
///              EFrameworkunifiedStatus (*cbRebootNoticeFunc)(HANDLE hApp); /* call back function */
///              T_SS_SM_INIT_HOOK()
///                : bIsVupMode(FALSE),
///                cbRebootNoticeFunc(NULL) {
///              }                                              /* constructor  */
///            } T_SS_SM_INIT_HOOK_IN_PARAM;
///            @endcode
/// \~english @par
///            T_SS_SM_INIT_HOOK_IN_PARAM struct
/// \~english @code
///            typedef struct {
///              std::vector<std::string> protectedSvcs;     /* OOM Killer's protected service */
///              std::vector<std::string> groupRelaunchSvcs; /* group relunch service */
///            } T_SS_SM_INIT_HOOK_OUT_PARAM;
///            @endcode
/// \~english @retval eFrameworkunifiedStatusOK Success
/// \~english @retval eFrameworkunifiedStatusInvldParam Invalid parameter
/// \~english @retval eFrameworkunifiedStatusNullPointer Invalid pointer
/// \~english @retval eFrameworkunifiedStatusInvldHandle Invalid handle
/// \~english @retval eFrameworkunifiedStatusInvldHndlType Invalid type of handle
/// \~english @retval eFrameworkunifiedStatusMsgQFull Message queue is full
/// \~english @retval eFrameworkunifiedStatusErrNoEBADF Invalid File-Descriptor
/// \~english @retval eFrameworkunifiedStatusErrNoEINTR An interrupt is generated by the system call (signal)
/// \~english @retval eFrameworkunifiedStatusInvldBufSize Invalid buffer-size
/// \~english @retval eFrameworkunifiedStatusFail Some sort of error occurred
/// \~english @retval eFrameworkunifiedStatusErrOther Other error(It failed to open/allocation of shared memory)
/// \~english @par Preconditions
///       - None
/// \~english @par Change of the internal state
///       - save inPrm->cbRebootNoticeFunc to s_confCtx.cbRebootNoticeFunc.
/// \~english @par Causes of failures
///       -
///       - System Manager of the session does not exist. [eFrameworkunifiedStatusNullPointer]
///       - System Manager handle for the session is NULL. [eFrameworkunifiedStatusInvldHandle]
///       - System Manager handle type for the session is not a transmission type. [eFrameworkunifiedStatusInvldHndlType]
///       - System Manager message queue for the session is full. [eFrameworkunifiedStatusMsgQFull]
///       - Transmission for the file descriptor of System Manager message for the session is invalid. \n
///         [eFrameworkunifiedStatusErrNoEBADF]
///       - Place to interrupt by the system call (signal) has occurred during the transmission of \n
///         the System Manager message for the session. [eFrameworkunifiedStatusErrNoEINTR]
///       - Size of the transmission buffer of the System Manager message for the session is invalid. \n
///         [eFrameworkunifiedStatusInvldBufSize]
///       - Any error has occurred at the time of transmission of the System Manager message for the session. \n
///         [eFrameworkunifiedStatusFail]
///       - Transmission of System Manager message for the session fails to shared memory access. \n
///         [eFrameworkunifiedStatusErrOther]
/// \~english @par Classification
///       Public
/// \~english @par Type
///       Sync
/// \~english @par Detail
///           get env val from application,and write these to Launch Config file.
/// \~english @par
///             eFrameworkunifiedStatus:Result
///                - eFrameworkunifiedStatusOK:Success
///                - Except eFrameworkunifiedStatusOK:Fail
/// \~english @see  None
////////////////////////////////////////////////////////////////////////////////////
EFrameworkunifiedStatus ss_sm_initHook(HANDLE hApp, const T_SS_SM_INIT_HOOK_IN_PARAM *inPrm,
                          T_SS_SM_INIT_HOOK_OUT_PARAM *outPrm);

#endif  // CONFIG_LIBRARY_SYSTEM_MANAGER_CONFIG_INCLUDE_SYSTEM_SERVICE_SS_SYSTEM_MANAGER_CONF_H_
/** @}*/
/** @}*/
/** @}*/