Solved

Encoding PDUs

Posted on 2004-04-30
6
5,699 Views
Last Modified: 2013-12-09
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
0
Comment
Question by:SteffenM
  • 2
  • 2
6 Comments
 
LVL 2

Expert Comment

by:anupvijay
ID: 10960260
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.
0
 

Author Comment

by:SteffenM
ID: 10962947
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
0
 
LVL 2

Expert Comment

by:anupvijay
ID: 10986967
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.
0
 

Accepted Solution

by:
SteffenM earned 0 total points
ID: 10988232
Hi all!

Finally, I found the solution - which is quite straight ahead: the function getPDU returns a "packed PDU", one byte contains 2 Hex-Characters. Before sending the string to the GSM modem, I have to split every byte in two Hex-Characters (simply using a bitmask).
The java code already provides a function "toHexString" doing this.

The code still misses the SMSC header information, so you have to put "00" in front of the String returned by toHexString ("00" stands for using the SMSC saved on the SIM card). Then it works fine.

Thank you for your help and sorry for having wasted your time,

Steffen
0
 

Expert Comment

by:kennetand
ID: 11411863
can some ine port this code for encode SMS-PDU to C# ? Or know some other encode SMS-PDU code in C#
0

Featured Post

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
D-link DWL-2600AP - Guest network 1 72
Create remote access home server 4 108
WAP requirements 5 68
CCNA WiFi Question 2 46
In this article we have discussed about the OS X EI Capitan and how to fix Wi-Fi issue in OS X El Capitan. We have explained how to delete system level preferences and create a new Wi-Fi location to resolve Wi-Fi issue.
Using in-flight Wi-Fi when you travel? Business travelers beware! In-flight Wi-Fi networks could rip the door right off your digital privacy portal. That’s no joke either, as it might also provide a convenient entrance for bad threat actors.
This Micro Tutorial will show you how to maximize your wireless card to its maximum capability. This will be demonstrated using Intel(R) Centrino(R) Wireless-N 2230 wireless card on Windows 8 operating system.
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…

766 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question