Commit d2e57d87 authored by Georgi Chorbadzhiyski's avatar Georgi Chorbadzhiyski

comm: Add CMD_MMI_SEND_CHOICE and CMD_MMI_SEND_TEXT.

These commands are the same as CMD_MMI_SEND but such split would
allow further cleanups.
Signed-off-by: default avatarGeorgi Chorbadzhiyski <gf@unixsol.org>
parent e625aaee
......@@ -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;
......
......@@ -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 {
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment