gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-20


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-20-g4982e22
Date: Sun, 06 Jun 2010 17:42:39 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  4982e224054594473b8335812a6397c3abf879b6 (commit)
      from  3dac96714fba1f06445c15e34af3a0c3ad7eb1ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=4982e224054594473b8335812a6397c3abf879b6


commit 4982e224054594473b8335812a6397c3abf879b6
Author: Daniele Forsi <address@hidden>
Date:   Sun Jun 6 19:38:34 2010 +0200

    Parse call notifications on Nokia Series 40
    
    Tested with Nokia 5300 (S40 3rd Ed.)

diff --git a/ChangeLog b/ChangeLog
index d1cea51..77415e2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,8 @@
  * nk6510 driver updates
     o fix parsing SMS date from saved messages, bug #29830
                                                         (Paweł Kot)
+    o parse call notification frames on Series 40 (tested on 3rd
+      Ed.); closes https://savannah.nongnu.org/bugs/?20895
  * nk7110 driver updates
     o fix reading SMS from AR and TE                (Daniele Forsi)
  * win32 updates
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index e317ba6..27bb8d4 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -5239,12 +5239,26 @@ static gn_error NK6510_Reset(gn_data *data, struct 
gn_statemachine *state)
 /*** COMMSTATUS ***/
 /******************/
 
+static gn_call_status NK6510_GetCallStatus_S40_30(unsigned char state)
+{
+       switch (state) {
+       case 1: return GN_CALL_Held;
+       case 3: return GN_CALL_Incoming;
+       case 4: return GN_CALL_Dialing;
+       case 5: return GN_CALL_Ringing;
+       default:
+               dprintf("Unknown call status %d\n", state);
+               return GN_CALL_Idle;
+       }
+}
+
 static gn_error NK6510_IncomingCommStatus(int messagetype, unsigned char 
*message, int length, gn_data *data, struct gn_statemachine *state)
 {
        gn_error error = GN_ERR_NONE;
        unsigned char *pos;
        int i;
        gn_call_active *ca;
+       gn_call_info cinfo;
 
        /* Please note that most of the meaning is wild guess */
        switch (message[3]) {
@@ -5252,8 +5266,29 @@ static gn_error NK6510_IncomingCommStatus(int 
messagetype, unsigned char *messag
                dprintf("Call estabilished\n");
                break;
 
-       case 0x03: /* Call started */
-               dprintf("Call started\n");
+       case 0x03: /* Call status */
+               /* fall through */
+       case 0x0f: /* Call status */
+               dprintf("Call status 0x%02x\n", message[3]);
+               memset(&cinfo, 0, sizeof(gn_call_info));
+               cinfo.type = GN_CALL_Voice; /* FIXME how to actually detect 
type? */
+               cinfo.call_id = message[4];
+               for (i = 6; i < length && message[i]; i += message[i + 1]) {
+                       switch (message[i]) {
+                       case 0x01: /* Phone number of incoming call */
+                       case 0x03: /* Phone number of outgoing call */
+                               /* message[i + 2] is type of number? 0x10 
international? 0x01 network specific? */
+                               char_unicode_decode(cinfo.number, message + i + 
6, 2 * message[i + 5]);
+                               break;
+                       case 0x0e:
+                               char_unicode_decode(cinfo.name, message + i + 
8, 2 * message[i + 7]);
+                               break;
+                       default:
+                               dprintf("  Unknown call block type 0x%02x 
length %d\n",  message[i], message[i + 1]);
+                       }
+               }
+               if (DRVINSTANCE(state)->call_notification)
+                       
DRVINSTANCE(state)->call_notification(NK6510_GetCallStatus_S40_30(message[5]), 
&cinfo, state, DRVINSTANCE(state)->call_callback_data);
                break;
 
        case 0x04: /* Call hangup */
@@ -5403,7 +5438,6 @@ static gn_error NK6510_IncomingCommStatus(int 
messagetype, unsigned char *messag
 
        case 0x32:
        case 0xd2:
-       case 0x0f:
                dprintf("Unknown\n");
                break;
 

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |    2 ++
 common/phones/nk6510.c |   40 +++++++++++++++++++++++++++++++++++++---
 2 files changed, 39 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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