如何使用GSMComm或PduBitPacker解码PDU? [英] How can I decode PDU with GSMComm or PduBitPacker?
问题描述
我想解码C#中从GSM调制解调器检索到的PDU文本,如何使用 GSMComm 或 PduBitPacker 对其进行解码?
I want to Decode PDU Text Retrieved from GSM Modem in C#, How can I decode it with GSMComm or PduBitPacker?
请用代码回答我
TY
(PS我已经编码了文字,
(P.S. I have encoded text and I do not need to get it from Modem)
推荐答案
请确保在项目中包含PDUConverter.dll。
Make sure you include PDUConverter.dll in your project.
IncomingSmsPdu sms = IncomingSmsPdu.Decode("0791893905004100640C9189398978168400003160915151238110050003110202C26735B94D87DF41", true);
Console.WriteLine(sms.UserDataText);
Decode的第一个参数是您的RAW PDU字符串,包括结尾的标头,第二个参数是
The first argument of Decode is your RAW PDU string including header at the end, the second argument is a flag telling the decoder that a header is present.
在UserDataText内部,您会找到SMS文本。
Inside of UserDataText you will find the SMS text.
如果您在一开始看到陌生的字符,那是因为您有一个智能消息,即应该分为多条短信的多部分SMS,这是诺基亚发明的一种技巧。
If you see estrange characters at the beginning, it is because you have a "Smart Message", that is, a multi-part SMS that should be concatenated into a single large message, this is a trick invented by Nokia.
如果您想处理这种智能消息传递类,则 GsmComm.PduConverter.SmartMessaging.SmartMessageDecoder 类可能会有所帮助。
The class GsmComm.PduConverter.SmartMessaging.SmartMessageDecoder could be of help if you want to deal with this smart messaging thing.
这篇关于如何使用GSMComm或PduBitPacker解码PDU?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!