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 This file supports power service session management.
21 ///////////////////////////////////////////////////////////////////////////////
22 #ifndef POWER_SERVICE_SERVER_INCLUDE_SS_POWER_SESSION_H_
23 #define POWER_SERVICE_SERVER_INCLUDE_SS_POWER_SESSION_H_
25 #include <system_service/ss_power_service.h>
26 #include <native_service/frameworkunified_types.h>
29 #include "ss_power_config.h"
31 typedef std::string SubscriberName; // The name of the module that is trying to open a session with Power
36 class PowerSessionHandler {
38 PowerSessionHandler();
39 virtual ~PowerSessionHandler();
40 EFrameworkunifiedStatus OpenSesion(HANDLE h_app);
41 EFrameworkunifiedStatus CloseSession(HANDLE h_app);
42 EFrameworkunifiedStatus StartComplete(HANDLE h_app);
43 EFrameworkunifiedStatus StopComplete(HANDLE h_app);
47 // Methods that do the heavy lifting
48 BOOL WakeupComplete(RequiredModuleList & wakeup_modules); // NOLINT (runtime/references)
49 BOOL ShutdownComplete(RequiredModuleList & shutdown_modules); // NOLINT (runtime/references)
50 EFrameworkunifiedStatus SendToSupervisor(UI_32 cmd, UI_32 length, PVOID data);
51 BOOL AllClientsInGroupStarted(UI_32 f_ungrpid);
52 BOOL ClientPresent(PCSTR f_sclientname);
55 struct PwSessionInfo {
57 std::string sz_servicename;
60 EPWR_SESSION_TYPE esessiontype;
64 typedef std::map<SubscriberName, PwSessionInfo> PwSessionMap;
65 typedef PwSessionMap::iterator PwSessionIter;
67 PwSessionMap m_mapSessions;
70 #endif // POWER_SERVICE_SERVER_INCLUDE_SS_POWER_SESSION_H_