diff options
author | Bjørn Mork <bjorn@mork.no> | 2013-02-09 11:40:42 +0100 |
---|---|---|
committer | Bjørn Mork <bjorn@mork.no> | 2013-02-09 11:40:42 +0100 |
commit | 73b160d3d734c899ee18c85270ac71770ffc05f1 (patch) | |
tree | 6efccef58974cb40c753610d9eaa9fc6769f9237 /scripts | |
parent | d168dbb774e16493e86f2ad6b4be5ea1f714769a (diff) |
mbim: decode sms and phonebook indications
Signed-off-by: Bjørn Mork <bjorn@mork.no>
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/mbim.pl | 35 |
1 files changed, 33 insertions, 2 deletions
diff --git a/scripts/mbim.pl b/scripts/mbim.pl index 499c90f..adda8f1 100755 --- a/scripts/mbim.pl +++ b/scripts/mbim.pl @@ -825,10 +825,24 @@ sub decode_ussd { print "USSD CID $cid decoding is not yet supported\n"; } +# Table 10‐113: MBIM_PHONEBOOK_STATE +my %phonebookstate = ( + 0 => 'MBIMPhonebookNotInitialized', + 1 => 'MBIMPhonebookInitialized', + ); sub decode_phonebook { my ($cid, $info) = @_; - print "PHONEBOOK CID $cid decoding is not yet supported\n"; + if ($cid == 1) { # MBIM_CID_PHONEBOOK_CONFIGURATION + my ($state, $total, $used, $maxnumber, $maxname) = unpack("V5", $info); + print " PhonebookState:\t$phonebookstate{$state}\n"; + print " TotalNbrOfEntries:\t$total\n"; + print " UsedEntries:\t$used\n"; + print " MaxNumberLength:\t$maxnumber\n"; + print " MaxNameLength:\t$maxname\n"; + } else { + print "PHONEBOOK CID $cid decoding is not yet supported\n"; + } } sub decode_stk { my ($cid, $info) = @_; @@ -841,11 +855,28 @@ sub decode_auth { print "AUTH CID $cid decoding is not yet supported\n"; } +# Table 10‐77: MBIM_SMS_STORAGE_STATE +my %smsstoragestate = ( + 0 => 'MBIMSmsStorageNotInitialized', + 1 => 'MBIMSmsStorageInitialized', + ); + +# Table 10‐78: MBIM_SMS_FORMAT +my %smsformat = ( + 0 => 'MBIMSmsFormatPdu', + 1 => 'MBIMSmsFormatCdma', +); + sub decode_sms { my ($cid, $info) = @_; if ($cid == 1) { # MBIM_CID_SMS_CONFIGURATION - + my ($storagestate, $format, $max, $cdmasize, $off, $len) = unpack("V6", $info); + print " SmsStorageState:\t$smsstoragestate{$storagestate}\n"; + print " Format:\t$smsformat{$format}\n"; + print " MaxMessages:\t$max\n"; + print " CdmaShortMessageSize:\t$cdmasize\n"; + print " ScAddress:\t", &utf16_field($info, $off, $len), "\n"; } else { print "SMS CID $cid decoding is not yet supported\n"; } |