From 120306f8b61f03757dd3287a3f9723757f94c833 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Sat, 10 Oct 2015 12:44:00 +0200 Subject: qmicli,wds: allow specifying network data handle in hex E.g. to give the global packet data handle, which is 0xFFFFFFFF. --- src/qmicli/qmicli-wds.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3