Commit 1e81d443 authored by Georgi Chorbadzhiyski's avatar Georgi Chorbadzhiyski

dvblastctl: Move handling of mmi_send_text and mmi_send_choice near other commands.

This move is in preparation for command handling cleanup that will
follow next. No functional changes just code move.
Signed-off-by: default avatarGeorgi Chorbadzhiyiski <gf@unixsol.org>
parent 1febf555
...@@ -362,23 +362,7 @@ int main( int i_argc, char **ppsz_argv ) ...@@ -362,23 +362,7 @@ int main( int i_argc, char **ppsz_argv )
p_data[1] = (uint8_t)(i_pid & 0xff); p_data[1] = (uint8_t)(i_pid & 0xff);
} else if ( !strcmp(ppsz_argv[optind], "mmi_status") ) } else if ( !strcmp(ppsz_argv[optind], "mmi_status") )
p_buffer[1] = CMD_MMI_STATUS; p_buffer[1] = CMD_MMI_STATUS;
else else if ( !strcmp(ppsz_argv[optind], "mmi_send_text") ) {
{
p_buffer[4] = atoi(p_arg1);
i_size = COMM_HEADER_SIZE + 1;
if ( !strcmp(ppsz_argv[optind], "mmi_slot_status") )
p_buffer[1] = CMD_MMI_SLOT_STATUS;
else if ( !strcmp(ppsz_argv[optind], "mmi_open") )
p_buffer[1] = CMD_MMI_OPEN;
else if ( !strcmp(ppsz_argv[optind], "mmi_close") )
p_buffer[1] = CMD_MMI_CLOSE;
else if ( !strcmp(ppsz_argv[optind], "mmi_get") )
p_buffer[1] = CMD_MMI_RECV;
else
{
if ( !strcmp(ppsz_argv[optind], "mmi_send_text") )
{
struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)&p_buffer[4]; struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)&p_buffer[4];
p_buffer[1] = CMD_MMI_SEND_TEXT; p_buffer[1] = CMD_MMI_SEND_TEXT;
p_cmd->i_slot = atoi(p_arg1); p_cmd->i_slot = atoi(p_arg1);
...@@ -408,8 +392,7 @@ int main( int i_argc, char **ppsz_argv ) ...@@ -408,8 +392,7 @@ int main( int i_argc, char **ppsz_argv )
i_size += COMM_HEADER_SIZE i_size += COMM_HEADER_SIZE
+ ((void *)&p_cmd->object - (void *)p_cmd); + ((void *)&p_cmd->object - (void *)p_cmd);
} }
else /* mmi_send_choice */ else if ( !strcmp(ppsz_argv[optind], "mmi_send_choice") ) {
{
struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)&p_buffer[4]; struct cmd_mmi_send *p_cmd = (struct cmd_mmi_send *)&p_buffer[4];
p_buffer[1] = CMD_MMI_SEND_CHOICE; p_buffer[1] = CMD_MMI_SEND_CHOICE;
p_cmd->i_slot = atoi(p_arg1); p_cmd->i_slot = atoi(p_arg1);
...@@ -418,7 +401,19 @@ int main( int i_argc, char **ppsz_argv ) ...@@ -418,7 +401,19 @@ int main( int i_argc, char **ppsz_argv )
p_cmd->object.i_object_type = EN50221_MMI_MENU_ANSW; p_cmd->object.i_object_type = EN50221_MMI_MENU_ANSW;
p_cmd->object.u.menu_answ.i_choice = atoi(p_arg2); p_cmd->object.u.menu_answ.i_choice = atoi(p_arg2);
} }
} else
{
p_buffer[4] = atoi(p_arg1);
i_size = COMM_HEADER_SIZE + 1;
if ( !strcmp(ppsz_argv[optind], "mmi_slot_status") )
p_buffer[1] = CMD_MMI_SLOT_STATUS;
else if ( !strcmp(ppsz_argv[optind], "mmi_open") )
p_buffer[1] = CMD_MMI_OPEN;
else if ( !strcmp(ppsz_argv[optind], "mmi_close") )
p_buffer[1] = CMD_MMI_CLOSE;
else if ( !strcmp(ppsz_argv[optind], "mmi_get") )
p_buffer[1] = CMD_MMI_RECV;
} }
if ( sendto( i_fd, p_buffer, i_size, 0, (struct sockaddr *)&sun_server, if ( sendto( i_fd, p_buffer, i_size, 0, (struct sockaddr *)&sun_server,
......
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