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.
17 ///////////////////////////////////////////////////////////////////////////////
18 /// \ingroup tag_SS_LoggerService
19 /// \brief This file contains the callback for Notifications and Protocol
22 ///////////////////////////////////////////////////////////////////////////////
23 #include "ss_logger_service_callbacks.h"
25 #include <boost/bind.hpp>
27 #include <native_service/frameworkunified_framework_if.h>
28 #include <native_service/frameworkunified_multithreading.h>
29 #include <system_service/ss_logger_service.h>
30 #include <ss_logger_common.h>
31 #include <system_service/ss_logger_service_notifications.h>
32 #include <system_service/ss_logger_service_protocol.h>
33 #include <native_service/ns_config_parser_if.h>
34 #include <native_service/nslogutil_cmd_if.h>
35 #include <system_service/ss_sm_client_if.h>
39 #include "ss_logger_error_event.h"
40 #include "loggerservicedebug_loggerservicelog.h"
41 #include "loggerservicedebug_thread_if.h"
42 extern CErrorEvent g_errorEventHandler;
43 extern HANDLE g_thrdEvntLogWriter;
46 STCanCurrentDateTime g_stDateAndTime = { 0 };
47 UEvtLoggerCommonInfo g_uEvtLoggerCommonInfo;
48 UI_16 g_u16DiagId = 0;
50 CLoggerServiceCallbacks::CLoggerServiceCallbacks()
53 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
54 FrameworkunifiedProtocolCallbackHandler l_protocolHandlers[kNUMBER_PROTOCOL_HANDLERS] =
55 { { SS_LOGGER_MILEAGE_DATA, boost::bind(
56 &CLoggerServiceCallbacks::LoggerServer_SetMileageData, this, _1) },
57 { SS_LOGGER_SET_PARAMS, boost::bind(
58 &CLoggerServiceCallbacks::LoggerServer_SetLoggerParams, this, _1) },
59 { SS_LOGGER_UDP_LOGGING, boost::bind(
60 &CLoggerServiceCallbacks::LoggerServer_UDPLogging, this, _1) },
61 { SS_LOGGERCOPYEVENTUSB, boost::bind(
62 &CLoggerServiceCallbacks::LoggerServer_OnCopyEvntLog, this,_1) },
63 { SS_LOGGERCLEAREVENT, boost::bind(
64 &CLoggerServiceCallbacks::LoggerServer_OnClearEvntLog, this, _1) },
65 { SS_LOGGER_READ_STATL_COUNTER, boost::bind(
66 &CLoggerServiceCallbacks::LoggerServer_OnReadStatCounter, this, _1) },
67 { SS_LOGGER_EVENT_COMMONINFO, boost::bind(
68 &CLoggerServiceCallbacks::LoggerServer_UpdateCommonInfo, this, _1) },
69 { SS_LOGGER__CWORD56__EVENT_INFO, boost::bind(
70 &CLoggerServiceCallbacks::LoggerServer_Handle_CWORD56_Events, this, _1) },
71 { SS_LOGGER_RESET_STATL_COUNTER, boost::bind(
72 &CLoggerServiceCallbacks::LoggerServer_OnResetStatCounter, this, _1) },
73 { SS_LOGGER_SET_VIN, boost::bind(
74 &CLoggerServiceCallbacks::LoggerServer_OnSetVIN, this, _1) },
75 { SS_LOGGERCOPYEMERGENCYLOGS, boost::bind(
76 &CLoggerServiceCallbacks::LoggerServer_OnCopyEmergencyLog, this, _1) },
77 { eSSLoggerCANProtocolIDCANTrigger, boost::bind(
78 &CLoggerServiceCallbacks::LoggerServer_OnCANTrigger, this, _1) },
79 { eSSLoggerCANProtocolIDDTCTrigger, boost::bind(
80 &CLoggerServiceCallbacks::LoggerServer_OnDTCTrigger, this, _1) },
81 { SS_LOGGER_SHUTDOWN_COMPLETE, boost::bind(
82 &CLoggerServiceCallbacks::LoggerServer_On_SHTDWN_Complete, this, _1) },
83 { SS_LOGGER_ENG_READ_NUMOFEVENTS, boost::bind(
84 &CLoggerServiceCallbacks::LoggerServer_OnReadNumberOfEvents, this, _1) },
85 { SS_LOGGER_SET_DIAGID, boost::bind(
86 &CLoggerServiceCallbacks::LoggerServer_OnSetDiagID, this, _1) },
87 { SS_LOGGER_UPLOAD_EVENTLOG, boost::bind(
88 &CLoggerServiceCallbacks::LoggerServer_UploadEventLog, this, _1) } }; // LCOV_EXCL_BR_LINE 11:Unexpected branch
90 for (UI_8 i = 0u; i < kNUMBER_PROTOCOL_HANDLERS; i++) {
91 m_protocolHandlers[i].iCmd = l_protocolHandlers[i].iCmd;
92 m_protocolHandlers[i].callBack = l_protocolHandlers[i].callBack; // LCOV_EXCL_BR_LINE 11:Unexpected branch
94 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
97 CLoggerServiceCallbacks::~CLoggerServiceCallbacks() { // LCOV_EXCL_START 14:globle instance
98 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
99 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
100 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
104 EFrameworkunifiedStatus CLoggerServiceCallbacks::Initialize(HANDLE f_hApp,
105 CLoggerCfg *f_pLoggerCfg,
106 CErrorEvent* f_pErrorEvent) {
107 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
108 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
109 m_pLoggerCfg = f_pLoggerCfg;
110 m_pErrorEvent = f_pErrorEvent;
112 if ((NULL == m_pLoggerCfg) || (NULL == m_pErrorEvent)) { // LCOV_EXCL_BR_LINE 200:As it is always TRUE
113 // LCOV_EXCL_START 200:As it is always TRUE
114 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
115 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
116 "NULL pointer passed to Initialize function!!!!!");
117 l_eStatus = eFrameworkunifiedStatusNullPointer;
120 // Attach callback : Open Session Request
121 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedAttachCallbackToDispatcher(f_hApp, FRAMEWORKUNIFIED_ANY_SOURCE, PROTOCOL_OPEN_SESSION_REQ, boost::bind(&CLoggerServiceCallbacks::LoggerServerOnOpenSession, this, _1)))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
122 // LCOV_EXCL_START 4:NSFW
123 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
127 "FrameworkunifiedAttachCallbackToDispatcher PROTOCOL_OPEN_SESSION_REQ (FRAMEWORKUNIFIED_ANY_SOURCE) Failed Status:0x%x ",
130 } else if ( eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedRegisterServiceAvailabilityNotification(f_hApp, NTFY_SS_LoggerService_Availability))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
131 // LCOV_EXCL_START 4:NSFW
132 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
133 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
134 "Failed to set service availability notification:0x%x ", l_eStatus);
139 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
143 //////////////////////////////////////////
144 // Function : DevDetectionServerOnOpenSession
145 // Callback for PROTOCOL_OPEN_SESSION_REQ
146 //////////////////////////////////////////
147 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServerOnOpenSession(HANDLE hApp) {
148 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
149 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
150 HANDLE l_hClientService = NULL;
151 HANDLE l_hSession = NULL;
153 // Get the requester name
154 PCSTR pRequester = FrameworkunifiedGetMsgSrc(hApp);
155 OpenSessionAck tOpenAck;
157 if (pRequester) { // LCOV_EXCL_BR_LINE 4:NSFW
158 l_hClientService = FrameworkunifiedMcOpenSender(hApp, pRequester);
160 if (l_hClientService) { // LCOV_EXCL_BR_LINE 4:NSFW
162 l_hSession = FrameworkunifiedCreateSession(hApp, pRequester);
163 UI_32 l_nSessionId = 0;
164 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedAttachCallbacksToDispatcher( hApp, pRequester, m_protocolHandlers, kNUMBER_PROTOCOL_HANDLERS, l_hSession))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
165 // LCOV_EXCL_START 4:NSFW
166 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
170 "FrameworkunifiedAttachCallbacksToDispatcher ss_logger_server_protocol_handlers Failed Status:0x%x ",
175 l_eStatus = this->m_pErrorEvent->OnOpenSession(hApp, pRequester,
177 if (eFrameworkunifiedStatusOK != l_eStatus) { // LCOV_EXCL_BR_LINE 200:To ensure success
178 // LCOV_EXCL_START 200:To ensure success
179 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
180 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
181 " Error. m_pErrorEvent->OnOpenSession(%s, %p) returned: %d.",
182 pRequester, l_hSession, l_eStatus);
186 // Attach callback : close Session Request
187 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedAttachCallbackToDispatcher(hApp, pRequester, PROTOCOL_CLOSE_SESSION_REQ, boost::bind(&CLoggerServiceCallbacks::LoggerServerOnCloseSession, this, _1)))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
188 // LCOV_EXCL_START 4:NSFW
189 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
193 "FrameworkunifiedAttachCallbackToDispatcher " "PROTOCOL_CLOSE_SESSION_REQ (FRAMEWORKUNIFIED_ANY_SOURCE) Failed Status:0x%x ",
198 l_nSessionId = FrameworkunifiedGetSessionId(l_hSession);
200 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "Session id is %d", l_nSessionId); // LCOV_EXCL_BR_LINE 15:macro
201 // sending the session open
202 tOpenAck.eStatus = eFrameworkunifiedStatusOK;
203 tOpenAck.sessionId = l_nSessionId;
204 tOpenAck.sessionType = 1;
206 // Copy session name to data structure
207 strncpy(tOpenAck.cSessionName, FrameworkunifiedGetAppName(hApp),
208 MAX_QUEUE_NAME_SIZE - 1);
209 tOpenAck.cSessionName[MAX_QUEUE_NAME_SIZE - 1] = '\0';
211 // send OpenSession ACK
212 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedSendMsg(l_hClientService, PROTOCOL_OPEN_SESSION_ACK, sizeof(OpenSessionAck), (PVOID) &tOpenAck))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
213 // LCOV_EXCL_START 4:NSFW
214 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
215 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __PRETTY_FUNCTION__,
216 "FrameworkunifiedSendMsg PROTOCOL_OPEN_SESSION_ACK Failed Status:0x%x ",
220 l_eStatus = FrameworkunifiedSetSessionHandle(hApp, FrameworkunifiedGetMsgSrc(hApp), l_hSession);
221 LOG_STATUS_IF_ERRORED(l_eStatus, "FrameworkunifiedSetSessionHandle()"); // LCOV_EXCL_BR_LINE 15:macro
224 l_eStatus = FrameworkunifiedMcClose(l_hClientService);
225 LOG_STATUS_IF_ERRORED(l_eStatus, "FrameworkunifiedMcClose()"); // LCOV_EXCL_BR_LINE 15:macro
227 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
232 //////////////////////////////////////////
233 // Function : DevDetectionServerOnCloseSession
234 // Callback for PROTOCOL_CLOSE_SESSION_REQ
235 //////////////////////////////////////////
236 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServerOnCloseSession(HANDLE hApp) {
237 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
238 EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
239 HANDLE hSession = NULL;
240 HANDLE l_hClientService = NULL;
241 // Get the requester name
242 PCSTR pRequester = FrameworkunifiedGetMsgSrc(hApp);
243 CloseSessionAck tCloseAck;
244 CloseSessionReq tClose;
246 if (pRequester) { // LCOV_EXCL_BR_LINE 4:NSFW
247 l_hClientService = FrameworkunifiedMcOpenSender(hApp, pRequester);
248 if (l_hClientService) { // LCOV_EXCL_BR_LINE 4:NSFW
249 // Read the data from the message
250 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, &tClose, sizeof(tClose), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
251 // LCOV_EXCL_START 4:NSFW
252 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
253 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Error: FrameworkunifiedGetMsgDataOfSize Failed");
255 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedMcClose(l_hClientService))) {
256 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Error: FrameworkunifiedMcClose failed");
258 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
263 hSession = FrameworkunifiedGetSessionHandle(hApp, pRequester, tClose.sessionId);
265 // Create a list of commands to be detached from the dispatcher
266 UI_32 cmd_array[kNUMBER_PROTOCOL_HANDLERS] = { 0 };
267 for (UI_32 i = 0; i < kNUMBER_PROTOCOL_HANDLERS; i++) {
268 cmd_array[i] = m_protocolHandlers[i].iCmd;
271 if (NULL != hSession) { // LCOV_EXCL_BR_LINE 4:NSFW
272 // Detach callbacks associated with client
273 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedDetachCallbacksFromDispatcher(hApp, pRequester, cmd_array, kNUMBER_PROTOCOL_HANDLERS, hSession))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
274 // LCOV_EXCL_START 4:NSFW
275 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
279 "FrameworkunifiedAttachCallbacksToDispatcher ss_logger_server_protocol_handlers Failed Status:0x%x ",
284 eStatus = m_pErrorEvent->OnCloseSession(hApp, pRequester, hSession);
285 if (eFrameworkunifiedStatusOK != eStatus) { // LCOV_EXCL_BR_LINE 200:To ensure success
286 // LCOV_EXCL_START 200:To ensure success
287 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
288 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
289 " Error. m_pErrorEvent->OnCloseSession(%s, %p) returned: %d.",
290 pRequester, hSession, eStatus);
294 // API to destroy the session handle and remove it from the Application Framework.
295 // LCOV_EXCL_BR_START 4:NSFW
296 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedDestroySession(hApp, // Application Handle
297 hSession))) { // Session Handle
299 // LCOV_EXCL_START 4:NSFW
300 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
301 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Session destroy failed");
305 // sending the session close ack
306 tCloseAck.eStatus = eFrameworkunifiedStatusOK;
307 tCloseAck.sessionId = tClose.sessionId;
309 // send CloseSession ACK
310 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedSendMsg(l_hClientService, PROTOCOL_CLOSE_SESSION_ACK, sizeof(CloseSessionAck), (PVOID) &tCloseAck))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
311 // LCOV_EXCL_START 4:NSFW
312 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
313 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __PRETTY_FUNCTION__,
314 "FrameworkunifiedSendMsg PROTOCOL_CLOSE_SESSION_ACK Failed Status:0x%x ",
318 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedMcClose(l_hClientService))) { // LCOV_EXCL_BR_LINE 4:NSFW
319 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
320 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Error: FrameworkunifiedMcClose failed"); // LCOV_EXCL_LINE 15:macro
324 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
328 //////////////////////////////////////////
329 // Function : LoggerServer_SetMileageData
330 // Callback for SS_LOGGER_MILEAGE_DATA
331 //////////////////////////////////////////
332 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_SetMileageData(HANDLE hApp) {
333 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
334 STLOGGER_CANDIAGSTAT MileageInfo_t;
335 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
336 memset(&MileageInfo_t, 0x00, sizeof(STLOGGER_CANDIAGSTAT));
337 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, &MileageInfo_t, sizeof(MileageInfo_t), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
338 // LCOV_EXCL_START 4:NSFW
339 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
340 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " FrameworkunifiedGetMsgDataOfSize Failed");
341 l_eStatus = eFrameworkunifiedStatusFail;
344 UI_32 l_mileage = (MileageInfo_t.Odo_MSB_H << 24
345 | MileageInfo_t.Odo_MSB_L << 16 | MileageInfo_t.Odo_LSB_H << 8
346 | MileageInfo_t.Odo_LSB_L);
347 // if value set to SNA
348 if (0xFFFFFFFF != l_mileage) {
349 this->m_pErrorEvent->SetMileage(l_mileage);
350 // Immediate Persist Event Log
351 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, eThrdCmdMileageData, sizeof(UI_32), &l_mileage))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
352 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
353 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "FrameworkunifiedSendChild msg failed:%d", l_eStatus); // LCOV_EXCL_LINE 15:macro
357 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
361 //////////////////////////////////////////
362 // Function : LoggerServer_SetLoggerParams
363 // Callback for SS_LOGGER_SET_PARAMS
364 //////////////////////////////////////////
365 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_SetLoggerParams(HANDLE hApp) {
366 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
367 EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
368 STLoggerSetParams l_stLoggerSetParams = { eInvalid_LoggerState, eDevUSB1 };
370 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, &l_stLoggerSetParams, sizeof(l_stLoggerSetParams), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
371 // LCOV_EXCL_START 4:NSFW
372 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
373 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Error: FrameworkunifiedGetMsgDataOfSize Failed");
374 eStatus = eFrameworkunifiedStatusFail;
375 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
379 eStatus = m_pLoggerCfg->SetLoggingParams(hApp, l_stLoggerSetParams);
382 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
386 //////////////////////////////////////////
387 // Function : LoggerServer_SetLoggerParams
388 // Callback for SS_LOGGER_SET_PARAMS
389 //////////////////////////////////////////
390 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_UDPLogging(HANDLE hApp) {
391 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
392 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
393 ELOGGER_STAT l_eUDPLoggingStatus = eInvalid_LoggerState;
395 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, &l_eUDPLoggingStatus, sizeof(l_eUDPLoggingStatus), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
396 // LCOV_EXCL_START 4:NSFW
397 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
398 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Error: FrameworkunifiedGetMsgDataOfSize Failed");
399 l_eStatus = eFrameworkunifiedStatusFail;
402 l_eStatus = m_pLoggerCfg->SetUDPLogging(hApp, l_eUDPLoggingStatus);
403 LOG_STATUS_IF_ERRORED( // LCOV_EXCL_BR_LINE 15:macro
405 "m_pLoggerCfg->SetUDPLogging()");
408 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
412 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_UpdateCommonInfo(HANDLE hApp) {
413 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
414 EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
416 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, &g_uEvtLoggerCommonInfo.u_stEvtLoggerCommonInfo, sizeof(g_uEvtLoggerCommonInfo.u_stEvtLoggerCommonInfo), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
417 // LCOV_EXCL_START 4:NSFW
418 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
419 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " FrameworkunifiedGetMsgDataOfSize Failed");
420 eStatus = eFrameworkunifiedStatusFail;
424 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
428 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_Handle_CWORD56_Events(HANDLE hApp) {
429 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
430 EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
431 STEventLoggerEventInfo l_stEventLoggingEventInfo;
434 if (eFrameworkunifiedStatusOK != (eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, &l_stEventLoggingEventInfo, sizeof(l_stEventLoggingEventInfo), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
435 // LCOV_EXCL_START 4:NSFW
436 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
437 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " FrameworkunifiedGetMsgDataOfSize Failed");
438 eStatus = eFrameworkunifiedStatusFail;
441 l_evtid = static_cast<UI_16>(((l_stEventLoggingEventInfo.EventGroup & 0x00FF) << 8)
442 | (l_stEventLoggingEventInfo.EventIdentifier & 0x00FF));
443 FRAMEWORKUNIFIEDLOG_EVT(ZONE_INFO, l_evtid, 4, l_stEventLoggingEventInfo.EventData[3],
444 l_stEventLoggingEventInfo.EventData[2],
445 l_stEventLoggingEventInfo.EventData[1],
446 l_stEventLoggingEventInfo.EventData[0]);
448 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
452 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnCopyEmergencyLog(
454 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
455 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
456 EDevNumber l_eDevNumber;
457 std::string l_path = "";
458 std::string l_srcName = "";
460 if (NULL != f_hApp) { // LCOV_EXCL_BR_LINE 6: it can't be null.
461 PCSTR l_tmp_srcname = FrameworkunifiedGetMsgSrc(f_hApp);
462 if (NULL != l_tmp_srcname) { // LCOV_EXCL_BR_LINE 6: it can't be null.
463 l_srcName = l_tmp_srcname;
466 if (eFrameworkunifiedStatusOK
467 == (l_eStatus = FrameworkunifiedGetMsgDataOfSize(f_hApp, &l_eDevNumber,
468 sizeof(l_eDevNumber), eSMRRelease))) {
469 switch (l_eDevNumber) {
471 l_path = m_pLoggerCfg->m_usb0MountPath;
475 l_path = m_pLoggerCfg->m_usb1MountPath;
479 l_path = m_pLoggerCfg->m_sdMountPath;
483 /*send back error response wrong param*/
484 l_eStatus = eFrameworkunifiedStatusInvldParam;
488 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " Error. Could not get msg Data.");
491 HANDLE l_hSession = NULL;
492 if (NULL == (l_hSession = FrameworkunifiedGetCurrentSessionHandle(f_hApp))) { // LCOV_EXCL_BR_LINE 4: NSFW error case.
493 // LCOV_EXCL_START 4: NSFW error case.
494 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
495 l_eStatus = eFrameworkunifiedStatusNullPointer;
496 LOG_ERROR("FrameworkunifiedGetCurrentSessionHandle()");
499 m_pErrorEvent->SetDiagSessionHandle(l_hSession);
501 if (0 == l_srcName.length()) { // LCOV_EXCL_BR_LINE 6: it can't be 0.
502 // LCOV_EXCL_START 6: it can't be 0.
503 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
504 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
505 " Error. Could not get name of source service.");
507 l_eStatus = eFrameworkunifiedStatusInvldHandle;
508 } else if (eFrameworkunifiedStatusOK != l_eStatus) {
509 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
510 " Error. Invalid parameter l_eDevNumber(%d).", l_eDevNumber);
511 l_eStatus = m_pErrorEvent->sendDiagEventErrorResponse(eNO_ERROR_INFO,
513 LOG_STATUS_IF_ERRORED(l_eStatus, "m_pErrorEvent->sendDiagEventErrorResponse(l_srcName)");
514 l_eStatus = eFrameworkunifiedStatusInvldParam;
515 } else if (eFrameworkunifiedStatusOK
516 != (l_eStatus = m_pErrorEvent->SetDiagEventSourceName(l_srcName))) {
517 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
518 " Error. m_pErrorEvent->SetDiagEventSourceName() returned %d.", l_eStatus);
519 l_eStatus = m_pErrorEvent->sendDiagEventErrorResponse(eNO_ERROR_INFO,
521 LOG_STATUS_IF_ERRORED(l_eStatus, "m_pErrorEvent->sendDiagEventErrorResponse(l_srcName)");
522 l_eStatus = eFrameworkunifiedStatusFail;
523 } else if (eFrameworkunifiedStatusOK != (l_eStatus =
524 SendDiagLoggingRequestToSystemManager(l_path))) { // LCOV_EXCL_BR_LINE 4: NSFW error case.
525 // LCOV_EXCL_START 4: NSFW error case.
526 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
527 /* call System Manager interface*/
528 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
529 " Error. SendDiagLoggingRequestToSystemManager() returned %d.", l_eStatus);
530 l_eStatus = m_pErrorEvent->sendDiagEventErrorResponse(eNO_ERROR_INFO);
531 LOG_STATUS_IF_ERRORED(l_eStatus, "m_pErrorEvent->sendDiagEventErrorResponse()");
532 l_eStatus = eFrameworkunifiedStatusFail;
535 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "Log Request passed to SystemManager.");
539 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
543 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnCANTrigger(HANDLE f_hApp) {
544 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
545 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
546 l_eStatus = SendCANLoggingRequestToSystemManager();
547 LOG_STATUS_IF_ERRORED(l_eStatus, "SendCANLoggingRequestToSystemManager()"); // LCOV_EXCL_BR_LINE 15:macro
548 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
552 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnDTCTrigger(HANDLE f_hApp) {
553 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
554 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
556 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedGetMsgDataOfSize(f_hApp, &l_dtc, sizeof(l_dtc), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
557 // LCOV_EXCL_START 4:NSFW
558 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
559 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, " Error. Could not get msg Data.");
562 l_eStatus = SendDTCLoggingRequestToSystemManager(l_dtc);
563 LOG_STATUS_IF_ERRORED(l_eStatus, "SendDTCLoggingRequestToSystemManager(dtc)"); // LCOV_EXCL_BR_LINE 15:macro
564 // Immediate Persist Event Log
565 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedSendChild(f_hApp, g_thrdEvntLogWriter, eThrdCmdImmPersistEvtLog, 0x00, NULL))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
566 // LCOV_EXCL_START 4:NSFW
567 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
568 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "FrameworkunifiedSendChild msg failed:%X", l_eStatus);
572 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
576 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_On_SHTDWN_Complete(
578 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
579 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
580 l_eStatus = LoggerService_OnStop(f_hApp);
581 LOG_STATUS_IF_ERRORED(l_eStatus, "LoggerService_OnStop()"); // LCOV_EXCL_BR_LINE 15:macro
582 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
586 ///////////////////////////////////////////////////////////////////////
587 /// Function :LoggerServer_OnSetVIN
588 ///////////////////////////////////////////////////////////////////////
589 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnSetVIN(HANDLE hApp) {
590 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
591 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
592 STVIN_NUMBER l_stVIN_Number;
594 if (eFrameworkunifiedStatusOK == (l_eStatus = FrameworkunifiedGetMsgDataOfSize(hApp, &l_stVIN_Number, sizeof(l_stVIN_Number), eSMRRelease))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
595 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, eThrdCmdSetVINnumber, sizeof(STVIN_NUMBER), &l_stVIN_Number))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
596 // LCOV_EXCL_START 4:NSFW
597 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
598 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "FrameworkunifiedSendChild msg failed:%X", l_eStatus);
602 // LCOV_EXCL_START 4:NSFW
603 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
604 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "FrameworkunifiedGetMsgDataOfSize failed errval: %X",
609 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
613 ///////////////////////////////////////////////////////////////////////
614 /// Function :LoggerServer_OnCopyEvntLog
615 ///////////////////////////////////////////////////////////////////////
616 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnCopyEvntLog(HANDLE hApp) {
617 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
618 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
620 TWriteFilesToUsbCmdData l_stCmdData;
621 HANDLE l_hSession = NULL;
623 if (hApp != NULL) { // LCOV_EXCL_BR_LINE 6: it can not be null
624 PCSTR l_tmp_srcname = FrameworkunifiedGetMsgSrc(hApp);
625 if (NULL != l_tmp_srcname) { // LCOV_EXCL_BR_LINE 6: it can not be null
626 l_stCmdData.stSessiondata.strSrcName = l_tmp_srcname;
628 if (l_stCmdData.stSessiondata.strSrcName.empty()) { // LCOV_EXCL_BR_LINE 6: it can not be empty
629 // LCOV_EXCL_START 6: it can not be empty
630 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
631 l_eStatus = eFrameworkunifiedStatusNullPointer;
632 LOG_ERROR("FrameworkunifiedGetMsgSrc()");
634 } else if (NULL == (l_hSession = FrameworkunifiedGetCurrentSessionHandle(hApp))) { // LCOV_EXCL_BR_LINE 6: it can not be null
635 // LCOV_EXCL_START 6: it can not be null
636 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
637 l_eStatus = eFrameworkunifiedStatusNullPointer;
638 LOG_ERROR("FrameworkunifiedGetCurrentSessionHandle()");
641 l_stCmdData.stSessiondata.session_id = FrameworkunifiedGetSessionId(l_hSession);
642 if (eFrameworkunifiedStatusOK
643 != (l_eStatus = ReadMsg<EEvtLogUSBDevNumber>(hApp, l_stCmdData.eDevId))) {
644 LOG_ERROR("ReadMsg()");
646 if (eFrameworkunifiedStatusOK
647 != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, // LCOV_EXCL_BR_LINE 4:NSFW
648 eThrdCmdWriteEvntFilesToUsb,
649 sizeof(TWriteFilesToUsbCmdData),
651 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
652 LOG_ERROR("FrameworkunifiedSendChild()"); // LCOV_EXCL_LINE 4:NSFW
657 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
658 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__, "Invalid App handler"); // LCOV_EXCL_LINE 6: it can not be null
661 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
665 ///////////////////////////////////////////////////////////////////////
666 /// Function :LoggerServer_OnClearEvntLog
667 ///////////////////////////////////////////////////////////////////////
668 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnClearEvntLog(HANDLE hApp) {
669 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
670 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
672 if (hApp != NULL) { // LCOV_EXCL_BR_LINE 200:As it is not always NULL
673 TSessionData l_sessiondata;
674 HANDLE l_hSession = NULL;
675 PCSTR l_tmp_srcname = FrameworkunifiedGetMsgSrc(hApp); // LCOV_EXCL_BR_LINE 11:Unexpected branch
676 if (NULL != l_tmp_srcname) { // LCOV_EXCL_BR_LINE 4:NSFW
677 l_sessiondata.strSrcName = l_tmp_srcname;
679 if (l_sessiondata.strSrcName.empty()) { // LCOV_EXCL_BR_LINE 4:As it is guaranteed by NSFW and is not always an empty string
680 // LCOV_EXCL_START 4:As it is guaranteed by NSFW and is not always an empty string
681 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
682 l_eStatus = eFrameworkunifiedStatusNullPointer;
683 LOG_ERROR("FrameworkunifiedGetMsgSrc()");
685 } else if (NULL == (l_hSession = FrameworkunifiedGetCurrentSessionHandle(hApp))) { // LCOV_EXCL_BR_LINE 4:NSFW
686 // LCOV_EXCL_START 4:NSFW
687 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
688 l_eStatus = eFrameworkunifiedStatusNullPointer;
689 LOG_ERROR("FrameworkunifiedGetCurrentSessionHandle()");
692 l_sessiondata.session_id = FrameworkunifiedGetSessionId(l_hSession); // LCOV_EXCL_BR_LINE 11:Unexpected branch
693 if (eFrameworkunifiedStatusOK != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, eThrdCmdClearEvntLogs, sizeof(TSessionData), &l_sessiondata))) { // LCOV_EXCL_BR_LINE 4:NSFW // NOLINT[whitespace/line_length]
694 // LCOV_EXCL_START 4:NSFW
695 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
696 LOG_ERROR("FrameworkunifiedSendChild()");
701 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
705 ///////////////////////////////////////////////////////////////////////
706 /// Function :LoggerServer_OnReadStatCounter
707 ///////////////////////////////////////////////////////////////////////
708 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnReadStatCounter(
710 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
711 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
713 if (hApp != NULL) { // LCOV_EXCL_BR_LINE 6: it can not be null
714 TStatisticalCountersCmd l_stCmdData;
715 HANDLE l_hSession = NULL;
717 PCSTR l_tmp_srcname = FrameworkunifiedGetMsgSrc(hApp);
718 if (NULL != l_tmp_srcname) { // LCOV_EXCL_BR_LINE 6: it can not be null
719 l_stCmdData.stSessiondata.strSrcName = l_tmp_srcname;
721 if (l_stCmdData.stSessiondata.strSrcName.empty()) { // LCOV_EXCL_BR_LINE 6: it can not be empty
722 // LCOV_EXCL_START 6: it can not be empty
723 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
724 l_eStatus = eFrameworkunifiedStatusNullPointer;
725 LOG_ERROR("FrameworkunifiedGetMsgSrc()");
727 } else if (NULL == (l_hSession = FrameworkunifiedGetCurrentSessionHandle(hApp))) { // LCOV_EXCL_BR_LINE 6: it can not be null
728 // LCOV_EXCL_START 6: it can not be empty
729 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
730 l_eStatus = eFrameworkunifiedStatusNullPointer;
731 LOG_ERROR("FrameworkunifiedGetCurrentSessionHandle()");
734 l_stCmdData.stSessiondata.session_id = FrameworkunifiedGetSessionId(l_hSession);
735 if (eFrameworkunifiedStatusOK
736 != (l_eStatus = ReadMsg<EStatCounterGroupID>(hApp,
737 l_stCmdData.eGroupId))) {
738 LOG_ERROR("ReadMsg()");
740 if (eFrameworkunifiedStatusOK
741 != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, // LCOV_EXCL_BR_LINE 4:NSFW
742 eThrdCmdStatisticalCounter,
743 sizeof(TStatisticalCountersCmd),
745 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
746 LOG_ERROR("FrameworkunifiedSendChild()");// LCOV_EXCL_LINE 4:NSFW
752 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
756 ///////////////////////////////////////////////////////////////////////
757 /// Function :LoggerServer_OnResetStatCounter
758 ///////////////////////////////////////////////////////////////////////
759 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnResetStatCounter(
761 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
762 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
764 if (hApp != NULL) { // LCOV_EXCL_BR_LINE 6: it can not be null
765 TStatisticalCountersCmd l_stCmdData;
766 HANDLE l_hSession = NULL;
767 PCSTR l_tmp_srcname = FrameworkunifiedGetMsgSrc(hApp);
768 if (NULL != l_tmp_srcname) { // LCOV_EXCL_BR_LINE 6: it can not be null
769 l_stCmdData.stSessiondata.strSrcName = l_tmp_srcname;
771 if (l_stCmdData.stSessiondata.strSrcName.empty()) { // LCOV_EXCL_BR_LINE 6: it can not be empty
772 // LCOV_EXCL_START 6: it can not be empty
773 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
774 l_eStatus = eFrameworkunifiedStatusNullPointer;
775 LOG_ERROR("FrameworkunifiedGetMsgSrc()");
777 } else if (NULL == (l_hSession = FrameworkunifiedGetCurrentSessionHandle(hApp))) { // LCOV_EXCL_BR_LINE 6: it can not be null
778 // LCOV_EXCL_START 6: it can not be empty
779 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
780 l_eStatus = eFrameworkunifiedStatusNullPointer;
781 LOG_ERROR("FrameworkunifiedGetCurrentSessionHandle()");
784 l_stCmdData.stSessiondata.session_id = FrameworkunifiedGetSessionId(l_hSession);
785 if (eFrameworkunifiedStatusOK
786 != (l_eStatus = ReadMsg<EStatCounterGroupID>(hApp,
787 l_stCmdData.eGroupId))) {
788 LOG_ERROR("ReadMsg()");
790 if (eFrameworkunifiedStatusOK
791 != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, // LCOV_EXCL_BR_LINE 4:NSFW
792 eThrdCmdResetStatisticalCntrs,
793 sizeof(TStatisticalCountersCmd),
795 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
796 LOG_ERROR("FrameworkunifiedSendChild()"); // LCOV_EXCL_LINE 4:NSFW
801 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
805 ///////////////////////////////////////////////////////////////////////
806 /// Function :LoggerServer_OnReadNumberOfEvents
807 ///////////////////////////////////////////////////////////////////////
808 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnReadNumberOfEvents(
810 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
811 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
812 TSessionData l_sessiondata;
813 HANDLE l_hSession = NULL;
815 l_sessiondata.strSrcName = FrameworkunifiedGetMsgSrc(hApp);
816 if (l_sessiondata.strSrcName.empty()) { // LCOV_EXCL_BR_LINE 6: it can not be empty
817 // LCOV_EXCL_START 6: it can not be empty
818 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
819 l_eStatus = eFrameworkunifiedStatusNullPointer;
820 LOG_ERROR("FrameworkunifiedGetMsgSrc()");
822 } else if (NULL == (l_hSession = FrameworkunifiedGetCurrentSessionHandle(hApp))) { // LCOV_EXCL_BR_LINE 6: it can not be null
823 // LCOV_EXCL_START 6: it can not be empty
824 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
825 l_eStatus = eFrameworkunifiedStatusNullPointer;
826 LOG_ERROR("FrameworkunifiedGetCurrentSessionHandle()");
829 l_sessiondata.session_id = FrameworkunifiedGetSessionId(l_hSession);
830 if (eFrameworkunifiedStatusOK
831 != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, // LCOV_EXCL_BR_LINE 4:NSFW
832 eThrdCmdGetNumberOfEventsLogged,
833 sizeof(TSessionData), &l_sessiondata))) {
834 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
835 LOG_ERROR("FrameworkunifiedSendChild()"); // LCOV_EXCL_LINE 4:NSFW
839 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
843 ///////////////////////////////////////////////////////////////////////
844 /// Function :LoggerServer_OnSetDiagID
845 ///////////////////////////////////////////////////////////////////////
846 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_OnSetDiagID(HANDLE hApp) {
847 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
848 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
851 if (eFrameworkunifiedStatusOK != (l_eStatus = ReadMsg<UI_16>(hApp, l_DiagId))) { // LCOV_EXCL_BR_LINE 200:To ensure success
852 // LCOV_EXCL_START 200:To ensure success
853 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
854 LOG_ERROR("ReadMsg()");
857 g_u16DiagId = l_DiagId;
862 ///////////////////////////////////////////////////////////////////////
863 /// Function :LoggerServer_UploadEventLog
864 ///////////////////////////////////////////////////////////////////////
865 EFrameworkunifiedStatus CLoggerServiceCallbacks::LoggerServer_UploadEventLog(HANDLE hApp) {
866 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
867 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
868 TSessionData l_sessiondata;
869 HANDLE l_hSession = NULL;
871 PCSTR l_tmp_srcname = FrameworkunifiedGetMsgSrc(hApp);
872 if (NULL != l_tmp_srcname) { // LCOV_EXCL_BR_LINE 6: it can not be null
873 l_sessiondata.strSrcName = l_tmp_srcname;
875 if (l_sessiondata.strSrcName.empty()) { // LCOV_EXCL_BR_LINE 6: it can not be empty
876 // LCOV_EXCL_START 6: it can not be empty
877 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
878 l_eStatus = eFrameworkunifiedStatusNullPointer;
879 LOG_ERROR("FrameworkunifiedGetMsgSrc()");
881 } else if (NULL == (l_hSession = FrameworkunifiedGetCurrentSessionHandle(hApp))) { // LCOV_EXCL_BR_LINE 6: it can not be null
882 // LCOV_EXCL_START 6: it can not be null
883 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
884 l_eStatus = eFrameworkunifiedStatusNullPointer;
885 LOG_ERROR("FrameworkunifiedGetCurrentSessionHandle()");
888 l_sessiondata.session_id = FrameworkunifiedGetSessionId(l_hSession);
889 if (eFrameworkunifiedStatusOK
890 != (l_eStatus = FrameworkunifiedSendChild(hApp, g_thrdEvntLogWriter, // LCOV_EXCL_BR_LINE 4:NSFW
891 eThrdCmdUploadEventLog,
892 sizeof(TSessionData), &l_sessiondata))) {
893 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
894 LOG_ERROR("FrameworkunifiedSendChild()"); // LCOV_EXCL_LINE 4:NSFW
898 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");