[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: smsd problem with AT model
From: |
Daniele Forsi |
Subject: |
Re: smsd problem with AT model |
Date: |
Wed, 30 Aug 2006 14:41:04 +0200 |
User-agent: |
Mozilla Thunderbird 1.5.0.2 (X11/20060420) |
> A. Andria wrote:
>> address@hidden:~# gnokii --getsms SM 1
>> [...]
>> Message sent: 0x12 / 0x0009
>> 41 54 2b 43 50 4d 53 3f 0d | AT+CPMS?
>> write: [AT+CPMS?<cr>]
>> read : [AT+CPMS?<cr><cr><lf>+CPMS:
>> "SM",2,30,"SM",2,30<cr><lf><cr><lf>OK<cr><lf>]
>> Message received: 0x12 / 0x002d
>> 02 41 54 2b 43 50 4d 53 3f 0d 0d 0a 2b 43 50 4d | AT+CPMS? +CPM
>> 53 3a 20 22 53 4d 22 2c 32 2c 33 30 2c 22 53 4d | S: "SM",2,30,"SM
>> 22 2c 32 2c 33 30 0d 0a 0d 0a 4f 4b 0d | ",2,30 OK
>> Received message type 12
>> GetSMS SM 1 failed! (Command failed.)
>> Serial device: closing device
the answer you get is shorter than what is expected by the AT driver
you get:
+CPMS: "SM",2,30,"SM",2,30
while the driver needs a third group like this:
+CPMS: "SM",33,50,"SM",33,50,"MT",44,200
so the driver should take into account both cases
can you test the following patch?
Index: common/phones/atgen.c
===================================================================
RCS file: /sources/gnokii/gnokii/common/phones/atgen.c,v
retrieving revision 1.126
diff -u -r1.126 atgen.c
--- common/phones/atgen.c 8 Aug 2006 22:06:39 -0000 1.126
+++ common/phones/atgen.c 30 Aug 2006 12:36:35 -0000
@@ -1441,7 +1441,9 @@
if (sscanf(buf.line2, "+CPMS:
\"%*c%*c\",%d,%*d,\"%*c%*c\",%*d,%*d,\"%c%c\",%*d,%*d",
&data->sms_status->number, &store[0], &store[1]) != 3)
- return GN_ERR_FAILED;
+ if (sscanf(buf.line2, "+CPMS:
\"%c%c\",%d,%*d,\"%*c%*c\",%*d,%*d",
+ &store[0], &store[1], &data->sms_status->number) != 3)
+ return GN_ERR_FAILED;
data->sms_status->unread = 0;
data->sms_status->changed = 0;
--
Daniele