OpenBIC
OpenSource Bridge-IC
power_shell.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
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#ifndef POWER_SHELL_H
18#define POWER_SHELL_H
19
20#include <stdlib.h>
21#include <shell/shell.h>
22
23struct device_arr {
24 uint8_t enable;
25 char *name;
26};
27
32};
33
34void cmd_power_status(const struct shell *shell, size_t argc, char **argv);
35void cmd_power_control(const struct shell *shell, size_t argc, char **argv);
36
38 SHELL_CMD(status, NULL, "List power status", cmd_power_status),
39 SHELL_CMD(control, NULL, "Power control", cmd_power_control),
40 SHELL_SUBCMD_SET_END);
41
42#endif
uint8_t status
Definition: mctp_ctrl.h:1
device_id
Definition: power_shell.h:28
@ DEVICE_BMC
Definition: power_shell.h:30
@ MAX_DEVICE_COUNT
Definition: power_shell.h:31
@ DEVICE_HOST
Definition: power_shell.h:29
SHELL_STATIC_SUBCMD_SET_CREATE(sub_power_cmds, SHELL_CMD(status, NULL, "List power status", cmd_power_status), SHELL_CMD(control, NULL, "Power control", cmd_power_control), SHELL_SUBCMD_SET_END)
void cmd_power_status(const struct shell *shell, size_t argc, char **argv)
Definition: power_shell.c:51
void cmd_power_control(const struct shell *shell, size_t argc, char **argv)
Definition: power_shell.c:86
Definition: power_shell.h:23
char * name
Definition: power_shell.h:25
uint8_t enable
Definition: power_shell.h:24