Init basesystem source codes.
[staging/basesystem.git] / systemservice / power_service / server / src / ss_system_handlers.cpp
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 /// \ingroup  tag_PowerService
19 /// \brief    Handles Power Service Business logic
20 ///
21 ///////////////////////////////////////////////////////////////////////////////
22
23 #include "ss_power.h"
24 #include <system_service/ss_power_service_protocol.h>
25 #include <system_service/ss_power_service.h>
26 #include <native_service/frameworkunified_framework_if.h>
27 #include "ss_power_powerservicelog.h"
28
29 EFrameworkunifiedStatus Power::OnSystemLaunchComplete(HANDLE h_app) {
30   FRAMEWORKUNIFIEDLOG0(ZONE_FUNC, __FUNCTION__, "+");
31   EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
32
33   FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
34          "Power Service received SS_POWER_SYSTEM_LAUNCH_COMPLETE from: %s",
35          FrameworkunifiedGetMsgSrc(h_app));
36
37   FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "- return EFrameworkunifiedStatus: 0x%X", eStatus);
38   return eStatus;
39 }
40
41 // test from peripheralservice/power_supply_manager_shadow
42 EFrameworkunifiedStatus Power::OnSystemShutdownComplete(HANDLE h_app) {
43   FRAMEWORKUNIFIEDLOG0(ZONE_FUNC, __FUNCTION__, "+");
44   EFrameworkunifiedStatus eStatus = eFrameworkunifiedStatusOK;
45
46   FRAMEWORKUNIFIEDLOG(ZONE_INFO, __FUNCTION__,
47          "Power Service received SS_POWER_SYSTEM_SHUTDOWN_COMPLETE from: %s",
48          FrameworkunifiedGetMsgSrc(h_app));
49
50   FRAMEWORKUNIFIEDLOG(ZONE_FUNC, __FUNCTION__, "- return EFrameworkunifiedStatus: 0x%X", eStatus);
51   return eStatus;
52 }