summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Mork <bjorn@mork.no>2017-01-12 13:39:38 +0100
committerBjørn Mork <bjorn@mork.no>2017-01-12 13:39:38 +0100
commit6298c4d614e53c62203de6252080243a47de0836 (patch)
tree55b48a84c1baae5ae6c4bea44bbf987dcc612825
parent065620d05fd2b9a10342596194ab7a3e6e672edb (diff)
qmi.pl: support offline decoding
Signed-off-by: Bjørn Mork <bjorn@mork.no>
-rwxr-xr-xscripts/qmi.pl21
1 files changed, 20 insertions, 1 deletions
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 <message>
+
+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//;