common_library: gettid is multiple declaration in cl_error
[staging/basesystem.git] / video_in_hal / systemservice / system_manager / server / include / heartbeat / ss_hb_if.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 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup  tag_SystemManager
19 /// \brief    This file provides support for the application heartbeat system.
20 ///
21 ///////////////////////////////////////////////////////////////////////////////
22
23 #ifndef HEARTBEAT_INTERFACE_H_  // NOLINT
24 #define HEARTBEAT_INTERFACE_H_
25
26 #include <system_service/ss_system_manager_if.h>
27 #include <system_service/ss_system_manager_if_local.h>
28
29 /**
30  * Enumeration: message category
31  */
32 typedef enum HB_STATUS {
33   HB_STATUS_INVALID
34   , HB_STATUS_REGISTERED
35   , HB_STATUS_GOOD
36   , HB_STATUS_FAILED
37   , HB_STATUS_TIMEOUT
38 } EHBStatus;
39
40 /*
41  * Structure: report message data
42  */
43 typedef struct MODULE_INFO {
44 #define SS_SM_HB_MAX_PROC_NAME_SIZE 16
45   EHBStatus   ProcHBState;
46   UI_32       HeartBeatRetryCount;
47   // "ProcQueueName" is limited 16 bytes (included terminal-character NULL), so that the size of "THbReportData" will be lower than 4K Bytes.
48   CHAR        ProcQueueName[SS_SM_HB_MAX_PROC_NAME_SIZE];
49 } TSmModuleInfo;
50
51 typedef struct HB_REPORT_DATA {
52   EHBStatus       eEntireState;   ///< entire state for a request.
53                                   ///< if all modules are success, it's success, otherwise failed.
54   UI_32           nNumOfModules;  ///< number of modules
55   TSmModuleInfo   tModuleList[SS_MAX_NUM_MODULES];    ///< module information list, which include module IDs and states
56 } THbReportData;
57
58 typedef struct HB_AVAIL_CHECK {
59   BOOL isOk;
60   CHAR serviceName[SS_SM_HB_MAX_PROC_NAME_SIZE];
61 } THbAvailCheck;
62
63
64 EFrameworkunifiedStatus HBThreadStart(HANDLE hThread);
65 EFrameworkunifiedStatus HBThreadStop(HANDLE hThread);
66
67 #endif  // HEARTBEAT_INTERFACE_H_  // NOLINT