diff options
-rw-r--r-- | src/qmicli/qmicli.c | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/qmicli/qmicli.c b/src/qmicli/qmicli.c index a2a5560..e119a96 100644 --- a/src/qmicli/qmicli.c +++ b/src/qmicli/qmicli.c @@ -61,7 +61,9 @@ static gboolean device_open_version_info_flag; static gboolean device_open_sync_flag; static gchar *device_open_net_str; static gboolean device_open_proxy_flag; +static gboolean device_open_qmi_flag; static gboolean device_open_mbim_flag; +static gboolean device_open_auto_flag; static gchar *client_cid_str; static gboolean client_no_release_cid_flag; static gboolean verbose_flag; @@ -105,8 +107,16 @@ static GOptionEntry main_entries[] = { "Request to use the 'qmi-proxy' proxy", NULL }, + { "device-open-qmi", 0, 0, G_OPTION_ARG_NONE, &device_open_qmi_flag, + "Open a cdc-wdm device explicitly in QMI mode", + NULL + }, { "device-open-mbim", 0, 0, G_OPTION_ARG_NONE, &device_open_mbim_flag, - "Open an MBIM device with EXT_QMUX support", + "Open a cdc-wdm device explicitly in MBIM mode", + NULL + }, + { "device-open-auto", 0, 0, G_OPTION_ARG_NONE, &device_open_auto_flag, + "Open a cdc-wdm device in either QMI or MBIM mode (default)", NULL }, { "device-open-net", 0, 0, G_OPTION_ARG_STRING, &device_open_net_str, @@ -610,6 +620,11 @@ device_new_ready (GObject *unused, exit (EXIT_FAILURE); } + if (device_open_mbim_flag + device_open_qmi_flag + device_open_auto_flag > 1) { + g_printerr ("error: cannot specify multiple mode flags to open device\n"); + exit (EXIT_FAILURE); + } + /* Setup device open flags */ if (device_open_version_info_flag) open_flags |= QMI_DEVICE_OPEN_FLAGS_VERSION_INFO; @@ -619,6 +634,8 @@ device_new_ready (GObject *unused, open_flags |= QMI_DEVICE_OPEN_FLAGS_PROXY; if (device_open_mbim_flag) open_flags |= QMI_DEVICE_OPEN_FLAGS_MBIM; + if (device_open_auto_flag || (!device_open_qmi_flag && !device_open_mbim_flag)) + open_flags |= QMI_DEVICE_OPEN_FLAGS_AUTO; if (device_open_net_str) if (!qmicli_read_net_open_flags_from_string (device_open_net_str, &open_flags)) exit (EXIT_FAILURE); |