summaryrefslogtreecommitdiffstats
path: root/systemservice/interface_unified/library/include/system_service/ss_logger_service.h
blob: 67ecb08bd7d1743459d5cfa2bac57704b6000e0a (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
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
/*
 * @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_logger_service.h
 * @brief \~english This file supports the the Logger Service.
 */
/** @addtogroup BaseSystem
 *  @{
 */
/** @addtogroup system_service
 *  @ingroup BaseSystem
 *  @{
 */
/** @addtogroup interface_unified
 *  @ingroup system_service
 *  @{
 */
#ifndef SS_LOGGER_SERVICE_H_  // NOLINT (build/header_guard)
#define SS_LOGGER_SERVICE_H_


#include <native_service/frameworkunified_types.h>

#define MAX_STATISTICAL_BUFFER 240

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Shared Memory names
///////////////////////////////////////////////////////////////////////////////
#define SHMEM_DRLOCATIONLOG      "/DRLocationLog"

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Shared Memory names
///////////////////////////////////////////////////////////////////////////////
#define SHMEM_DRINITIALLOG      "/DRInitialLog"

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    VIN numbers
///////////////////////////////////////////////////////////////////////////////
typedef struct _TVINnumber {
  static const UI_8 VIN_LEN = 18;
  CHAR        VINstr[VIN_LEN];
} STVIN_NUMBER;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    CAN Diagnostic status data
///////////////////////////////////////////////////////////////////////////////
typedef struct _TInterfaceunifiedCANMileageInfo {
  UI_8  DidA_ExtTest_Pres;
  UI_8  EngRun_Stat;
  UI_8  Odo_MSB_H;
  UI_8  Odo_MSB_L;
  UI_8  Odo_LSB_H;
  UI_8  Odo_LSB_L;
  UI_8  PN14_SupBat_Volt;
} STLOGGER_CANDIAGSTAT;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    CAN current date and time
///////////////////////////////////////////////////////////////////////////////
/**
* @struct __CWORD62_DateAndTime
* @brief \~english CAN current date and time
*/
typedef struct __CWORD62_DateAndTime {
  UI_8 DateTime_Stat; /*!< \~english Date time status*/
  UI_8 DateTimeDay; /*!< \~english Date*/
  UI_8 DateTimeHour; /*!< \~english Hour*/
  UI_8 DateTimeMinute; /*!< \~english Minute*/
  UI_8 DateTimeMonth; /*!< \~english Month*/
  UI_8 DateTimeSecond; /*!< \~english Second*/
  UI_8 DateTimeYear; /*!< \~english Year*/
  UI_8 TimeFormat; /*!< \~english Format*/
}STCanCurrentDateTime;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Logger Device Type
///////////////////////////////////////////////////////////////////////////////
typedef enum _ELoggerDeviceTypes {
  eDevUSB1,
  eDevUSB2,
  eDevSD,
  eTotalDevicesTypes,
  eInvalid_DevType
}EDEV_TYPE;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Logger State
///////////////////////////////////////////////////////////////////////////////
typedef enum _ELoggerState {
  eDeactivate,
  eActivate,
  eInvalid_LoggerState
}ELOGGER_STAT;

typedef enum _ELoggerErrorCodes {
  eSelectedDeviceNotFound = 0x0001,
  eWriteToDeviceFailed  = 0x0002,
  eScreenCaptureFailed  = 0x0003,
  eScreenCaptureSaveTimeExpired = 0x0004,
  eScreenCaptureStoreTimeExpired = 0x0005,
  eNoLogToStore           = 0x0006,
}ELOGGERERR_CODES;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Screen Capture Event data
///////////////////////////////////////////////////////////////////////////////
typedef struct _TInterfaceunifiedScreenCaptureEvt {
  static const UI_16              STR_BUFF_LEN = 64;
  BOOL                            fSucessful;
  UI_32                           uiSceenShotId;
  CHAR                            strNameAndLocation[STR_BUFF_LEN];
  UI_32                           uiFaultReasonCode;
}STScreenCaptureEvt;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    USB source number to store event logs.
///////////////////////////////////////////////////////////////////////////////
typedef enum _EEventLoggerUSBDeviceNumber {
  USB0 = 0,
  USB1 = 1,
  SD = 2
}EEvtLogUSBDevNumber;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    USB source number to store emergency error logs.
///////////////////////////////////////////////////////////////////////////////
typedef enum _EDevNumber {
  eEEL_USB1 = 1,
  eEEL_USB2 = 2,
  eEEL_SD = 3
}EDevNumber;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Counter group ID.
///////////////////////////////////////////////////////////////////////////////
typedef enum _ECounterGroupID {
  STARTUP_SHUTDOWN_COUNTER_GROUP = 0x01,
  APP_USAGE_COUNTER_GROUP,
  F_BLK_STABILITY_COUNTER_GROUP,
  MAX_COUNTER_GROUP
}EStatCounterGroupID;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Statistical counter.
///////////////////////////////////////////////////////////////////////////////
typedef struct _SStatisticalCounter {
  UI_16 u16StartupCounterLength;        ///< No of Counter from startup phase
  UI_16 u16NormalCounterLength;        ///< No of Counter from Normal phase
  UI_16 u16ShutDownCounterLength;      ///< No of Counter from Shut down phase
  UI_8 StatisticalCountBuffer[MAX_STATISTICAL_BUFFER];  ///< Counter values for startup,normal and shutsown phases
}SStatisticalCounter;

typedef enum _EEventLoggerSuccessCode {
  COPY_EVT_USB_SUCCESS = 0x20,
  CLEAR_EVENT_LOG_SUCCESS = 0x21,
  STATISTICAL_COUNTER_READ_SUCCESS = 0x22
}EEvtLoggerSuccessCode;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Event Logger error code
///////////////////////////////////////////////////////////////////////////////
typedef enum _EEventLoggerErrorCode {
  USB_DEVICE_NOT_AVAILABLE = 0x10,
  USB_DEVICE_WRITE_ERROR = 0x11,
  CLEAR_EVENT_LOG_FAILED = 0x12,
  STATISTICAL_COUNTER_READ_FAILED = 0x13,
  NO_ERROR_INFO = 0x14
}EEvtLoggerErrorCode;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Emergency Log error code
///////////////////////////////////////////////////////////////////////////////
typedef enum _EEmergencyLogErrorCode {
  eDEVICE_NOT_AVAILABLE = 0x10,
  eDEVICE_WRITE_ERROR = 0x11,
  eNO_ERROR_INFO = 0x12
}EELL_ErrorCode;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Event logger common information
///////////////////////////////////////////////////////////////////////////////
typedef struct _SEventLoggerCommonInfo {
  UI_8 BodyCAN_Stat:4;
  UI_8 HeadUnitCAN_Stat:4;
  UI_8 HMIInteraction:4;
  UI_8 IGN_Status:4;
  UI_8 FOT_Temp:2;
  UI_8 SystemVoltage:6;
}STEventLoggerCommonInfo;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Event logger resets counter information
///////////////////////////////////////////////////////////////////////////////
typedef struct _SEventLoggerResetInfo {
  UI_8 _CWORD56__ResetInfo;
  UI_8 _CWORD102__ResetInfo;
}STEventLoggerResetInfo;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Event logger _CWORD56_ events information
///////////////////////////////////////////////////////////////////////////////
typedef struct _SEventLoggerEventInfo {
  UI_8 NumberOfEvents;
  UI_8 EventGroup;
  UI_8 EventIdentifier;
  UI_8 EventData[4];
}STEventLoggerEventInfo;

///////////////////////////////////////////////////////////////////////////////
/// \ingroup  logger_service
/// \brief    Event logger CAN events information
///////////////////////////////////////////////////////////////////////////////
typedef struct _SEventCANLoggerEventInfo {
    BOOL                 success;
    BOOL                 valid;
    UI_32                triggerNumber;
    STCanCurrentDateTime dateAndTime;
}STEventCANLoggerEventInfo;

#endif /* SS_LOGGER_SERVICE_H_ */  // NOLINT (build/header_guard)
/** @}*/
/** @}*/
/** @}*/