将文本转换为 PDU 格式
Convert text into PDU format
我正在开发一个类似于消息服务器的东西,它支持 PDU 格式(使用 android phone)来发送消息。我使用在线编码器来转换我的文本,但我不知道将文本转换为 PDU 格式的真正步骤,我不认为它只是一个十六进制数。
我使用 at 命令从超级终端发送消息。
有人可以帮忙吗?
我使用了 AT 命令:
at
at+cmgf=0
at+cmgs=25 (Length i guess)
>"encoded message"
AT+CMGS
命令在3GPP 25.005 standard中定义,对于PDU模式,其语法为
+CMGS=<length><CR>
PDU is given<ctrl-Z/ESC>
并在说明中进一步说明
the PDU shall be hexadecimal format (similarly as specified for <pdu>
)
and given in one line; ME/TA converts this coding into the actual
octets of PDU.
<pdu>
格式在第 3.1 章参数定义的 消息数据参数 中定义:
In the case of SMS: 3GPP TS 24.011 [6] SC address followed by
3GPP TS 23.040 [3] TPDU in hexadecimal format: ME/TA converts each
octet of TP data unit into two IRA character long hexadecimal number
(e.g. octet with integer value 42 is presented to TE as two characters
2A (IRA 50 and 65))
(SC 是服务中心的缩写)
所有的乐趣都从这里开始,因为您现在必须非常、非常、非常深入地挖掘其他规范以发现实际格式...
例如 24.011 描述了移动设备和网络之间发送的消息的低级数据格式,其中只有一部分与此上下文相关。
7.3.1.2 RP‑DATA (Mobile Station to Network) This message is sent in MS ‑> MSC direction. The message is used to relay the TPDUs. The
information elements are in line with 3GPP TS 23.040.
在给定的 table 中,最后两行是相关部分,服务中心地址和 TPDU。
Information element, Reference, Presence, Format, Length
RP‑Message Type, Subclause 8.2.2, M, V, 3 bits
RP‑Message Reference, Subclause 8.2.3, M, V, 1 octet
RP‑Originator Address, Subclause 8.2.5.1, M, LV, 1 octet
RP‑Destination Address, Subclause 8.2.5.2, M, LV, 1‑12 octets
RP‑User Data, Subclause 8.2.5.3, M, LV, <= 233 octets
为了进一步挖掘,我一直在试图找出 RP‑Destination Address number IEI 的值,我已经花了很长时间来写这个答案。抱歉停在这里。实际的phone号码编码是"normal"被叫BCD号码编码(24.008中的10.5.4.7),TON+NPI与AT+CPBW
中的<type>
参数相同实例。文本编码本身就是一个完整的故事...
试图破译部分 3GPP 规范有时真的很困难,而且误解的可能性几乎无穷无尽!如果您真的打算为此开发自己的代码,那么开始阅读良好的 PDU 模式介绍可能会更好
http://mobiletidings.com/2009/02/11/more-on-the-sms-pdu/1。
或者在已经存在的 library/program 中查找处理 PDU 模式 2.
的代码
1
请注意,如果文本不包含对 3GPP 标准中的 detailed/technical 术语的引用,那么高质量的文章相差甚远,这通常是低质量指标。
2
再一次,努力寻找好的质量。
我正在开发一个类似于消息服务器的东西,它支持 PDU 格式(使用 android phone)来发送消息。我使用在线编码器来转换我的文本,但我不知道将文本转换为 PDU 格式的真正步骤,我不认为它只是一个十六进制数。
我使用 at 命令从超级终端发送消息。
有人可以帮忙吗?
我使用了 AT 命令:
at
at+cmgf=0
at+cmgs=25 (Length i guess)
>"encoded message"
AT+CMGS
命令在3GPP 25.005 standard中定义,对于PDU模式,其语法为
+CMGS=<length><CR>
PDU is given<ctrl-Z/ESC>
并在说明中进一步说明
the PDU shall be hexadecimal format (similarly as specified for
<pdu>
) and given in one line; ME/TA converts this coding into the actual octets of PDU.
<pdu>
格式在第 3.1 章参数定义的 消息数据参数 中定义:
In the case of SMS: 3GPP TS 24.011 [6] SC address followed by 3GPP TS 23.040 [3] TPDU in hexadecimal format: ME/TA converts each octet of TP data unit into two IRA character long hexadecimal number (e.g. octet with integer value 42 is presented to TE as two characters 2A (IRA 50 and 65))
(SC 是服务中心的缩写)
所有的乐趣都从这里开始,因为您现在必须非常、非常、非常深入地挖掘其他规范以发现实际格式...
例如 24.011 描述了移动设备和网络之间发送的消息的低级数据格式,其中只有一部分与此上下文相关。
7.3.1.2 RP‑DATA (Mobile Station to Network) This message is sent in MS ‑> MSC direction. The message is used to relay the TPDUs. The information elements are in line with 3GPP TS 23.040.
在给定的 table 中,最后两行是相关部分,服务中心地址和 TPDU。
Information element, Reference, Presence, Format, Length
RP‑Message Type, Subclause 8.2.2, M, V, 3 bits
RP‑Message Reference, Subclause 8.2.3, M, V, 1 octet
RP‑Originator Address, Subclause 8.2.5.1, M, LV, 1 octet
RP‑Destination Address, Subclause 8.2.5.2, M, LV, 1‑12 octets
RP‑User Data, Subclause 8.2.5.3, M, LV, <= 233 octets
为了进一步挖掘,我一直在试图找出 RP‑Destination Address number IEI 的值,我已经花了很长时间来写这个答案。抱歉停在这里。实际的phone号码编码是"normal"被叫BCD号码编码(24.008中的10.5.4.7),TON+NPI与AT+CPBW
中的<type>
参数相同实例。文本编码本身就是一个完整的故事...
试图破译部分 3GPP 规范有时真的很困难,而且误解的可能性几乎无穷无尽!如果您真的打算为此开发自己的代码,那么开始阅读良好的 PDU 模式介绍可能会更好 http://mobiletidings.com/2009/02/11/more-on-the-sms-pdu/1。 或者在已经存在的 library/program 中查找处理 PDU 模式 2.
的代码1 请注意,如果文本不包含对 3GPP 标准中的 detailed/technical 术语的引用,那么高质量的文章相差甚远,这通常是低质量指标。
2 再一次,努力寻找好的质量。