* [PATCH] stkutil: mask the DCS value to keep only the intersting bits
@ 2010-11-15 14:17 Lucas, GuillaumeX
2010-11-17 14:13 ` Denis Kenzior
0 siblings, 1 reply; 5+ messages in thread
From: Lucas, GuillaumeX @ 2010-11-15 14:17 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1224 bytes --]
From: Guillaume Lucas <guillaumex.lucas@intel.com>
For SIM tool kit only the bits 2 and 3 are interesting
for the DCS value. The others ones sould be masked. The
masking is necessary because some SIM car set the
upper bits to 1.
---
src/stkutil.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/src/stkutil.c b/src/stkutil.c
index cdd66bd..a54dd02 100644
--- a/src/stkutil.c
+++ b/src/stkutil.c
@@ -78,7 +78,7 @@ static char *decode_text(unsigned char dcs, int len, const unsigned char *data)
{
char *utf8;
- switch (dcs) {
+ switch (dcs & 0x06) {
case 0x00:
{
long written;
--
1.7.0.4
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] stkutil: mask the DCS value to keep only the intersting bits
2010-11-15 14:17 [PATCH] stkutil: mask the DCS value to keep only the intersting bits Lucas, GuillaumeX
@ 2010-11-17 14:13 ` Denis Kenzior
2010-11-18 8:54 ` Lucas, GuillaumeX
0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2010-11-17 14:13 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1011 bytes --]
Hi Guillaume,
On 11/15/2010 08:17 AM, Lucas, GuillaumeX wrote:
> From: Guillaume Lucas <guillaumex.lucas@intel.com>
>
> For SIM tool kit only the bits 2 and 3 are interesting
> for the DCS value. The others ones sould be masked. The
> masking is necessary because some SIM car set the
> upper bits to 1.
> ---
> src/stkutil.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/stkutil.c b/src/stkutil.c
> index cdd66bd..a54dd02 100644
> --- a/src/stkutil.c
> +++ b/src/stkutil.c
> @@ -78,7 +78,7 @@ static char *decode_text(unsigned char dcs, int len, const unsigned char *data)
> {
> char *utf8;
>
> - switch (dcs) {
> + switch (dcs & 0x06) {
Do you mean to bitwise and with 0xc here? Otherwise you break the UCS2
case. Also do any SIMs use the '1111' Coding Bits Entry entry from
23.038 Section 4? If so, then we need to use sms_dcs_decode to retrieve
the character set.
> case 0x00:
> {
> long written;
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread* RE: [PATCH] stkutil: mask the DCS value to keep only the intersting bits
2010-11-17 14:13 ` Denis Kenzior
@ 2010-11-18 8:54 ` Lucas, GuillaumeX
2010-11-22 10:57 ` Denis Kenzior
0 siblings, 1 reply; 5+ messages in thread
From: Lucas, GuillaumeX @ 2010-11-18 8:54 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2324 bytes --]
Hi Denis,
>
> Hi Guillaume,
>
> On 11/15/2010 08:17 AM, Lucas, GuillaumeX wrote:
> > From: Guillaume Lucas <guillaumex.lucas@intel.com>
> >
> > For SIM tool kit only the bits 2 and 3 are interesting
> > for the DCS value. The others ones sould be masked. The
> > masking is necessary because some SIM car set the
> > upper bits to 1.
> > ---
> > src/stkutil.c | 2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/src/stkutil.c b/src/stkutil.c
> > index cdd66bd..a54dd02 100644
> > --- a/src/stkutil.c
> > +++ b/src/stkutil.c
> > @@ -78,7 +78,7 @@ static char *decode_text(unsigned char dcs, int
> len, const unsigned char *data)
> > {
> > char *utf8;
> >
> > - switch (dcs) {
> > + switch (dcs & 0x06) {
>
> Do you mean to bitwise and with 0xc here? Otherwise you break the UCS2
> case. Also do any SIMs use the '1111' Coding Bits Entry entry from
> 23.038 Section 4? If so, then we need to use sms_dcs_decode to
> retrieve
> the character set.
Yes you are right. I did a bit-shifting error in my mask and don't see it during my test.
It's 0xc and not 0x6 to use for the mask.
The issue that I've is effectively due to the fact that some SIMs use the '1111' Coding Bits Entry (it's the case for French Orange SIM card for example). For me having the upper bits set to '1' do not really changes the character set decoding (only diff is that UCS2 will not be possible in that case). It's the reason why I've simply add a mask in the decode_text function. Using the sms_dcs_decode function is probably better as the DCS of the SIM ToolKit is the same as the one used for SMS.
Do you want that I re-publish a patch using the sms_dcs_decode function?
Regards
Guillaume
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] stkutil: mask the DCS value to keep only the intersting bits
2010-11-18 8:54 ` Lucas, GuillaumeX
@ 2010-11-22 10:57 ` Denis Kenzior
2010-11-23 15:59 ` Lucas, GuillaumeX
0 siblings, 1 reply; 5+ messages in thread
From: Denis Kenzior @ 2010-11-22 10:57 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1228 bytes --]
Hi Guillaume,
>>> - switch (dcs) {
>>> + switch (dcs & 0x06) {
>>
>> Do you mean to bitwise and with 0xc here? Otherwise you break the UCS2
>> case. Also do any SIMs use the '1111' Coding Bits Entry entry from
>> 23.038 Section 4? If so, then we need to use sms_dcs_decode to
>> retrieve
>> the character set.
>
> Yes you are right. I did a bit-shifting error in my mask and don't see it during my test.
> It's 0xc and not 0x6 to use for the mask.
>
> The issue that I've is effectively due to the fact that some SIMs use the '1111' Coding Bits Entry (it's the case for French Orange SIM card for example). For me having the upper bits set to '1' do not really changes the character set decoding (only diff is that UCS2 will not be possible in that case). It's the reason why I've simply add a mask in the decode_text function. Using the sms_dcs_decode function is probably better as the DCS of the SIM ToolKit is the same as the one used for SMS.
>
> Do you want that I re-publish a patch using the sms_dcs_decode function?
Bitwise shifting with 0x0c would work. However, to be safe we might
just be extra pedantic and check that the DCS the SIM sends to us is
actually valid.
Regards,
-Denis
^ permalink raw reply [flat|nested] 5+ messages in thread* RE: [PATCH] stkutil: mask the DCS value to keep only the intersting bits
2010-11-22 10:57 ` Denis Kenzior
@ 2010-11-23 15:59 ` Lucas, GuillaumeX
0 siblings, 0 replies; 5+ messages in thread
From: Lucas, GuillaumeX @ 2010-11-23 15:59 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1980 bytes --]
Hi Denis,
>
> Hi Guillaume,
>
> >>> - switch (dcs) {
> >>> + switch (dcs & 0x06) {
> >>
> >> Do you mean to bitwise and with 0xc here? Otherwise you break the
> UCS2
> >> case. Also do any SIMs use the '1111' Coding Bits Entry entry from
> >> 23.038 Section 4? If so, then we need to use sms_dcs_decode to
> >> retrieve
> >> the character set.
> >
> > Yes you are right. I did a bit-shifting error in my mask and don't
> see it during my test.
> > It's 0xc and not 0x6 to use for the mask.
> >
> > The issue that I've is effectively due to the fact that some SIMs use
> the '1111' Coding Bits Entry (it's the case for French Orange SIM card
> for example). For me having the upper bits set to '1' do not really
> changes the character set decoding (only diff is that UCS2 will not be
> possible in that case). It's the reason why I've simply add a mask in
> the decode_text function. Using the sms_dcs_decode function is probably
> better as the DCS of the SIM ToolKit is the same as the one used for
> SMS.
> >
> > Do you want that I re-publish a patch using the sms_dcs_decode
> function?
>
> Bitwise shifting with 0x0c would work. However, to be safe we might
> just be extra pedantic and check that the DCS the SIM sends to us is
> actually valid.
>
I agree.
I will rewrite my patch using the sms_dcs_decode function to secure this.
Regards,
Guillaume
---------------------------------------------------------------------
Intel Corporation SAS (French simplified joint stock company)
Registered headquarters: "Les Montalets"- 2, rue de Paris,
92196 Meudon Cedex, France
Registration Number: 302 456 199 R.C.S. NANTERRE
Capital: 4,572,000 Euros
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-11-23 15:59 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-15 14:17 [PATCH] stkutil: mask the DCS value to keep only the intersting bits Lucas, GuillaumeX
2010-11-17 14:13 ` Denis Kenzior
2010-11-18 8:54 ` Lucas, GuillaumeX
2010-11-22 10:57 ` Denis Kenzior
2010-11-23 15:59 ` Lucas, GuillaumeX
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.