[dvblast-devel] [PATCH 2/6] comm: Add CMD_MMI_SEND_CHOICE and CMD_MMI_SEND_TEXT.

Georgi Chorbadzhiyski gf at unixsol.org
Mon Sep 12 22:39:59 CEST 2011


These commands are the same as CMD_MMI_SEND but such split would
allow further cleanups.

Signed-off-by: Georgi Chorbadzhiyski <gf at unixsol.org>
---
 comm.c       |    4 ++++
 comm.h       |    2 ++
 dvblastctl.c |   12 ++++++++----
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/comm.c b/comm.c
index 522627c..471d3e6 100644
--- a/comm.c
+++ b/comm.c
@@ -114,6 +114,8 @@ void comm_Read( void )
             case CMD_MMI_CLOSE:
             case CMD_MMI_RECV:
             case CMD_MMI_SEND:
+            case CMD_MMI_SEND_TEXT:
+            case CMD_MMI_SEND_CHOICE:
                 i_answer = RET_NODATA;
                 i_answer_size = 0;
                 goto return_answer;
@@ -163,6 +165,8 @@ void comm_Read( void )
         break;
 
     case CMD_MMI_SEND:
+    case CMD_MMI_SEND_TEXT:
+    case CMD_MMI_SEND_CHOICE:
         i_answer = en50221_SendMMIObject( p_buffer + COMM_HEADER_SIZE,
                                           i_size - COMM_HEADER_SIZE );
         break;
diff --git a/comm.h b/comm.h
index 0cdc156..d4b45ee 100644
--- a/comm.h
+++ b/comm.h
@@ -44,6 +44,8 @@ typedef enum {
     CMD_GET_PMT             = 14, /* arg: service_id (uint16_t) */
     CMD_GET_PIDS            = 15,
     CMD_GET_PID             = 16, /* arg: pid (uint16_t) */
+    CMD_MMI_SEND_TEXT       = 17, /* arg: slot, en50221_mmi_object_t */
+    CMD_MMI_SEND_CHOICE     = 18, /* arg: slot, en50221_mmi_object_t */
 } ctl_cmd_t;
 
 typedef enum {
diff --git a/dvblastctl.c b/dvblastctl.c
index d4f00f5..f2e6622 100644
--- a/dvblastctl.c
+++ b/dvblastctl.c
@@ -320,12 +320,12 @@ int main( int i_argc, char **ppsz_argv )
             p_buffer[1] = CMD_MMI_RECV;
         else
         {
-            struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)&p_buffer[4];
-            p_buffer[1] = CMD_MMI_SEND;
-            p_cmd->i_slot = atoi(ppsz_argv[optind + 1]);
-
             if ( !strcmp(ppsz_argv[optind], "mmi_send_text") )
             {
+                struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)&p_buffer[4];
+                p_buffer[1] = CMD_MMI_SEND_TEXT;
+                p_cmd->i_slot = atoi(p_arg1);
+
                 en50221_mmi_object_t object;
                 object.i_object_type = EN50221_MMI_ANSW;
                 if ( ppsz_argv[optind + 2] == NULL
@@ -354,6 +354,10 @@ int main( int i_argc, char **ppsz_argv )
             }
             else /* mmi_send_choice */
             {
+                struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)&p_buffer[4];
+                p_buffer[1] = CMD_MMI_SEND_CHOICE;
+                p_cmd->i_slot = atoi(p_arg1);
+
                 i_size = COMM_HEADER_SIZE + sizeof(struct cmd_mmi_send);
                 p_cmd->object.i_object_type = EN50221_MMI_MENU_ANSW;
                 p_cmd->object.u.menu_answ.i_choice
-- 
1.7.5.1



More information about the dvblast-devel mailing list