#define MAX_STRING_LEN 2048
#define NOT_AVAIL "N/A";
+#define MAX_CMD_LEN 4
enum {
CURRENT_STATUS_MAINMENU,
void _interpret_main_menu(char *cmd)
{
- if (strncmp(cmd, "gx", 2) == 0)
+ if (strncmp(cmd, "gx", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_MAX_VOLUME;
- else if (strncmp(cmd, "sv", 2) == 0)
+ else if (strncmp(cmd, "sv", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_VOLUME;
- else if (strncmp(cmd, "gv", 2) == 0)
+ else if (strncmp(cmd, "gv", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_VOLUME;
- else if (strncmp(cmd, "gt", 2) == 0)
+ else if (strncmp(cmd, "gt", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_CURRENT_SOUND_TYPE;
- else if (strncmp(cmd, "av", 2) == 0)
+ else if (strncmp(cmd, "av", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ADD_VOLUME_CHANGED_CB;
- else if (strncmp(cmd, "rv", 2) == 0)
+ else if (strncmp(cmd, "rv", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_VOLUME_CHANGED_CB;
- else if (strncmp(cmd, "sm", 2) == 0)
+ else if (strncmp(cmd, "sm", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_MUTE;
- else if (strncmp(cmd, "gm", 2) == 0)
+ else if (strncmp(cmd, "gm", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_MUTE;
- else if (strncmp(cmd, "sk", 2) == 0)
+ else if (strncmp(cmd, "sk", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_DEVICE_MASK;
- else if (strncmp(cmd, "gk", 2) == 0)
+ else if (strncmp(cmd, "gk", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_MASK;
- else if (strncmp(cmd, "gl", 2) == 0)
+ else if (strncmp(cmd, "gl", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_LIST;
- else if (strncmp(cmd, "pl", 2) == 0)
+ else if (strncmp(cmd, "pl", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_PRINT_DEVICE_LIST;
- else if (strncmp(cmd, "fl", 2) == 0)
+ else if (strncmp(cmd, "fl", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_FREE_DEVICE_LIST;
- else if (strncmp(cmd, "gn", 2) == 0)
+ else if (strncmp(cmd, "gn", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_NEXT;
- else if (strncmp(cmd, "gp", 2) == 0)
+ else if (strncmp(cmd, "gp", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_PREV;
- else if (strncmp(cmd, "gd", 2) == 0)
+ else if (strncmp(cmd, "gd", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_DEVICE_STATE_BY_ID;
- else if (strncmp(cmd, "gssf", 4) == 0)
+ else if (strncmp(cmd, "gssf", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_SUPPORTED_SAMPLE_FORMATS;
- else if (strncmp(cmd, "ssf", 3) == 0)
+ else if (strncmp(cmd, "ssf", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_SAMPLE_FORMAT;
- else if (strncmp(cmd, "gsf", 3) == 0)
+ else if (strncmp(cmd, "gsf", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_SAMPLE_FORMAT;
- else if (strncmp(cmd, "gssr", 4) == 0)
+ else if (strncmp(cmd, "gssr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_SUPPORTED_SAMPLE_RATES;
- else if (strncmp(cmd, "ssr", 3) == 0)
+ else if (strncmp(cmd, "ssr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_SAMPLE_RATE;
- else if (strncmp(cmd, "gsr", 3) == 0)
+ else if (strncmp(cmd, "gsr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_SAMPLE_RATE;
- else if (strncmp(cmd, "sar", 3) == 0)
+ else if (strncmp(cmd, "sar", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_AVOID_RESAMPLING;
- else if (strncmp(cmd, "gar", 3) == 0)
+ else if (strncmp(cmd, "gar", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_AVOID_RESAMPLING;
- else if (strncmp(cmd, "sms", 3) == 0)
+ else if (strncmp(cmd, "sms", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_MEDIA_STREAM_ONLY;
- else if (strncmp(cmd, "gms", 3) == 0)
+ else if (strncmp(cmd, "gms", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_MEDIA_STREAM_ONLY;
- else if (strncmp(cmd, "adcc", 4) == 0)
+ else if (strncmp(cmd, "adcc", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ADD_DEVICE_CONNECTION_CHANGED_CB;
- else if (strncmp(cmd, "rdcc", 4) == 0)
+ else if (strncmp(cmd, "rdcc", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_DEVICE_CONNECTION_CHANGED_CB;
- else if (strncmp(cmd, "adrc", 4) == 0)
+ else if (strncmp(cmd, "adrc", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ADD_DEVICE_RUNNING_CHANGED_CB;
- else if (strncmp(cmd, "rdrc", 4) == 0)
+ else if (strncmp(cmd, "rdrc", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_DEVICE_RUNNING_CHANGED_CB;
- else if (strncmp(cmd, "csi", 3) == 0)
+ else if (strncmp(cmd, "csi", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_CREATE_STREAM_INFO;
- else if (strncmp(cmd, "ads", 3) == 0)
+ else if (strncmp(cmd, "ads", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ADD_DEVICE_FOR_STREAM_ROUTING;
- else if (strncmp(cmd, "rds", 3) == 0)
+ else if (strncmp(cmd, "rds", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_DEVICE_FOR_STREAM_ROUTING;
- else if (strncmp(cmd, "rad", 3) == 0)
+ else if (strncmp(cmd, "rad", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_ALL_DEVICES_FOR_STREAM_ROUTING;
- else if (strncmp(cmd, "adi", 3) == 0)
+ else if (strncmp(cmd, "adi", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ADD_DEVICE_ID_FOR_STREAM_ROUTING;
- else if (strncmp(cmd, "rdi", 3) == 0)
+ else if (strncmp(cmd, "rdi", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_DEVICE_ID_FOR_STREAM_ROUTING;
- else if (strncmp(cmd, "aps", 3) == 0)
+ else if (strncmp(cmd, "aps", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_APPLY_STREAM_ROUTING;
- else if (strncmp(cmd, "sso", 3) == 0)
+ else if (strncmp(cmd, "sso", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_STREAM_ROUTING_OPTION;
- else if (strncmp(cmd, "afc", 3) == 0)
+ else if (strncmp(cmd, "afc", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ACQUIRE_FOCUS;
- else if (strncmp(cmd, "rfc", 3) == 0)
+ else if (strncmp(cmd, "rfc", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_RELEASE_FOCUS;
- else if (strncmp(cmd, "afa", 3) == 0)
+ else if (strncmp(cmd, "afa", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ACQUIRE_FOCUS_ALL;
- else if (strncmp(cmd, "rfa", 3) == 0)
+ else if (strncmp(cmd, "rfa", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_RELEASE_FOCUS_ALL;
- else if (strncmp(cmd, "gfs", 3) == 0)
+ else if (strncmp(cmd, "gfs", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_ACQUIRED_FOCUS;
- else if (strncmp(cmd, "gst", 3) == 0)
+ else if (strncmp(cmd, "gst", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_SOUND_TYPE;
- else if (strncmp(cmd, "dfc", 3) == 0)
+ else if (strncmp(cmd, "dfc", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_DELIVER_FOCUS;
- else if (strncmp(cmd, "afw", 3) == 0)
+ else if (strncmp(cmd, "afw", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_ADD_FOCUS_WATCH_CB;
- else if (strncmp(cmd, "rfw", 3) == 0)
+ else if (strncmp(cmd, "rfw", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_REMOVE_FOCUS_WATCH_CB;
- else if (strncmp(cmd, "sfr", 3) == 0)
+ else if (strncmp(cmd, "sfr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_FOCUS_REACQUISITION;
- else if (strncmp(cmd, "gfr", 3) == 0)
+ else if (strncmp(cmd, "gfr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_FOCUS_REACQUISITION;
- else if (strncmp(cmd, "grp", 3) == 0)
+ else if (strncmp(cmd, "grp", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_REASON_FOR_P_FOCUS;
- else if (strncmp(cmd, "grr", 3) == 0)
+ else if (strncmp(cmd, "grr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_REASON_FOR_R_FOCUS;
- else if (strncmp(cmd, "gmp", 3) == 0)
+ else if (strncmp(cmd, "gmp", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_CURRENT_MEDIA_PLAYBACK_DEVICE_TYPE;
- else if (strncmp(cmd, "dsi", 3) == 0)
+ else if (strncmp(cmd, "dsi", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_DESTROY_STREAM_INFO;
- else if (strncmp(cmd, "vcr", 3) == 0)
+ else if (strncmp(cmd, "vcr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_CREATE_VIRTUAL_STREAM;
- else if (strncmp(cmd, "vsr", 3) == 0)
+ else if (strncmp(cmd, "vsr", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_START_VIRTUAL_STREAM;
- else if (strncmp(cmd, "vst", 3) == 0)
+ else if (strncmp(cmd, "vst", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_STOP_VIRTUAL_STREAM;
- else if (strncmp(cmd, "vdt", 3) == 0)
+ else if (strncmp(cmd, "vdt", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_DESTROY_VIRTUAL_STREAM;
- else if (strncmp(cmd, "sft", 3) == 0)
+ else if (strncmp(cmd, "sft", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_FILTER;
- else if (strncmp(cmd, "sfp", 3) == 0)
+ else if (strncmp(cmd, "sfp", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_FILTER_PRESET;
- else if (strncmp(cmd, "uft", 3) == 0)
+ else if (strncmp(cmd, "uft", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_UNSET_FILTER;
- else if (strncmp(cmd, "isd", 3) == 0)
+ else if (strncmp(cmd, "isd", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_IS_STREAM_ON_DEVICE_BY_ID;
#ifndef TIZEN_FEATURE_TV_PROD
- else if (strncmp(cmd, "mgx", 3) == 0)
+ else if (strncmp(cmd, "mgx", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_MAX_MASTER_VOLUME;
- else if (strncmp(cmd, "msv", 3) == 0)
+ else if (strncmp(cmd, "msv", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_SET_MASTER_VOLUME;
- else if (strncmp(cmd, "mgv", 3) == 0)
+ else if (strncmp(cmd, "mgv", MAX_CMD_LEN) == 0)
g_menu_state = CURRENT_STATUS_GET_MASTER_VOLUME;
#endif
- else if (strncmp(cmd, "q", 3) == 0) {
+ else if (strncmp(cmd, "q", MAX_CMD_LEN) == 0) {
g_print("closing the test suite\n");
quit_program();
} else