Pregunta

I want to Decode PDU Text Retrieved from GSM Modem in C#, How can I decode it with GSMComm or PduBitPacker?

Please answer me with a code

TY

(P.S. I have encoded text and I do not need to get it from Modem)

¿Fue útil?

Solución

Make sure you include PDUConverter.dll in your project.

IncomingSmsPdu sms = IncomingSmsPdu.Decode("0791893905004100640C9189398978168400003160915151238110050003110202C26735B94D87DF41", true);

Console.WriteLine(sms.UserDataText);

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.

Inside of UserDataText you will find the SMS text.

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.

The class GsmComm.PduConverter.SmartMessaging.SmartMessageDecoder could be of help if you want to deal with this smart messaging thing.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top