gnokii-users
[Top][All Lists]
Advanced

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

Re: GN_OP_OnSMS in nk6510


From: Pawel Kot
Subject: Re: GN_OP_OnSMS in nk6510
Date: Wed, 4 Jul 2007 00:28:00 +0200

Hi,

On 7/3/07, Bastien Nocera <address@hidden> wrote:
On Tue, 2007-07-03 at 22:32 +0200, Pawel Kot wrote:
> Thanks. I should provide feedback tonight.

Great, thanks.

Here is the dirty hack patch that should parse it and put into raw_sms
structure. Any callback is not yet called. That's tomorrow work as it
gets late here...

Index: common/phones/nk6510.c
===================================================================
RCS file: /cvsroot/gnokii/gnokii/common/phones/nk6510.c,v
retrieving revision 1.229
diff -u -r1.229 nk6510.c
--- common/phones/nk6510.c      3 Jun 2007 13:49:58 -0000       1.229
+++ common/phones/nk6510.c      3 Jul 2007 22:25:45 -0000
@@ -1180,7 +1180,10 @@
       dprintf("Deleting SMS...\n");

       error = ValidateSMS(data, state);
-       if (error != GN_ERR_NONE) return error;
+       if (error != GN_ERR_NONE)
+               return error;
+       if (data->raw_sms->number < 1)
+               return GN_ERR_EMPTYLOCATION;

       data->raw_sms->number =
data->sms_folder->locations[data->raw_sms->number - 1];

@@ -1340,9 +1343,20 @@

       dprintf("Frame of type 0x02 (SMS handling) received!\n");

-       if (!data) return GN_ERR_INTERNALERROR;
+       if (!data)
+               return GN_ERR_INTERNALERROR;

       switch (message[3]) {
+       case 0x04:
+               dprintf("Incoming SMS notification\n");
+               if (!data->raw_sms)
+                       data->raw_sms = malloc(sizeof(gn_sms_raw));
+               if (!data->raw_sms)
+                       return GN_ERR_INTERNALERROR;
+               memset(data->raw_sms, 0, sizeof(gn_sms_raw));
+               ParseLayout(message + 8, data);
+               break;
+
       case NK6510_SUBSMS_SMSC_RCV: /* 0x15 */
               switch (message[4]) {
               case 0x00:

take care,
pkot
--
Pawel Kot




reply via email to

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