@@ -25,6 +25,10 @@ static mon_cmd_t android_redir_cmds[] = {
{ NULL, NULL, },
};
+static mon_cmd_t android_power_cmds[] = {
+ { NULL, NULL, },
+};
+
static mon_cmd_t android_cmds[] = {
{
.name = "help|h|?",
@@ -55,5 +59,12 @@ static mon_cmd_t android_cmds[] = {
.mhandler.cmd = android_console_redir,
.sub_table = android_redir_cmds,
},
+ { .name = "power",
+ .args_type = "item:s?",
+ .params = "",
+ .help = "power related commands",
+ .mhandler.cmd = android_console_power,
+ .sub_table = android_power_cmds,
+ },
{ NULL, NULL, },
};
@@ -298,3 +298,19 @@ void android_console_redir(Monitor *mon, const QDict *qdict)
monitor_printf(mon, "%s\n", redir_help[cmd]);
}
+enum {
+ CMD_POWER,
+};
+
+static const char *power_help[] = {
+ /* CMD_POWER */
+ "allows to change battery and AC power status",
+};
+
+void android_console_power(Monitor *mon, const QDict *qdict)
+{
+ /* Default to the first entry which is the parent help message */
+ int cmd = CMD_POWER;
+
+ monitor_printf(mon, "%s\n", power_help[cmd]);
+}
@@ -28,6 +28,8 @@ void android_console_redir_list(Monitor *mon, const QDict *qdict);
void android_console_redir_add(Monitor *mon, const QDict *qdict);
void android_console_redir_del(Monitor *mon, const QDict *qdict);
+void android_console_power(Monitor *mon, const QDict *qdict);
+
void android_monitor_print_error(Monitor *mon, const char *fmt, ...);
#endif
Added the base Android emulator console power command and infrastructure for adding sub-commands. Signed-off-by: Greg Bellows <greg.bellows@linaro.org> --- android-commands.h | 11 +++++++++++ android-console.c | 16 ++++++++++++++++ android-console.h | 2 ++ 3 files changed, 29 insertions(+)