Init basesystem source codes.
[staging/basesystem.git] / systemservice / interface_unified / library / include / system_service / ss_logger_service_protocol.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  * @file ss_logger_service_protocol.h
19  * @brief \~english This file supports the the Logger Service.
20  */
21 /** @addtogroup BaseSystem
22  *  @{
23  */
24 /** @addtogroup system_service
25  *  @ingroup BaseSystem
26  *  @{
27  */
28 /** @addtogroup interface_unified
29  *  @ingroup system_service
30  *  @{
31  */
32 #ifndef _SS_LOGGER_SERVICE_PROTOCOL_H_  // NOLINT (build/header_guard)
33 #define _SS_LOGGER_SERVICE_PROTOCOL_H_
34
35 #include <native_service/frameworkunified_types.h>
36 #include <native_service/frameworkunified_service_protocol.h>
37
38
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42
43 ///////////////////////////////////////////////////////////////////////////////
44 /// \ingroup  logger_service
45 /// \brief    Logger service event IDs
46 ///////////////////////////////////////////////////////////////////////////////
47 typedef enum _LoggerServiceProtocol {
48   SS_LOGGER_MILEAGE_DATA = 0x60,
49   SS_LOGGER_SET_PARAMS,
50   SS_LOGGER_STORE_SCREENCAPTURE_AND_LOG,                          // CLR+1+3
51   SS_LOGGER_STORE_SCREENCAPTURE,                                  // CLR+1+2
52   SS_LOGGER_STORE_LOG,                                            // ONHOOK+7+9
53   SS_LOGGER_SCREENCAPTURE_EVT_ACK,                                // Screen shot response (filename)
54   SS_LOGGER_EVENT_COMMONINFO,
55   SS_LOGGER__CWORD56__EVENT_INFO,
56   SS_LOGGER__CWORD56__RESET_INFO,
57   SS_LOGGER_SET_DATETIME,
58   SS_LOGGER_SET_VIN,
59   SS_LOGGER_UDP_LOGGING,
60   SS_LOGGER_ERROR_EVENT_ARTIFACT_REQ,
61   SS_LOGGER_ERROR_EVENT_ARTIFACT_RESP,
62   SS_LOGGER_SHUTDOWN_COMPLETE,
63   SS_LOGGER_DIAGDTC_ACTIVE,
64   SS_LOGGER_SET_DIAGID,
65   // Timer protocol IDs
66   SS_LOGGER_ERROR_EVENT_TIMER_ID_LOGGING_START_RSPN,
67   SS_LOGGER_ERROR_EVENT_TIMER_ID_ARTIFACT_RESPONSE,
68   SS_LOGGER_ERROR_EVENT_TIMER_ID_SCREEN_CAPTURE_RSPN,
69 }SS_LoggerServiceProtocol;
70
71 ///////////////////////////////////////////////////////////////////////////////
72 /// \ingroup  logger_service
73 /// \brief    Logger service event IDs
74 ///////////////////////////////////////////////////////////////////////////////
75 typedef enum _SS_LOGGERSERVICEPROTOCOL {
76   SS_LOGGERCOPYEVENTUSB =  0x80,                   // HMI to Dispatcher
77   SS_LOGGERCOPYEVENTUSB_SUCCESS_RESP,
78   SS_LOGGERCOPYEVENTUSB_ERROR_RESP,
79   SS_LOGGERCOPYEMERGENCYLOGS,
80   SS_LOGGERCOPYEMERGENCYLOGS_SUCCESS_RESP,
81   SS_LOGGERCOPYEMERGENCYLOGS_ERROR_RESP,
82   SS_LOGGERCLEAREVENT,                          // HMI to Dispatcher
83   SS_LOGGERCLEAREVENT_SUCCESS_RESP,
84   SS_LOGGERCLEAREVENT_ERROR_RESP,
85   SS_LOGGER_READ_STATL_COUNTER,
86   SS_LOGGER_READ_STATL_COUNTER_SUCCESS_RESP,
87   SS_LOGGER_READ_STATL_COUNTER_ERROR_RESP,
88   SS_LOGGER_RESET_STATL_COUNTER,
89   SS_LOGGER_RESET_STATL_COUNTER_SUCCESS_RESP,
90   SS_LOGGER_RESET_STATL_COUNTER_ERROR_RESP,
91   SS_LOGGER_ENG_READ_NUMOFEVENTS,
92   SS_LOGGER_ENG_READ_NUMOFEVENTS_RESP,
93   SS_LOGGER_ENG_READ_STATISTICAL_COUNTERS,
94   SS_LOGGER_ENG_READ_STATISTICAL_COUNTERS_RESP,
95   SS_LOGGER_UPLOAD_EVENTLOG,
96   SS_LOGGER_UPLOAD_EVENTLOG_RESP
97 }SS_loggerserviceprotocol;
98
99 ///////////////////////////////////////////////////////////////////////////////
100 /// \ingroup  logger_service
101 /// \brief    Private events for the following categories of devices
102 ///////////////////////////////////////////////////////////////////////////////
103 typedef enum _LoggerServerEvents {
104   SS_LOGGER_SCREENCAPTURE_EVT = 0xA0,                             // Screen shot request from PLM.
105   SS_LOGGER_ERRORINFO_EVT,
106   SS_LOGGER_LOGINFO_EVT,
107   SS_LOGGER_LOGSTARTED_EVT
108 }SS_LoggerServerEvents;
109
110 /////////////////////////////////////////////////////////////////////////////////////
111 /// \brief   eSSLoggerCANProtocolID
112 ///
113 /// \note    These IDs depict the possible events coming from CAN to logger_service
114 ///
115 /////////////////////////////////////////////////////////////////////////////////////
116 enum eSSLoggerCANProtocolID {
117     eSSLoggerCANProtocolIDCANTrigger = 0x10000000,  /// Start logging to USB
118     eSSLoggerCANProtocolIDDTCTrigger                /// Start logging of DTC to emmc
119 };
120
121 /////////////////////////////////////////////////////////////////////////////////////
122 /// \brief   eSSLoggerCANEvent
123 ///
124 /// \note    Events that are published to CAN for HK and CAN logging. Data structures
125 ///          attached to the single events can be found in below table
126 ///          | EventId                   | Return type               |
127 ///          | :------------------------ | :------------------------ |
128 ///          | eSSLoggerCANEventStart    | None                      |
129 ///          | eSSLoggerCANEventError    | STEventCANLoggerEventInfo |
130 ///          | eSSLoggerCANEventFinished | STEventCANLoggerEventInfo |
131 ///
132 /////////////////////////////////////////////////////////////////////////////////////
133 enum eSSLoggerCANEvent {
134     eSSLoggerCANEventStart = 0x10001000,  /// Logging has started for HK and CAN events
135     eSSLoggerCANEventError,               /// Logging has aborted with an error
136     eSSLoggerCANEventFinished             /// Logging has finished succesfully
137 };
138
139 #ifdef __cplusplus
140 }
141 #endif
142
143 #endif /* _SS_DEVICEDETECTION_SERVICE_PROTOCOL_H_ */  // NOLINT (build/header_guard)
144 /** @}*/
145 /** @}*/
146 /** @}*/