Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

SMS PDU to ASCII

160 views
Skip to first unread message

Cristian A. Petersen

unread,
Apr 26, 2009, 9:45:55 PM4/26/09
to
Hello,

I am in need of the script to convert from PDU to ASCII. If anyone could
help I would be very gratefull.

TIA,
Cristian Petersen

Jeremy Lakeman

unread,
Apr 26, 2009, 10:15:10 PM4/26/09
to
On Apr 27, 11:45 am, "Cristian A. Petersen"

So you have this format?
http://www.dreamfabric.com/sms/

As a binary blob or a hex string?

Cristian A. Petersen

unread,
Apr 26, 2009, 11:59:19 PM4/26/09
to
Jeremy,

As an Hex String. like this:
0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700


"Jeremy Lakeman" <jeremy....@gmail.com> escribi� en el mensaje
news:9f75def8-acc3-4adc...@r31g2000prh.googlegroups.com...

Jeremy Lakeman

unread,
Apr 27, 2009, 12:21:25 AM4/27/09
to
On Apr 27, 1:59 pm, "Cristian A. Petersen"

<peterse...@petersen.com.py> wrote:
> Jeremy,
>
>         As an Hex String. like this:
> 0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700
>
> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribió en el mensajenews:9f75def8-acc3-4adc...@r31g2000prh.googlegroups.com...

> On Apr 27, 11:45 am, "Cristian A. Petersen"
>
> <peterse...@petersen.com.py> wrote:
> > Hello,
>
> > I am in need of the script to convert from PDU to ASCII. If anyone could
> > help I would be very gratefull.
>
> > TIA,
> > Cristian Petersen
>
> So you have this format?http://www.dreamfabric.com/sms/

>
> As a binary blob or a hex string?

Nasty.

well you can start by converting each character into a numeric value;

string ls_digits='0123456789ABCDEF'
char lca_message[]
long ll_i
integer li_value
for ll_i = lowerbound(lca_message) to upperbound(lca_message)
li_value = pos(ls_digits,lca_message[ll_i]) -1)
...
next

but the rest of what you'll need to do looks nasty.
You might be better off finding / compiling a C or activex object to
do the work for you. Or to translate the algorythm from.

eg;
http://www.sourcecodeonline.com/details/pduconv_c_functions_for_converting_between_ascii_and_pdu.html

Cristian A. Petersen

unread,
Apr 27, 2009, 12:43:05 AM4/27/09
to
thank you Jeremy I already searched trhough the net. Found in Delphi, c##,
VB but nothing in PB . I already did the first part but then I have bit
shifting (PB lacks of it)


"Jeremy Lakeman" <jeremy....@gmail.com> escribi� en el mensaje

news:c972dae7-3ef7-4912...@z23g2000prd.googlegroups.com...


On Apr 27, 1:59 pm, "Cristian A. Petersen"
<peterse...@petersen.com.py> wrote:
> Jeremy,
>
> As an Hex String. like this:
> 0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700
>

> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribi� en el

Jeremy Lakeman

unread,
Apr 28, 2009, 8:04:16 PM4/28/09
to
Well you can test each bit like this;

li_bit=1
do while li_value>0
if mod(li_value,li_bit*2)>0 then
li_value -= li_bit
...
end if
li_bit *= 2
loop

then you could build a string of '1's and '0's and manipulate the
string.

But still I would recommend a different solution.

On Apr 27, 2:43 pm, "Cristian A. Petersen"


<peterse...@petersen.com.py> wrote:
> thank you Jeremy I already searched trhough the net. Found in Delphi, c##,
> VB but nothing in PB . I already did the first part but then I have bit
> shifting (PB lacks of it)
>

> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribió en el mensajenews:c972dae7-3ef7-4912...@z23g2000prd.googlegroups.com...


> On Apr 27, 1:59 pm, "Cristian A. Petersen"
>
>
>
> <peterse...@petersen.com.py> wrote:
> > Jeremy,
>
> > As an Hex String. like this:
> > 0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700
>

> > "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribió en el


> > mensajenews:9f75def8-acc3-4adc...@r31g2000prh.googlegroups.com...
> > On Apr 27, 11:45 am, "Cristian A. Petersen"
>
> > <peterse...@petersen.com.py> wrote:
> > > Hello,
>
> > > I am in need of the script to convert from PDU to ASCII. If anyone could
> > > help I would be very gratefull.
>
> > > TIA,
> > > Cristian Petersen
>
> > So you have this format?http://www.dreamfabric.com/sms/
>
> > As a binary blob or a hex string?
>
> Nasty.
>
> well you can start by converting each character into a numeric value;
>
> string ls_digits='0123456789ABCDEF'
> char lca_message[]
> long ll_i
> integer li_value
> for ll_i = lowerbound(lca_message) to upperbound(lca_message)
>    li_value = pos(ls_digits,lca_message[ll_i]) -1)
>    ...
> next
>
> but the rest of what you'll need to do looks nasty.
> You might be better off finding / compiling a C or activex object to
> do the work for you. Or to translate the algorythm from.
>

> eg;http://www.sourcecodeonline.com/details/pduconv_c_functions_for_conve...

Pietje Puk

unread,
May 7, 2009, 3:59:17 PM5/7/09
to
A long time ago I build some sort of UUEncoder in PB 6. I needed that to
get some binaries mailed through a nast firewall ;-)

For that I also had to do bitshifting.

It worked, but believe me: IT IS SLOW!!!

Powerbuilder is NOT the right tool for this job. Try driving a nail into
wood with a screwdriver. It will work but it's not going to be fast...

Jeremy Lakeman schreef:


> Well you can test each bit like this;
>
> li_bit=1
> do while li_value>0
> if mod(li_value,li_bit*2)>0 then
> li_value -= li_bit
> ...
> end if
> li_bit *= 2
> loop
>
> then you could build a string of '1's and '0's and manipulate the
> string.
>
> But still I would recommend a different solution.
>
> On Apr 27, 2:43 pm, "Cristian A. Petersen"
> <peterse...@petersen.com.py> wrote:
>> thank you Jeremy I already searched trhough the net. Found in Delphi, c##,
>> VB but nothing in PB . I already did the first part but then I have bit
>> shifting (PB lacks of it)
>>

>> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribi� en el mensajenews:c972dae7-3ef7-4912...@z23g2000prd.googlegroups.com...


>> On Apr 27, 1:59 pm, "Cristian A. Petersen"
>>
>>
>>
>> <peterse...@petersen.com.py> wrote:
>>> Jeremy,
>>> As an Hex String. like this:
>>> 0011000A81990589160950000AA0F54747A0E4ACF416110BD3CA78700

>>> "Jeremy Lakeman" <jeremy.lake...@gmail.com> escribi� en el

0 new messages