我正在做一个小的短信接收实用程序,我有一条短信,我无法理解如何解码其发送方ID,这是在PDU模式下读取消息的输出:
+ CMGL:0,1 ,, 86 0791021197003899440ED0657A7A1E6687E93408610192016390004205000365030106440642062F002006270633062A064706440643062A0020064306440020062706440648062D062F0627062A0020062706440645062C06270646064A
并以文字模式:
+ CMGL:0," REC READ"," 1011161051159710897116" ,," 16/10 / 29,10:36:09 + 00" 06440642062F002006270633062A064706440643062A0020064306440020062706440648062D062F0627062A0020062706440645062C06270646064A
我通过手机阅读此消息,我发现发件人的字母数字代码" 1011161051159710897116"等于" etisalat"这是服务提供商的名称,我想了解他们使用的编码。以及如何解码它?
答案 0 :(得分:2)
它被编码为ASCII作为十进制半八位字节:
1011161051159710897116 =
101 =& 65 = e
116 =& 74 = t
105 =& 69 = i
115 =& 73 = s
97 =& 61 = a
108 =& 6C = 1
97 =& 61 = a
116 =& 74 = t
要从PDU数据中读取此信息,您必须交换半字节,如果长度为奇数,则必须添加额外的“F”以使其获得正确的八位字符串。
可以在此处找到SMS PDU的规格:GSM 03.40