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_PowerService
19 /// \brief Handles SSM message for Wakeup State, Crank State, and Voltage
22 ///////////////////////////////////////////////////////////////////////////////
26 #include <system_service/ss_power_service_notifications.h>
27 #include <system_service/ss_power_service.h>
28 #include <system_service/ss_power_service_notifications_local.h>
29 #include <system_service/ss_system_manager_protocol.h>
30 #include <system_service/ss_sm_client_if.h>
31 #include <system_service/ss_templates.h>
32 #include <system_service/ss_services.h>
33 #include <native_service/frameworkunified_framework_if.h>
34 #include <native_service/frameworkunified_types.h>
37 #include "ss_power_powerservicelog.h"
40 EFrameworkunifiedStatus Power::OnPowerRequestMsg(HANDLE h_app) {
41 EFrameworkunifiedStatus l_eStatus;
42 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
44 // ToDo Jay 2012 December 05 Would like to provide better general overall
45 // solution then this local hack - but, for the time being...
46 std::map<EPWR_USER_MODE_TYPE, EPWR_POWER_STATE_TYPE> UserModeToPowerTypeMap;
47 UserModeToPowerTypeMap[epsumON] = epswsPWRON;
48 UserModeToPowerTypeMap[epsumOFF] = epswsPWROFF;
49 // End of ToDo Jay 2012 December 05 Would like to provide better general
51 Pwr_ServiceSetInterface tServiceIf;
54 // Check h_app ptr, msg size, msg reception, read msg if all ok. *
55 // Report any errors found. *
57 if (eFrameworkunifiedStatusOK != (l_eStatus = ReadMsg<Pwr_ServiceSetInterface>(h_app, tServiceIf))) { // LCOV_EXCL_BR_LINE 4: NSFW error case. // NOLINT[whitespace/line_length]
58 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
59 LOG_ERROR("ReadMsg()"); // LCOV_EXCL_LINE 4: NSFW error case.
61 BOOL b_isValid = FALSE;
62 FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__, "StartupReason is '%s'",
63 GetStr(tServiceIf.data.powerRequestMsg.startupReason).c_str());
65 switch (tServiceIf.data.powerRequestMsg.startupReason) {
68 case epswfUSER_DATA_RESET:
69 // Not startup conditions; don't log
74 LOG_POWERSERVICELOG_EVT(epswfON_KEY, Ei_StartUp_HK_On, epseisuedHK_ON_Key);
79 LOG_POWERSERVICELOG_EVT(epswfIGN_ACC, Ei_StartUp_Cansignal, epseisuedIGNITION);
80 LOG_POWERSERVICELOG_CNT(epswfIGN_ACC, CT_Startup_CanSignal);
84 case epswfDR_OPEN_CLOSE:
85 LOG_POWERSERVICELOG_EVT(epswfDR_OPEN_CLOSE, Ei_StartUp_Cansignal,
86 epseisuedDOOR_MODULES);
87 LOG_POWERSERVICELOG_CNT(epswfDR_OPEN_CLOSE, CT_Startup_CanSignal);
91 case epswfDX_ACTIVATION:
92 LOG_POWERSERVICELOG_EVT(epswfDX_ACTIVATION, Ei_StartUp_DiagMsg, epseisuedHU);
93 LOG_POWERSERVICELOG_CNT(epswfDX_ACTIVATION, CT_Startup_DiagMsg);
97 case epswfPASS_ACTIVATION:
98 LOG_POWERSERVICELOG_EVT(epswfPASS_ACTIVATION, Ei_StartUp_Cansignal,
100 LOG_POWERSERVICELOG_CNT(epswfPASS_ACTIVATION, CT_Startup_CanSignal);
104 case epswfSPVACTIVATION:
105 LOG_POWERSERVICELOG_EVT(epswfSPVACTIVATION, Ei_StartUp_Cansignal, epseisuedSNA);
106 LOG_POWERSERVICELOG_CNT(epswfSPVACTIVATION, CT_Startup_CanSignal);
110 // default: Don't code a 'default' here - let the compiler
111 // issue a warning ( set via -Wall or -Wswitch ) when the set of
112 // enumerations changes - then the maintainer will
113 // automagically know to update this switch statement.
114 } // End switch(tServiceIf.data.powerRequestMsg.startupReason)
116 if (FALSE == b_isValid) { // LCOV_EXCL_BR_LINE 11:unexpected branch
117 // LCOV_EXCL_START 11:unexpected branch
118 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
119 l_eStatus = eFrameworkunifiedStatusInvldParam;
121 ZONE_ERR, __FUNCTION__,
122 " Error: Unknown 'powerRequestMsg.startupReason' value: " "0x%X / %d",
123 tServiceIf.data.powerRequestMsg.startupReason,
124 tServiceIf.data.powerRequestMsg.startupReason);
125 // LCOV_EXCL_STOP 11:unexpected branch
127 m_WakeUpData.powerupType = UserModeToPowerTypeMap[tServiceIf.data
128 .powerRequestMsg.userMode];
129 m_WakeUpData.up.factor = tServiceIf.data.powerRequestMsg.startupReason;
130 m_WakeUpData.up.level = epswlFULLRUN;
131 m_WakeUpData.up.userModeChangeReason = tServiceIf.data.powerRequestMsg.userModeChangeReason;
133 l_eStatus = FrameworkunifiedSendMsg(GetSystemManagerSessionHandle(),
134 SS_SM_POWER_REQUEST_MSG, sizeof(tServiceIf),
138 l_cBuf, sizeof(l_cBuf),
139 "FrameworkunifiedSendMsg( SS_SM_POWER_REQUEST_MSG, %s, %s)",
140 GetStr(tServiceIf.data.powerRequestMsg.userMode).c_str(),
141 GetStr(tServiceIf.data.powerRequestMsg.userModeChangeReason).c_str());
142 LOG_STATUS(l_eStatus, l_cBuf);
144 } // End else a good ReadMsg()
146 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
148 } // End of EFrameworkunifiedStatus Power::OnpowerRequestMsg( HANDLE h_app )
150 EFrameworkunifiedStatus Power::OnShutdownRequestMsg(HANDLE h_app) {
151 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
152 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
153 Pwr_ServiceSetInterface tServiceIf;
156 // Check h_app ptr, msg size, msg reception, read msg if all ok. *
157 // Report any errors found. *
159 if (eFrameworkunifiedStatusOK != (l_eStatus = ReadMsg<Pwr_ServiceSetInterface>(h_app, tServiceIf))) { // LCOV_EXCL_BR_LINE 4: NSFW error case. // NOLINT[whitespace/line_length]
160 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
161 LOG_ERROR("ReadMsg()"); // LCOV_EXCL_LINE 4: NSFW error case.
163 BOOL b_isValid = FALSE;
164 EPWR_SHUTDOWN_TRIGGER_TYPE l_shutdownTrigger = tServiceIf.data
165 .shutdownRequestMsg.shutdownTrigger;
166 switch (l_shutdownTrigger) {
167 case epssdmsdtINVALID:
168 case epssdmsdtTESTACC_OFF:
169 // Not shutdown conditions; don't log
173 case epssdmsdtON_KEY:
174 LOG_POWERSERVICELOG_EVT(epssdmsdtON_KEY, Ei_shutdown_HkOFF, 0x00);
178 case epssdmsdtIGN_LOCK:
179 LOG_POWERSERVICELOG_EVT(epssdmsdtIGN_LOCK, Ei_shutdown_CANsignal,
181 LOG_POWERSERVICELOG_CNT(epssdmsdtIGN_LOCK, CT_Shutdown_CanSignal);
185 case epssdmsdtPWR_SAVE: // test from peripheralservice/power_supply_manager_shadow
186 LOG_POWERSERVICELOG_CNT(epssdmsdtPWR_SAVE, CT_Shutdown_Timeout); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
190 case epssdmsdtTMP_STARTUP:
191 LOG_POWERSERVICELOG_CNT(epssdmsdtTMP_STARTUP, CT_Shutdown_Timeout); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
195 case epssdmsdtDIAG_DEACTIVATION:
196 LOG_POWERSERVICELOG_CNT(epssdmsdtDIAG_DEACTIVATION, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
200 case epssdmsdtABNORMAL_VOLTAGE:
201 LOG_POWERSERVICELOG_EVT(epssdmsdtABNORMAL_VOLTAGE, Ei_shutdown_Voltage, // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
202 epseisdnvoltUNKNOWN);
203 LOG_POWERSERVICELOG_CNT(epssdmsdtABNORMAL_VOLTAGE, CT_Shutdown_Voltage); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
207 case epssdmsdtABNORMAL_TEMP:
208 LOG_POWERSERVICELOG_EVT(epssdmsdtABNORMAL_TEMP, Ei_shutdown_Temperature, 0x00); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
209 LOG_POWERSERVICELOG_CNT(epssdmsdtABNORMAL_TEMP, CT_Shutdown_Temperature); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
213 case epssdmsdtBATTERYCUTOFF:
214 LOG_POWERSERVICELOG_EVT(epssdmsdtBATTERYCUTOFF, Ei_shutdown_Voltage, // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
215 epseisdnvoltBATTERY_CUT_OFF);
216 LOG_POWERSERVICELOG_CNT(epssdmsdtBATTERYCUTOFF, CT_Shutdown_Voltage); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
220 case epssdmsdtLIMPHOME:
221 LOG_POWERSERVICELOG_EVT(epssdmsdtLIMPHOME, Ei_shutdown_Voltage, // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
222 epseisdnvoltLIMP_HOME);
223 LOG_POWERSERVICELOG_CNT(epssdmsdtLIMPHOME, CT_Shutdown_Voltage); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
227 case epssdmsdtHU_CAN_ERROR:
228 LOG_POWERSERVICELOG_EVT(epssdmsdtHU_CAN_ERROR, Ei_shutdown_NetworkError, // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
230 LOG_POWERSERVICELOG_CNT(epssdmsdtHU_CAN_ERROR, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
234 case epssdmsdtBODY_CAN_ERROR:
235 LOG_POWERSERVICELOG_EVT(epssdmsdtBODY_CAN_ERROR, Ei_shutdown_NetworkError, // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
237 LOG_POWERSERVICELOG_CNT(epssdmsdtBODY_CAN_ERROR, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
241 case epssdmsdtTRANSPORT_MODE:
242 LOG_POWERSERVICELOG_CNT(epssdmsdtTRANSPORT_MODE, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
246 case epssdmsdtPRODUCTION_MODE:
247 LOG_POWERSERVICELOG_CNT(epssdmsdtPRODUCTION_MODE, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
251 case epssdmsdtIGN_OFF:
252 LOG_POWERSERVICELOG_CNT(epssdmsdtIGN_OFF, CT_Shutdown_CanSignal); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
256 case epssdmsdtGENERIC_ERROR_RESET:
257 LOG_POWERSERVICELOG_CNT(epssdmsdtGENERIC_ERROR_RESET, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
261 case epssdmsdtFATAL_ERROR_RESET:
262 LOG_POWERSERVICELOG_CNT(epssdmsdtFATAL_ERROR_RESET, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
266 case epssdmsdtUSER_DATA_RESET:
267 LOG_POWERSERVICELOG_CNT(epssdmsdtUSER_DATA_RESET, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
271 case epssdmsdtFACTORY_DATA_RESET:
272 LOG_POWERSERVICELOG_CNT(epssdmsdtFACTORY_DATA_RESET, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
276 case epssdmsdtFAST_SLEEP_MODE:
277 LOG_POWERSERVICELOG_CNT(epssdmsdtFAST_SLEEP_MODE, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
281 case epssdmsdtNORMAL_RESET:
282 LOG_POWERSERVICELOG_CNT(epssdmsdtNORMAL_RESET, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
286 case epssdmsdtPROGUPDATE_RESET: // this is dead code
287 LOG_POWERSERVICELOG_CNT(epssdmsdtPROGUPDATE_RESET, CT_Shutdown_Error); // LCOV_EXCL_BR_LINE 15:marco defined in "native_service/ns_logger_if.h" // NOLINT[whitespace/line_length]
290 // default: Don't code a 'default' here - let the compiler
291 // issue a warning ( set via -Wall or -Wswitch ) when the set of
292 // enumerations changes - then the maintainer will
293 // automagically know to update this switch statement.
294 } // End switch(l_shutdownTrigger)
295 if (FALSE == b_isValid) { // LCOV_EXCL_BR_LINE 11:unexpected branch
296 // LCOV_EXCL_START 11:unexpected branch
297 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
298 l_eStatus = eFrameworkunifiedStatusInvldParam;
302 " Error: Unknown 'shutdownRequestMsg.shutdownTrigger' " "value: 0x%X/%d",
303 l_shutdownTrigger, l_shutdownTrigger);
304 // LCOV_EXCL_STOP 11:unexpected branch
306 l_eStatus = SendShutdownToSystemManager(&tServiceIf);
307 LOG_STATUS(l_eStatus, "SendShutdownToSystemManager()");
308 if (l_eStatus == eFrameworkunifiedStatusOK) { // LCOV_EXCL_BR_LINE 4: NSFW error case.
309 SetPowerServiceState(SS_PS_SHUTDOWN_INITIATED);
313 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
315 } // End of EFrameworkunifiedStatus Power::OnShutdownRequestMsg( HANDLE h_app )
317 //*****************************************************************************
318 // Shutdown Condition Notification Protocol function
320 EFrameworkunifiedStatus Power::OnPublishShutdownPopupRequest(HANDLE h_app) {
321 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
322 EFrameworkunifiedStatus l_eStatus;
323 Pwr_ServiceSetInterface tServiceIf;
326 // Check h_app ptr, msg size, msg reception, read msg if all ok. *
327 // Report any errors found. *
329 if (eFrameworkunifiedStatusOK != (l_eStatus = ReadMsg<Pwr_ServiceSetInterface>(h_app, tServiceIf))) { // LCOV_EXCL_BR_LINE 4: NSFW error case. // NOLINT[whitespace/line_length]
330 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
331 LOG_ERROR("ReadMsg()"); // LCOV_EXCL_LINE 4: NSFW error case.
333 BOOL b_isValid = FALSE;
334 EPWR_SHUTDOWN_POPUP_TYPE l_eShutdownPopup = tServiceIf.data.shutdownPopup
336 switch (l_eShutdownPopup) {
337 case epsspPowerSave1:
338 case epsspPowerSave2:
339 case epsspPowerSave3:
340 case epsspPowerSaveClr:
341 case epsspLowVoltage1:
342 case epsspLowVoltage2:
343 case epsspLowVoltage3:
344 case epsspLowVoltageClr:
345 case epsspBattCouplingSW1:
346 case epsspBattCouplingSW2:
347 case epsspBattCouplingSW3:
348 case epsspBattCouplingSWClr:
349 case epsspAbnormalTemp_1st:
350 case epsspAbnormalTemp_Clr:
351 case epsspLimpHome_1st:
352 case epsspLimpHome_2nd:
353 case epsspLimpHome_3rd:
354 case epsspLimpHome_Clr:
355 case epsspProdMd_1st:
356 case epsspProdMd_Clr:
357 case epsspTransMd_1st:
358 case epsspTransMd_Clr:
360 l_eStatus = FrameworkunifiedNPPublishNotification(h_app
361 , szNTFY_ShutdownPopup
363 , sizeof(EPWR_SHUTDOWN_POPUP_TYPE));
364 if (eFrameworkunifiedStatusOK != l_eStatus) { // LCOV_EXCL_BR_LINE 4: NSFW error case.
365 // LCOV_EXCL_START 4: NSFW error case.
366 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
367 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
368 " Error: FrameworkunifiedNPPublishNotification(%s, %d) errored: %d/'%s'",
369 szNTFY_ShutdownPopup, l_eShutdownPopup, l_eStatus,
370 GetStr(l_eStatus).c_str());
371 // LCOV_EXCL_STOP 4: NSFW error case.
374 SS_PWR_LOG_HIST("szNTFY_ShutdownPopup()", m_PubCmdHist, m_PubHistIter,
380 // default: Don't code a 'default' here - let the compiler
381 // issue a warning ( set via -Wall or -Wswitch ) when the set of
382 // enumerations changes - then the maintainer will
383 // automagically know to update this switch statement.
386 if (FALSE == b_isValid) { // LCOV_EXCL_BR_LINE 11:unexpected branch
387 // LCOV_EXCL_START 11:unexpected branch
388 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
389 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
390 " Error: Unknown 'l_eShutdownPopup' value: 0x%X / %d",
391 l_eShutdownPopup, l_eShutdownPopup);
392 l_eStatus = eFrameworkunifiedStatusInvldParam;
393 // LCOV_EXCL_STOP 11:unexpected branch
395 EFrameworkunifiedStatus l_responseStatus = l_eStatus; // Save the current status as-is to
396 // send in the message response to the
398 l_eStatus = FrameworkunifiedSendResponse(h_app,
399 SS_POWER_PUBLISH_SHUTDOWN_CONDITION_RESP,
400 sizeof(EFrameworkunifiedStatus),
401 (PVOID) &l_responseStatus);
404 snprintf(l_cBuf, sizeof(l_cBuf),
405 "FrameworkunifiedSendResponse(%s, %s, status: %d/'%s')", FrameworkunifiedGetMsgSrc(h_app),
406 "SS_POWER_PUBLISH_SHUTDOWN_CONDITION_RESP", l_responseStatus,
407 GetStr(l_responseStatus).c_str());
408 LOG_STATUS(l_eStatus, l_cBuf);
411 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
413 } // End of EFrameworkunifiedStatus Power::OnPublishShutdownPopupRequest( HANDLE h_app )
415 // End of Shutdown Condition Notification Protocol function
416 //*****************************************************************************
418 //*****************************************************************************
419 // Power Popup Notification Protocol function
421 EFrameworkunifiedStatus Power::OnPublishPowerPopupRequest(HANDLE h_app) {
422 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "+");
423 EFrameworkunifiedStatus l_eStatus = eFrameworkunifiedStatusOK;
424 Pwr_ServiceSetInterface tServiceIf;
427 // Check h_app ptr, msg size, msg reception, read msg if all ok. *
428 // Report any errors found. *
430 if (eFrameworkunifiedStatusOK != (l_eStatus = ReadMsg<Pwr_ServiceSetInterface>(h_app, tServiceIf))) { // LCOV_EXCL_BR_LINE 4: NSFW error case. // NOLINT[whitespace/line_length]
431 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
432 LOG_ERROR("ReadMsg()"); // LCOV_EXCL_LINE 4: NSFW error case.
434 BOOL b_isValid = FALSE;
435 EPWR_POWER_POPUP_TYPE l_ePowerPopup = tServiceIf.data.powerPopup
437 switch (l_ePowerPopup) {
440 case epssppAppCritical:
442 l_eStatus = FrameworkunifiedNPPublishNotification(h_app
445 , sizeof(EPWR_POWER_POPUP_TYPE));
446 if (eFrameworkunifiedStatusOK != l_eStatus) { // LCOV_EXCL_BR_LINE 4: NSFW error case.
447 // LCOV_EXCL_START 4: NSFW error case.
448 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
449 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
450 " Error: FrameworkunifiedNPPublishNotification(%s, %d) errored: %d/'%s'",
451 szNTFY_PowerPopup, l_ePowerPopup, l_eStatus,
452 GetStr(l_eStatus).c_str());
453 // LCOV_EXCL_STOP 4: NSFW error case.
456 SS_PWR_LOG_HIST("OnPublishPowerPopupRequest()", m_PubCmdHist,
457 m_PubHistIter, "", l_eStatus);
462 // default: Don't code a 'default' here - let the compiler
463 // issue a warning ( set via -Wall or -Wswitch ) when the set of
464 // enumerations changes - then the maintainer will
465 // automagically know to update this switch statement.
468 if (FALSE == b_isValid) { // LCOV_EXCL_BR_LINE 11:unexpected branch
469 // LCOV_EXCL_START 11:unexpected branch
470 AGL_ASSERT_NOT_TESTED(); // LCOV_EXCL_LINE 200: test assert
471 FRAMEWORKUNIFIEDLOG(ZONE_ERR, __FUNCTION__,
472 " Error: Unknown 'l_ePowerPopup' value: 0x%X/%d", l_ePowerPopup,
474 l_eStatus = eFrameworkunifiedStatusInvldParam;
475 // LCOV_EXCL_STOP 11:unexpected branch
477 EFrameworkunifiedStatus l_responseStatus = l_eStatus; // Save the current status as-is to
478 // send in the message response to the
480 l_eStatus = FrameworkunifiedSendResponse(h_app, SS_POWER_PUBLISH_POWER_POPUP_RESP,
481 sizeof(EFrameworkunifiedStatus),
482 (PVOID) &l_responseStatus);
484 snprintf(l_cBuf, sizeof(l_cBuf),
485 "FrameworkunifiedSendResponse(%s, %s, status: %d/'%s')", FrameworkunifiedGetMsgSrc(h_app),
486 "SS_POWER_PUBLISH_POWER_POPUP_RESP", l_responseStatus,
487 GetStr(l_responseStatus).c_str());
488 LOG_STATUS(l_eStatus, l_cBuf);
491 FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "-");
493 } // End of EFrameworkunifiedStatus Power::OnPublishPowerPopupRequest( HANDLE h_app )
495 // End of Power Popup Notification Protocol function
496 //*****************************************************************************
498 // EOF of /SS_PowerService/src/ss_supervisor_handlers.cpp