Link to home
Start Free TrialLog in
Avatar of SteffenM
SteffenM

asked on

Encoding PDUs

Hey, I have got a Java Class that should de- and encode PDUs for SMS translation. You can find it here:

http://www.wrankl.de/SMST/SMSTools.html

in this code you can find the JAVA Class to de- encode SMS-PDU

it is called SMSTransreceiver.

Decoding is no Problem, but Id like to know how to encode a PDU with this code. When I call the Methode GetPDU, it only returns an Array of Bytes, but no PDU String, does anybody know how to generate the PDU with this Byte-array?


Thx and greetings

Steffen Müller
Avatar of anupvijay
anupvijay
Flag of United Kingdom of Great Britain and Northern Ireland image

Hi Steffen,
I was going thru the code and it looks okay to me. The statement writeln("AT+CMGF=0"); sets the SMS AT commands
into PDU mode and there the    result of getPDU is written to the serial port using write(SMSTools.toHexString(pdu));

It looks fine to me. What kind of problem are you facing here ?

Cheers.
Avatar of SteffenM
SteffenM

ASKER

Hi anupvijay,

The problem we've encountered is not the communication with the hardware, our problem is the encoding of a pdu for being sent. The java program mentioned above does not seem to create correct PDUs (which seems quite strange, please correct me if I'm wrong) or, what is more likely, I'm not able to use the PDUs the program outputs.
The method getPDU returns an array of bytes (which seem to be signed values in java) and I'm not able to figure out what to do with this array.

Anyway, we're just trying to create a working PDU encoder in Delphi and tried to use the java encoder mentioned above as a blueprint. We're not fixed on the java encoder, if you have any other ideas that could help us, these are also highly appreciated.

Thank you all for your help!

Steffen
Hi Steffenm,

It is possible that the PDU might be a corrupted one.

I am sorry.I do not have a JVM on my machine where I coudl actually execute the code and see what is being sent.
Please let me know if you find a solution. Would help others too.

Cheers.
ASKER CERTIFIED SOLUTION
Avatar of SteffenM
SteffenM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
can some ine port this code for encode SMS-PDU to C# ? Or know some other encode SMS-PDU code in C#