2 * @copyright Copyright (c) 2016-2020 TOYOTA MOTOR CORPORATION.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
18 * @file ss_logger_service.h
19 * @brief \~english This file supports the the Logger Service.
21 /** @addtogroup BaseSystem
24 /** @addtogroup system_service
28 /** @addtogroup interface_unified
29 * @ingroup system_service
32 #ifndef SS_LOGGER_SERVICE_H_ // NOLINT (build/header_guard)
33 #define SS_LOGGER_SERVICE_H_
36 #include <native_service/frameworkunified_types.h>
38 #define MAX_STATISTICAL_BUFFER 240
40 ///////////////////////////////////////////////////////////////////////////////
41 /// \ingroup logger_service
42 /// \brief Shared Memory names
43 ///////////////////////////////////////////////////////////////////////////////
44 #define SHMEM_DRLOCATIONLOG "/DRLocationLog"
46 ///////////////////////////////////////////////////////////////////////////////
47 /// \ingroup logger_service
48 /// \brief Shared Memory names
49 ///////////////////////////////////////////////////////////////////////////////
50 #define SHMEM_DRINITIALLOG "/DRInitialLog"
52 ///////////////////////////////////////////////////////////////////////////////
53 /// \ingroup logger_service
54 /// \brief VIN numbers
55 ///////////////////////////////////////////////////////////////////////////////
56 typedef struct _TVINnumber {
57 static const UI_8 VIN_LEN = 18;
61 ///////////////////////////////////////////////////////////////////////////////
62 /// \ingroup logger_service
63 /// \brief CAN Diagnostic status data
64 ///////////////////////////////////////////////////////////////////////////////
65 typedef struct _TInterfaceunifiedCANMileageInfo {
66 UI_8 DidA_ExtTest_Pres;
72 UI_8 PN14_SupBat_Volt;
73 } STLOGGER_CANDIAGSTAT;
75 ///////////////////////////////////////////////////////////////////////////////
76 /// \ingroup logger_service
77 /// \brief CAN current date and time
78 ///////////////////////////////////////////////////////////////////////////////
80 * @struct __CWORD62_DateAndTime
81 * @brief \~english CAN current date and time
83 typedef struct __CWORD62_DateAndTime {
84 UI_8 DateTime_Stat; /*!< \~english Date time status*/
85 UI_8 DateTimeDay; /*!< \~english Date*/
86 UI_8 DateTimeHour; /*!< \~english Hour*/
87 UI_8 DateTimeMinute; /*!< \~english Minute*/
88 UI_8 DateTimeMonth; /*!< \~english Month*/
89 UI_8 DateTimeSecond; /*!< \~english Second*/
90 UI_8 DateTimeYear; /*!< \~english Year*/
91 UI_8 TimeFormat; /*!< \~english Format*/
92 }STCanCurrentDateTime;
94 ///////////////////////////////////////////////////////////////////////////////
95 /// \ingroup logger_service
96 /// \brief Logger Device Type
97 ///////////////////////////////////////////////////////////////////////////////
98 typedef enum _ELoggerDeviceTypes {
106 ///////////////////////////////////////////////////////////////////////////////
107 /// \ingroup logger_service
108 /// \brief Logger State
109 ///////////////////////////////////////////////////////////////////////////////
110 typedef enum _ELoggerState {
116 typedef enum _ELoggerErrorCodes {
117 eSelectedDeviceNotFound = 0x0001,
118 eWriteToDeviceFailed = 0x0002,
119 eScreenCaptureFailed = 0x0003,
120 eScreenCaptureSaveTimeExpired = 0x0004,
121 eScreenCaptureStoreTimeExpired = 0x0005,
122 eNoLogToStore = 0x0006,
125 ///////////////////////////////////////////////////////////////////////////////
126 /// \ingroup logger_service
127 /// \brief Screen Capture Event data
128 ///////////////////////////////////////////////////////////////////////////////
129 typedef struct _TInterfaceunifiedScreenCaptureEvt {
130 static const UI_16 STR_BUFF_LEN = 64;
133 CHAR strNameAndLocation[STR_BUFF_LEN];
134 UI_32 uiFaultReasonCode;
137 ///////////////////////////////////////////////////////////////////////////////
138 /// \ingroup logger_service
139 /// \brief USB source number to store event logs.
140 ///////////////////////////////////////////////////////////////////////////////
141 typedef enum _EEventLoggerUSBDeviceNumber {
145 }EEvtLogUSBDevNumber;
147 ///////////////////////////////////////////////////////////////////////////////
148 /// \ingroup logger_service
149 /// \brief USB source number to store emergency error logs.
150 ///////////////////////////////////////////////////////////////////////////////
151 typedef enum _EDevNumber {
157 ///////////////////////////////////////////////////////////////////////////////
158 /// \ingroup logger_service
159 /// \brief Counter group ID.
160 ///////////////////////////////////////////////////////////////////////////////
161 typedef enum _ECounterGroupID {
162 STARTUP_SHUTDOWN_COUNTER_GROUP = 0x01,
163 APP_USAGE_COUNTER_GROUP,
164 F_BLK_STABILITY_COUNTER_GROUP,
166 }EStatCounterGroupID;
168 ///////////////////////////////////////////////////////////////////////////////
169 /// \ingroup logger_service
170 /// \brief Statistical counter.
171 ///////////////////////////////////////////////////////////////////////////////
172 typedef struct _SStatisticalCounter {
173 UI_16 u16StartupCounterLength; ///< No of Counter from startup phase
174 UI_16 u16NormalCounterLength; ///< No of Counter from Normal phase
175 UI_16 u16ShutDownCounterLength; ///< No of Counter from Shut down phase
176 UI_8 StatisticalCountBuffer[MAX_STATISTICAL_BUFFER]; ///< Counter values for startup,normal and shutsown phases
177 }SStatisticalCounter;
179 typedef enum _EEventLoggerSuccessCode {
180 COPY_EVT_USB_SUCCESS = 0x20,
181 CLEAR_EVENT_LOG_SUCCESS = 0x21,
182 STATISTICAL_COUNTER_READ_SUCCESS = 0x22
183 }EEvtLoggerSuccessCode;
185 ///////////////////////////////////////////////////////////////////////////////
186 /// \ingroup logger_service
187 /// \brief Event Logger error code
188 ///////////////////////////////////////////////////////////////////////////////
189 typedef enum _EEventLoggerErrorCode {
190 USB_DEVICE_NOT_AVAILABLE = 0x10,
191 USB_DEVICE_WRITE_ERROR = 0x11,
192 CLEAR_EVENT_LOG_FAILED = 0x12,
193 STATISTICAL_COUNTER_READ_FAILED = 0x13,
195 }EEvtLoggerErrorCode;
197 ///////////////////////////////////////////////////////////////////////////////
198 /// \ingroup logger_service
199 /// \brief Emergency Log error code
200 ///////////////////////////////////////////////////////////////////////////////
201 typedef enum _EEmergencyLogErrorCode {
202 eDEVICE_NOT_AVAILABLE = 0x10,
203 eDEVICE_WRITE_ERROR = 0x11,
204 eNO_ERROR_INFO = 0x12
207 ///////////////////////////////////////////////////////////////////////////////
208 /// \ingroup logger_service
209 /// \brief Event logger common information
210 ///////////////////////////////////////////////////////////////////////////////
211 typedef struct _SEventLoggerCommonInfo {
213 UI_8 HeadUnitCAN_Stat:4;
214 UI_8 HMIInteraction:4;
217 UI_8 SystemVoltage:6;
218 }STEventLoggerCommonInfo;
220 ///////////////////////////////////////////////////////////////////////////////
221 /// \ingroup logger_service
222 /// \brief Event logger resets counter information
223 ///////////////////////////////////////////////////////////////////////////////
224 typedef struct _SEventLoggerResetInfo {
225 UI_8 _CWORD56__ResetInfo;
226 UI_8 _CWORD102__ResetInfo;
227 }STEventLoggerResetInfo;
229 ///////////////////////////////////////////////////////////////////////////////
230 /// \ingroup logger_service
231 /// \brief Event logger _CWORD56_ events information
232 ///////////////////////////////////////////////////////////////////////////////
233 typedef struct _SEventLoggerEventInfo {
236 UI_8 EventIdentifier;
238 }STEventLoggerEventInfo;
240 ///////////////////////////////////////////////////////////////////////////////
241 /// \ingroup logger_service
242 /// \brief Event logger CAN events information
243 ///////////////////////////////////////////////////////////////////////////////
244 typedef struct _SEventCANLoggerEventInfo {
248 STCanCurrentDateTime dateAndTime;
249 }STEventCANLoggerEventInfo;
251 #endif /* SS_LOGGER_SERVICE_H_ */ // NOLINT (build/header_guard)