Add gitlab issue/merge request templates
[staging/basesystem.git] / service / system / task_manager / server / include / system_service / tskm_type.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 tskm_type.h
18  * @brief \~english type of tskm
19  */
20 /** @addtogroup BaseSystem
21  *  @{
22  */
23 /** @addtogroup system_service
24  *  @ingroup BaseSystem
25  *  @{
26  */
27 /** @addtogroup task_manager
28  *  @ingroup system_service
29  *  @{
30  */
31 #ifndef TASK_MANAGER_SERVER_INCLUDE_SYSTEM_SERVICE_TSKM_TYPE_H_
32 #define TASK_MANAGER_SERVER_INCLUDE_SYSTEM_SERVICE_TSKM_TYPE_H_
33
34
35
36 #include <stdint.h>
37 #include <native_service/frameworkunified_types.h>
38 #include <system_service/ss_services.h>
39 #include "system_service/tskm_svcid.h"
40
41
42 #define TSKM_ERR_t  int32_t
43 #define TSKM_E_OK       0
44 #define TSKM_E_PAR      1
45 #define TSKM_E_STATE    2
46 #define TSKM_E_PERMIT   3
47 #define TSKM_E_ALREADY  4
48 #define TSKM_E_RETRY    5
49 #define TSKM_E_NG       6
50
51 #define TSKM_BOOL_t   int32_t
52 #define TSKM_TRUE     1
53 #define TSKM_FALSE    0
54
55 #define TSKM_RSV_t   int
56
57 typedef uint32_t TSKM_SVCID_t;
58 // Values are defined in tskm_svcid.h
59
60 typedef enum {
61   TSKM_SVC_CMD_NOP,       // Do nothing
62   TSKM_SVC_CMD_EXEC,      // Startup service
63   TSKM_SVC_CMD_ENABLE,    // Allow service startup
64   TSKM_SVC_CMD_DISABLE,   // Prohibit service startup
65   TSKM_SVC_CMD_RESERVE,   // Reserve service startup
66 } TSKM_SVC_CMD_t;
67
68 typedef struct {
69   TSKM_SVC_CMD_t cmd;
70 } TSKM_SVC_CTL_t;
71
72 typedef struct {
73   TSKM_SVCID_t svcId;
74   TSKM_BOOL_t isExecDisable;
75 } TSKM_SVC_INFO_t;
76
77 typedef enum {
78   TSKM_BOOT_NORMAL,       // Normal start
79   TSKM_BOOT_FACTRESET,    // start with factory default start
80   TSKM_BOOT_USERRESET,    // start with resetting user info
81   TSKM_BOOT_VERSIONUP,    // start with version up
82 } TSKM_BOOT_t;
83
84 typedef enum {
85   TSKM_LOGGING_TYPE_MODULE_LOGS,   // logging request from the service
86   TSKM_LOGGING_TYPE_GRP_RELAUNCH,  // logging by Group Relaunch
87 } TSKM_LOGGING_TYPE_NORMAL_t;
88
89 typedef enum {
90   TSKM_ERROR_REBOOT_NORMAL,  // Anomaly detection
91 } TSKM_ERROR_REBOOT_TYPE_t;
92
93 #define TSKM_LOGGING_MSG_STR_SIZE 64
94
95 typedef struct {
96   TSKM_LOGGING_TYPE_NORMAL_t type;                                   // Log type
97   char messageStr[TSKM_LOGGING_MSG_STR_SIZE];  // Error message
98 } TSKM_LOGGING_INFO_t;
99
100 typedef struct {
101   TSKM_ERROR_REBOOT_TYPE_t type;  // Reboot type
102   TSKM_LOGGING_INFO_t log;        // Log info
103 } TSKM_ERROR_REBOOT_t;
104
105 typedef enum {
106   TSKM_DATAINIT_TYPE_USER,  // Reset user info
107 } TSKM_DATAINIT_TYPE_t;
108
109 typedef struct {
110   TSKM_DATAINIT_TYPE_t type;
111   EFrameworkunifiedStatus (*onCompInit)(HANDLE hApp);
112 } TSKM_DATAINIT_t;
113
114 #define TSKM_ORDER_NAME_MAX 32
115
116 typedef struct {
117   char orderName[TSKM_ORDER_NAME_MAX];
118 } TSKM_WAKEUP_ORDER_t;
119
120 #endif  // TASK_MANAGER_SERVER_INCLUDE_SYSTEM_SERVICE_TSKM_TYPE_H_
121 /** @}*/
122 /** @}*/
123 /** @}*/