From 6298c4d614e53c62203de6252080243a47de0836 Mon Sep 17 00:00:00 2001 From: Bjørn Mork Date: Thu, 12 Jan 2017 13:39:38 +0100 Subject: qmi.pl: support offline decoding MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Bjørn Mork --- scripts/qmi.pl | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/scripts/qmi.pl b/scripts/qmi.pl index 655e7ea..7fbdfff 100755 --- a/scripts/qmi.pl +++ b/scripts/qmi.pl @@ -1527,6 +1527,17 @@ Command aliases and expected arguments (no encoding): gstatus - Sierra Wireless specific, system is forced to NAS + + +Or for offline decoding only: + + $0 [--[no]debug] offline + +Example: + + $0 offline 01:0f:00:00:00:00:00:01:22:00:04:00:01:01:00:02 + + EOH ; &release_cids; @@ -1585,8 +1596,16 @@ GetOptions( # the rest of the command line is left for the actual command to run +# special handling of 'offline' +if ($ARGV[0] eq 'offline') { + shift; + my $qmi_in = &decode_qmi(pack("C*", map { hex } split(/:/, join(':', @ARGV)))); + &pretty_print_qmi($qmi_in); + exit; +} + # network device is required -&usage unless $netdev; + &usage unless $netdev; # postprocess family $family =~ s/^inet//; -- cgit v1.2.3