OpenBIC
OpenSource Bridge-IC
sensor_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 SENSOR_SHELL_H
18#define SENSOR_SHELL_H
19
20#include <shell/shell.h>
21
22/* According to IPMI specification Table 43, length of sensor name maximum is 16 bytes. */
23#define MAX_SENSOR_NAME_LENGTH 32 // 31 bytes sensor name and 1 byte null character
24#define COMMON_SENSOR_TABLE_INDEX 0
25
27
28void cmd_sensor_cfg_list_all_table(const struct shell *shell, size_t argc, char **argv);
29void cmd_sensor_cfg_list_all_sensor(const struct shell *shell, size_t argc, char **argv);
30void cmd_sensor_cfg_get_table_all_sensor(const struct shell *shell, size_t argc, char **argv);
31void cmd_sensor_cfg_get_table_single_sensor(const struct shell *shell, size_t argc, char **argv);
32void cmd_control_sensor_polling(const struct shell *shell, size_t argc, char **argv);
33
35 sub_sensor_cmds,
36 SHELL_CMD(list_all_table, NULL, "List all monitor table.", cmd_sensor_cfg_list_all_table),
37 SHELL_CMD(list_all_sensor, NULL, "List all SENSOR config.", cmd_sensor_cfg_list_all_sensor),
38 SHELL_CMD(get_table_all_sensor, NULL, "Get table all SENSOR config",
40 SHELL_CMD(get_table_single_sensor, NULL, "Get table single SENSOR config",
42 SHELL_CMD(control_sensor_polling, NULL, "Enable/Disable sensor polling",
44 SHELL_SUBCMD_SET_END);
45
46#endif
void control_sensor_polling(uint8_t sensor_num, uint8_t optional, uint8_t cache_status)
Definition: sensor.c:1413
SENSOR_ACCESS
Definition: sensor_shell.h:26
@ SENSOR_WRITE
Definition: sensor_shell.h:26
@ SENSOR_READ
Definition: sensor_shell.h:26
void cmd_control_sensor_polling(const struct shell *shell, size_t argc, char **argv)
Definition: sensor_shell.c:486
void cmd_sensor_cfg_get_table_single_sensor(const struct shell *shell, size_t argc, char **argv)
Definition: sensor_shell.c:450
void cmd_sensor_cfg_list_all_table(const struct shell *shell, size_t argc, char **argv)
Definition: sensor_shell.c:277
void cmd_sensor_cfg_list_all_sensor(const struct shell *shell, size_t argc, char **argv)
Definition: sensor_shell.c:305
void cmd_sensor_cfg_get_table_all_sensor(const struct shell *shell, size_t argc, char **argv)
Definition: sensor_shell.c:393
SHELL_STATIC_SUBCMD_SET_CREATE(sub_sensor_cmds, SHELL_CMD(list_all_table, NULL, "List all monitor table.", cmd_sensor_cfg_list_all_table), SHELL_CMD(list_all_sensor, NULL, "List all SENSOR config.", cmd_sensor_cfg_list_all_sensor), SHELL_CMD(get_table_all_sensor, NULL, "Get table all SENSOR config", cmd_sensor_cfg_get_table_all_sensor), SHELL_CMD(get_table_single_sensor, NULL, "Get table single SENSOR config", cmd_sensor_cfg_get_table_single_sensor), SHELL_CMD(control_sensor_polling, NULL, "Enable/Disable sensor polling", cmd_control_sensor_polling), SHELL_SUBCMD_SET_END)