How ro Pack 7bit ASCII to 8 bit Format?

Thread Starter

devjeetmandal

Joined May 7, 2017
48
I was working with GSM module. And receiving messages in PDU mode.

suppose the data is "hello" : 68 65 6C 6C 6F(in hex) but in PDU mode "hello" : E8 32 9B FD 6C(7 bit packed format)

First i tried to convert "hello" to hex where i am taking a string and

string[1]=6
string[2]=8
string[3]=6
string[4]=5
string[5]=6
string[6]= C
string[7]=6
string[8]= Cstring[9]=6
string[10]= F
hex codes for "hello" is saved like this.

I want to convert it like this

string[1]= E
string[2]=8
string[3]=3
string[4]=2
string[5]=9
string[6]= Bstring[7]= Fstring[8]= Dstring[9]=6
string[10]= C
i understand the theory but having difficulty in coding. Any help will be Helpful Thanks in advance.
 

philba

Joined Aug 17, 2017
959
Try writing out the packed values as a series of bits.Then see if you can find the unpacked value and draw boxes around them, Maybe that will give you some ideas.
 
Top