• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef POWER_SHELL_COMMAND_H
17 #define POWER_SHELL_COMMAND_H
18 
19 #include "shell_command.h"
20 
21 #include "power_mgr_client.h"
22 
23 namespace OHOS {
24 namespace PowerMgr {
25 class PowerShellCommand : public OHOS::AAFwk::ShellCommand {
26 public:
27     PowerShellCommand(int argc, char *argv[]);
~PowerShellCommand()28     ~PowerShellCommand() override {};
29 
30 private:
31     static constexpr const char * const TEMP_DUMP_LOG_PATH = "/data/test/power_dump.log";
32     static constexpr int DUMP_BUFF_SIZE = 100;
33     ErrCode CreateCommandMap() override;
34     ErrCode CreateMessageMap() override;
35     ErrCode init() override;
36     ErrCode RunAsHelpCommand();
37     ErrCode RunAsDumpCommand();
38     ErrCode RunAsSetModeCommand();
39     ErrCode RunAsWakeupCommand();
40     ErrCode RunAsSuspendCommand();
41     ErrCode RunAsDisplayCommand();
42 };
43 }  // namespace PowerMgr
44 }  // namespace OHOS
45 #endif  // POWER_SHELL_COMMAND_H