|
void SMS7bitUnpack( unsigned char *hexSMS, short length )
{
short i;
unsigned char *strSMS = hexSMS + 27;
unsigned short acc = 0, byte, nbits = 0, accIndex = 0;
for( i = 0; i < length; i++ )
{
if( nbits < 7 )
{
byte = strSMS[accIndex];
byte <<= nbits;
acc |= byte;
accIndex ++;
nbits += 8;
}
hexSMS[i] = (unsigned char)acc & 0x7f;
acc >>= 7;
nbits -=7;
}
hexSMS[i] = 0;
}
E-mail: info@telesys.ru