gnokii-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnokii 0.6.1 released


From: Hugo Haas
Subject: Re: gnokii 0.6.1 released
Date: Thu, 15 Apr 2004 08:45:35 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hi Pawel.

* Pawel Kot <address@hidden> [2004-04-14 23:35:44+0200]:
> On Wed, 14 Apr 2004, Hugo Haas wrote:
>
>> I see that only part of the patch I sent fixing some encoding problems
>> in atgen.c has been integrated (see [1]). Is there a problem with the
>> rest of it?
>
> Yes. See http://article.gmane.org/gmane.linux.drivers.gnokii/3898

I missed your reply. Sorry about that.

* Pawel Kot <address@hidden> [2004-04-11 16:06:10+0200]:
>> Looking at atgen.c, I noticed that gnokii did the same mistake, as it
>> sets the memory type without checking what encoding is used. I also
>> noted that gnokii wasn't checking the encoding in ReplyReadPhonebook()
>> when receiving a phone number, and --getphonebook would give me:
>>
>>   1. Name: Foo Bar/H
>>   Number: 004500...
>>   Group id: 0
>
> Could you please show the output when reading this entry? Your patch
> breaks my Nokia 6310 in at least 2 places:
> -               sprintf(req, "AT+CPBS=\"%s\"\r", memorynames[mt]);
> -               ret = sm_message_send(13, GN_OP_Init, req, state);
> +               len = at_encode(drvinst->charset, memtype, memorynames[mt], 
> strlen(memorynames[mt]));
> +               sprintf(req, "AT+CPBS=\"%s\"\r", memtype);
> +               ret = sm_message_send(11 + len, GN_OP_Init, req, state);
> I need to give it always in ASCII ie:
>
> Message sent: 0x00 / 0x000d
> 41 54 2b 43 50 42 53 3d 22 4d 45 22 0d          | AT+CPBS="ME"
> write: [AT+CPBS="ME"<cr>]
> read : [AT+CPBS="ME"<cr><cr><lf>OK<cr><lf>]
> Message received: 0x00 / 0x0013
> 02 41 54 2b 43 50 42 53 3d 22 4d 45 22 0d 0d 0a |  AT+CPBS="ME"
> 4f 4b 0d                                        | OK
> Received message type 00
>
> instead of:
>
> Message sent: 0x00 / 0x0013
> 41 54 2b 43 50 42 53 3d 22 30 30 34 64 30 30 34 | AT+CPBS="004d004
> 35 22 0d                                        | 5"
> write: [AT+CPBS="004d0045"<cr>]
> read : [AT+CPBS="004d0045"<cr><cr><lf>ERROR<cr><lf>]
> Message received: 0x00 / 0x001c
> 03 41 54 2b 43 50 42 53 3d 22 30 30 34 64 30 30 |  AT+CPBS="004d00
> 34 35 22 0d 0d 0a 45 52 52 4f 52 0d             | 45"   ERROR
> Received message type 00
>
> Yes, I use UCS2 encoding. The second place is the number. It is encoded
> ASCII no matter what encoding is set:
> Message sent: 0x0d / 0x000a
> 41 54 2b 43 50 42 52 3d 33 0d                   | AT+CPBR=3
> write: [AT+CPBR=3<cr>]
> read : [AT+CPBR=3<cr><cr><lf>+CPBR:
> 3,"+48504000214",145,"005000610077006501420020004B006F0074"<cr><lf><cr><lf>OK<cr><lf>]
> Message received: 0x0d / 0x0056
> 02 41 54 2b 43 50 42 52 3d 33 0d 0d 0a 2b 43 50 |  AT+CPBR=3   +CP
> 42 52 3a 20 33 2c 22 2b 34 38 35 30 34 30 30 30 | BR: 3,"+48504000
> 32 31 34 22 2c 31 34 35 2c 22 30 30 35 30 30 30 | 214",145,"005000
> 36 31 30 30 37 37 30 30 36 35 30 31 34 32 30 30 | 6100770065014200
> 32 30 30 30 34 42 30 30 36 46 30 30 37 34 22 0d | 20004B006F0074"
> 0a 0d 0a 4f 4b 0d                               |    OK

That's interesting. The Sony Ericsson T610 I have behaves the other
way: everything between double quotes is encoded with the specified
encoding, and the rest is in ASCII. It's interesting that your Nokia
encodes certain things in UCS2, and others in ASCII. Is this API
standard? I wonder what the specification says.

Anyway, here is what happens with my T610.

With vanilla 0.6.1:

address@hidden /tmp/gnokii-0.6.1/gnokii/.libs> ./lt-gnokii --getphonebook ME 1 
1   
GNOKII Version 0.6.1
write: [ATZ<cr>]
read : address@hidden<cr><cr><lf>OK<cr><lf>]
write: [ATE1<cr>]
read : [ATE1<cr><cr><lf>OK<cr><lf>]
write: [AT+CGMM<cr>]
read : [AT+CGMM<cr><cr><lf>AAB-1021011-BV<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CGMI<cr>]
read : [AT+CGMI<cr><cr><lf>SONY ERICSSON<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CSCS?<cr>]
read : [AT+CSCS?<cr><cr><lf>+CSCS: "GSM"<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CSCS=?<cr>]
read : [AT+CSCS=?<cr><cr><lf>+CSCS: 
("GSM","IRA","8859-1","ERICSSON","UTF-8","UCS2")<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CSCS="UCS2"<cr>]
read : [AT+CSCS="UCS2"<cr><cr><lf>OK<cr><lf>]
write: [AT+CPBS="ME"<cr>]
read : [AT+CPBS="ME"<cr><cr><lf>ERROR<cr><lf>]
write: [AT+CPBR=?<cr>]
read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-80),80,14<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CPBR=1<cr>]
read : [AT+CPBR=1<cr><cr><lf>OK<cr><lf>]
1. Name: 
Number: 
Group id: 0

With the rest of my patch, as sent yesterday:

address@hidden /tmp/gnokii-0.6.1/gnokii/.libs> ./lt-gnokii --getphonebook ME 
448 448
GNOKII Version 0.6.1
write: [ATZ<cr>]
read : [ATZ<cr><cr><lf>OK<cr><lf>]
write: [ATE1<cr>]
read : [ATE1<cr><cr><lf>OK<cr><lf>]
write: [AT+CGMM<cr>]
read : [AT+CGMM<cr><cr><lf>AAB-1021011-BV<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CGMI<cr>]
read : [AT+CGMI<cr><cr><lf>SONY ERICSSON<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CSCS?<cr>]
read : [AT+CSCS?<cr><cr><lf>+CSCS: "GSM"<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CSCS=?<cr>]
read : [AT+CSCS=?<cr><cr><lf>+CSCS: 
("GSM","IRA","8859-1","ERICSSON","UTF-8","UCS2")<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CSCS="UCS2"<cr>]
read : [AT+CSCS="UCS2"<cr><cr><lf>OK<cr><lf>]
write: [AT+CPBS="004d0045"<cr>]
read : [AT+CPBS="004d0045"<cr><cr><lf>OK<cr><lf>]
write: [AT+CPBR=?<cr>]
read : [AT+CPBR=?<cr><cr><lf>+CPBR: (1-510),80,180<cr><lf><cr><lf>OK<cr><lf>]
write: [AT+CPBR=448<cr>]
read : [AT+CPBR=448<cr><cr><lf>+CPBR: 
448,"002B00310032003300340035003600370038",145,"0046006F006F006200610072002F0057"<cr><lf><cr><lf>OK<cr><lf>]
448. Name: Foobar/W
Number: +12345678
Group id: 0

It seems that we won't be able to have the same code talk to both
phones: it could be detected dynamically, or it could be specified in
the configuration file.

What do you think?

Regards,

Hugo

-- 
Hugo Haas - http://larve.net/people/hugo/





reply via email to

[Prev in Thread] Current Thread [Next in Thread]