gnokii-users
[Top][All Lists]
Advanced

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

Re: SMS from AT phones -- fix


From: Pavel Machek
Subject: Re: SMS from AT phones -- fix
Date: Fri, 26 Apr 2002 14:02:24 +0200
User-agent: Mutt/1.3.28i

Hi!

> > This fixes sending sms-es from at phone. However, I'd like to know
> > what the right fix is. [Yes, I skip first 16 bytes and hardcode next
> > byte to zero. Ouch. But it works?!]
> 
> >From the which phone? What should be the meaning of the 17th byte? Is it
> the only byte that matters os the rest is also mismashed?

Siemens c45. If I fix 17th byte, message gets sent, else I get ERROR
from phone. (Also note I had to delete first 16 bytes?!)

In at_writesms, this looks pretty suspect:

        sprintf(req, "AT+%s=%d\r", cmd, length - data->RawData->Data[0] - 1);

Ouch, and what's wrong is actually 8-th byte in binary code, at_submit
layout places there "user data".

... ..ha, ha, looking at gnokii.c... that bug you fixed yesterday had
few siblings. ...testing... But they are not causing this weirdness
:-(.

This looks like genuine bug, and I'm commiting this as bugfix.

Index: gnokii.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/gnokii/gnokii.c,v
retrieving revision 1.231
diff -u -u -r1.231 gnokii.c
--- gnokii.c    25 Apr 2002 23:22:31 -0000      1.231
+++ gnokii.c    26 Apr 2002 12:01:24 -0000
@@ -512,6 +512,7 @@
        SMS.UserData[0].Type = SMS_PlainText;
        strncpy(SMS.UserData[0].u.Text, message_buffer, chars_read);
        SMS.UserData[0].u.Text[chars_read] = 0;
+       SMS.UserData[1].Type = SMS_NoData;
        data.SMSMessage = &SMS;

        /* Send the message. */
@@ -629,6 +630,7 @@
        SMS.UserData[0].Type = SMS_PlainText;
        strncpy(SMS.UserData[0].u.Text, message_buffer, chars_read);
        SMS.UserData[0].u.Text[chars_read] = 0;
+       SMS.UserData[1].Type = SMS_NoData;

        data.SMSMessage = &SMS;
        error = SaveSMS(&data, &State);

                                                                        Pavel

-- 
(about SSSCA) "I don't say this lightly.  However, I really think that the U.S.
no longer is classifiable as a democracy, but rather as a plutocracy." --hpa



reply via email to

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