aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2015-10-10 12:44:00 +0200
committerAleksander Morgado <aleksander@aleksander.es>2015-10-12 14:03:58 +0200
commit120306f8b61f03757dd3287a3f9723757f94c833 (patch)
tree8c19899d3cb2819ce8e4fc01d6aa88752ac2166b /src
parent47d83f020ae3d2f4eddb701860e24bb39e1fb029 (diff)
qmicli,wds: allow specifying network data handle in hex
E.g. to give the global packet data handle, which is 0xFFFFFFFF.
Diffstat (limited to 'src')
-rw-r--r--src/qmicli/qmicli-wds.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/qmicli/qmicli-wds.c b/src/qmicli/qmicli-wds.c
index 5e90b4a..9ea6e1b 100644
--- a/src/qmicli/qmicli-wds.c
+++ b/src/qmicli/qmicli-wds.c
@@ -1282,16 +1282,18 @@ qmicli_wds_run (QmiDevice *device,
if (stop_network_str) {
gulong packet_data_handle;
- packet_data_handle = strtoul (stop_network_str, NULL, 10);
- if (!packet_data_handle ||
- packet_data_handle > G_MAXUINT32) {
+ if (g_str_has_prefix (stop_network_str, "0x"))
+ packet_data_handle = strtoul (stop_network_str, NULL, 16);
+ else
+ packet_data_handle = strtoul (stop_network_str, NULL, 10);
+ if (!packet_data_handle || packet_data_handle > G_MAXUINT32) {
g_printerr ("error: invalid packet data handle given '%s'\n",
stop_network_str);
operation_shutdown (FALSE);
return;
}
- g_debug ("Asynchronously stopping network...");
+ g_debug ("Asynchronously stopping network (%lu)...", packet_data_handle);
internal_stop_network (ctx->cancellable, (guint32)packet_data_handle);
return;
}