aboutsummaryrefslogtreecommitdiffstats
path: root/src/qmicli/qmicli.c
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@lanedo.com>2013-12-12 10:40:37 -0800
committerAleksander Morgado <aleksander@lanedo.com>2013-12-13 09:13:01 +0100
commit2eaaea2d73ec6eb9e4a3ae284eb895b838c1e306 (patch)
treea59125242272d14f1c3b3b141383279b3c865858 /src/qmicli/qmicli.c
parentaf873f4041c29251df19216cc9411e6b3c0a783d (diff)
qmicli: add '--device-open-net' option
The device-open-net cmdline option allows you to specify network-mode and/or qos-header mode flags when opening the device. This has been found to be necessary on some cards/modes such as the MC7750 in LTE mode. Based on an original patch from: Tim Harvey <tharvey@gateworks.com>
Diffstat (limited to 'src/qmicli/qmicli.c')
-rw-r--r--src/qmicli/qmicli.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/qmicli/qmicli.c b/src/qmicli/qmicli.c
index dc63c41..949a4a0 100644
--- a/src/qmicli/qmicli.c
+++ b/src/qmicli/qmicli.c
@@ -32,6 +32,7 @@
#include <libqmi-glib.h>
#include "qmicli.h"
+#include "qmicli-helpers.h"
#define PROGRAM_NAME "qmicli"
#define PROGRAM_VERSION PACKAGE_VERSION
@@ -50,6 +51,7 @@ static gboolean get_service_version_info_flag;
static gchar *device_set_instance_id_str;
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 gchar *client_cid_str;
static gboolean client_no_release_cid_flag;
@@ -82,6 +84,10 @@ static GOptionEntry main_entries[] = {
"Request to use the 'qmi-proxy' proxy",
NULL
},
+ { "device-open-net", 0, 0, G_OPTION_ARG_STRING, &device_open_net_str,
+ "Open device with specific link protocol and QoS flags",
+ "[net-802-3|net-raw-ip|net-qos-header|net-no-qos-header]"
+ },
{ "client-cid", 0, 0, G_OPTION_ARG_STRING, &client_cid_str,
"Use the given CID, don't allocate a new one",
"[CID]"
@@ -481,6 +487,9 @@ device_new_ready (GObject *unused,
open_flags |= QMI_DEVICE_OPEN_FLAGS_SYNC;
if (device_open_proxy_flag)
open_flags |= QMI_DEVICE_OPEN_FLAGS_PROXY;
+ if (device_open_net_str)
+ if (!qmicli_read_net_open_flags_from_string (device_open_net_str, &open_flags))
+ exit (EXIT_FAILURE);
/* Open the device */
qmi_device_open (device,