diff options
author | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-17 08:31:21 +0000 |
---|---|---|
committer | laforge <laforge@99fdad57-331a-0410-800a-d7fa5415bdb3> | 2007-08-17 08:31:21 +0000 |
commit | be174b78167bf9f2b77901b4b318606144a5ae58 (patch) | |
tree | b3f517006fd9772f088c989eff7f5513bf100743 /src/libgsmd | |
parent | 90bf3b4473da30d8b89c8ecfabcce42c0e4fe484 (diff) |
From: Andrzej Zaborowski <balrog@zabor.org>
Date: Fri, 27 Jul 2007 19:39:15 +0200
Subject: [PATCH] Cell Broadcast message decoding and presentation in libgsmd-tool.
This time Cell Broadcast is tested to work, I should have made tests earlier.
Now I'm correctly getting a CB message with the human readable name of the city
and district when I'm connecting. In the previous patches the CB PDU was not
being decoded at all.
git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@2723 99fdad57-331a-0410-800a-d7fa5415bdb3
Diffstat (limited to 'src/libgsmd')
-rw-r--r-- | src/libgsmd/libgsmd_sms.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/libgsmd/libgsmd_sms.c b/src/libgsmd/libgsmd_sms.c index 72723c0..22d7dbf 100644 --- a/src/libgsmd/libgsmd_sms.c +++ b/src/libgsmd/libgsmd_sms.c @@ -283,6 +283,20 @@ int unpacking_7bit_character(const struct gsmd_sms *src, char *dest) return i; } +int cbm_unpacking_7bit_character(const char *src, char *dest) +{ + int i; + u_int8_t ch = 1; + + for (i = 0; i < 93 && ch; i ++) + *(dest ++) = ch = + ((src[(i * 7 + 7) >> 3] << (7 - ((i * 7 + 7) & 7))) | + (src[(i * 7) >> 3] >> ((i * 7) & 7))) & 0x7f; + *dest = '\0'; + + return i; +} + /* Refer to 3GPP TS 11.11 Annex B */ int packing_UCS2_80(char *src, char *dest) { |