From 30abec4d70d34875b0ca312d62eed5e264f9050d Mon Sep 17 00:00:00 2001 From: Erwan Velu Date: Sun, 27 May 2012 11:46:54 +0200 Subject: [PATCH] hdt: Adding say command This command is just for displaing a message to the cli during a defined period of time. Syntax is like the following : say `my message`% An example : say `This is my text message to display during 5 seconds`%5 --- com32/hdt/hdt-cli-hdt.c | 61 +++++++++++++++++++++++++++++++++++++++++++++++++ com32/hdt/hdt-cli.h | 1 + 2 files changed, 62 insertions(+) diff --git a/com32/hdt/hdt-cli-hdt.c b/com32/hdt/hdt-cli-hdt.c index 555237e..f7f7e94 100644 --- a/com32/hdt/hdt-cli-hdt.c +++ b/com32/hdt/hdt-cli-hdt.c @@ -259,6 +259,61 @@ static void do_dump(int argc __unused, char **argv __unused, dump(hardware); } +/** + * do_say - say message to user + **/ +static void do_say(int argc , char **argv , + struct s_hardware *hardware) +{ + (void) hardware; + if (argc == 0) return; + + char text_to_say[255]={0}; + int arg=0; + int sleep_time=0; +#if DEBUG + for (int i=0; i