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-37


From: Daniele Forsi
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-378-g671fc5f
Date: Wed, 07 Mar 2012 17:11:37 +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  671fc5f2e6d188c40c4e9f11c002610dcb6bc7b7 (commit)
      from  d7370cc469c2ca79f4639f48f1eeeb3eed9061b6 (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=671fc5f2e6d188c40c4e9f11c002610dcb6bc7b7


commit 671fc5f2e6d188c40c4e9f11c002610dcb6bc7b7
Author: Daniele Forsi <address@hidden>
Date:   Wed Mar 7 17:40:27 2012 +0100

    Fix handling of Call Log (CL) memory
    
    Each CL entry has its own memory type (DC, MC, RC), not CL.
    A new function is needed to map the values from NK6510_MEMORY_* to
    GN_MT_* otherwise there would be duplicate values in the switch (such
    as NK6510_MEMORY_MC and NK6510_MEMORY_IN which have the value 1).

diff --git a/common/gsm-filetypes.c b/common/gsm-filetypes.c
index fa917f2..053a971 100644
--- a/common/gsm-filetypes.c
+++ b/common/gsm-filetypes.c
@@ -1621,7 +1621,7 @@ endloop:
        return error;
 }
 
-GNOKII_API gn_error gn_file_phonebook_raw_write(FILE *f, gn_phonebook_entry 
*entry, char *memory_type_string)
+GNOKII_API gn_error gn_file_phonebook_raw_write(FILE *f, gn_phonebook_entry 
*entry, const char *memory_type_string)
 {
        char escaped_name[2 * GN_PHONEBOOK_NAME_MAX_LENGTH];
        int i;
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index eb82128..0bf2e47 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -298,7 +298,8 @@ static gn_error NK6510_IncomingSecurity(int messagetype, 
unsigned char *message,
 
 static int sms_encode(gn_data *data, struct gn_statemachine *state, unsigned 
char *req);
 static int get_memory_type(gn_memory_type memory_type);
-static gn_memory_type get_gn_memory_type(int memory_type);
+static gn_memory_type get_gn_memory_type_sms(int memory_type);
+static gn_memory_type get_gn_memory_type_phonebook(int memory_type);
 
 /* Some globals */
 
@@ -1086,7 +1087,7 @@ static gn_error NK6510_IncomingFolder(int messagetype, 
unsigned char *message, i
 
                        if (message[i] != 0x01)
                                return GN_ERR_UNHANDLEDFRAME;
-                       data->sms_folder_list->folder_id[j] = 
get_gn_memory_type(message[i + 2]);
+                       data->sms_folder_list->folder_id[j] = 
get_gn_memory_type_sms(message[i + 2]);
                        dprintf("folder_id[%d]=%d\n", j, 
data->sms_folder_list->folder_id[j]);
                        data->sms_folder_list->folder[j].folder_id = 
data->sms_folder_list->folder_id[j];
                        dprintf("folder_id[%d]=%d\n", j, 
data->sms_folder_list->folder[j].folder_id);
@@ -2782,6 +2783,7 @@ static gn_error NK6510_IncomingPhonebook(int messagetype, 
unsigned char *message
                        }
                }
                dprintf("Received phonebook info\n");
+               data->phonebook_entry->memory_type = 
get_gn_memory_type_phonebook(message[11]);
                blocks     = message[21];
                return phonebook_decode(message + 22, length - 21, data, 
blocks, message[11], 12);
 
@@ -6644,20 +6646,11 @@ static int get_memory_type(gn_memory_type memory_type)
        return (result);
 }
 
-static gn_memory_type get_gn_memory_type(int memory_type)
+static gn_memory_type get_gn_memory_type_sms(int memory_type)
 {
        int result;
 
        switch (memory_type) {
-       case NK6510_MEMORY_SD:
-               result = GN_MT_SD;
-               break;
-       case NK6510_MEMORY_MR:
-               result = GN_MT_MR;
-               break;
-       case NK6510_MEMORY_CL:
-               result = GN_MT_CL;
-               break;
        case NK6510_MEMORY_IN:
                result = GN_MT_IN;
                break;
@@ -6739,6 +6732,52 @@ static gn_memory_type get_gn_memory_type(int memory_type)
        }
        return (result);
 }
+
+static gn_memory_type get_gn_memory_type_phonebook(int memory_type)
+{
+       int result;
+
+       switch (memory_type) {
+       case NK6510_MEMORY_DC:
+               result = GN_MT_DC;
+               break;
+       case NK6510_MEMORY_MC:
+               result = GN_MT_MC;
+               break;
+       case NK6510_MEMORY_RC:
+               result = GN_MT_RC;
+               break;
+       case NK6510_MEMORY_FD:
+               result = GN_MT_FD;
+               break;
+       case NK6510_MEMORY_ME:
+               result = GN_MT_ME;
+               break;
+       case NK6510_MEMORY_ON:
+               result = GN_MT_ON;
+               break;
+       case NK6510_MEMORY_EN:
+               result = GN_MT_EN;
+               break;
+       case NK6510_MEMORY_MT:
+               result = GN_MT_MT;
+               break;
+       case NK6510_MEMORY_SD:
+               result = GN_MT_SD;
+               break;
+       case NK6510_MEMORY_MR:
+               result = GN_MT_MR;
+               break;
+       case NK6510_MEMORY_CL:
+               result = GN_MT_CL;
+               break;
+       default:
+               result = GN_MT_XX;
+               break;
+       }
+       return (result);
+}
+
 /*
 01 33 00 17 05 01 05 08 04 00 01 00 00 00
 01 33 00 17 05 01 05 08 04 00 01 00 00 00
diff --git a/include/gnokii.h.in b/include/gnokii.h.in
index 100339e..b325345 100644
--- a/include/gnokii.h.in
+++ b/include/gnokii.h.in
@@ -274,7 +274,7 @@ GNOKII_API int gn_ldif2phonebook(FILE *f, 
gn_phonebook_entry *entry);
 
 /* reads internal gnokii raw phonebook format */
 GNOKII_API gn_error gn_file_phonebook_raw_parse(gn_phonebook_entry *entry, 
char *buffer);
-GNOKII_API gn_error gn_file_phonebook_raw_write(FILE *f, gn_phonebook_entry 
*entry, char *memory_type_string);
+GNOKII_API gn_error gn_file_phonebook_raw_write(FILE *f, gn_phonebook_entry 
*entry, const char *memory_type_string);
 
 /* DEPRECATED */
 GNOKII_API int gn_vcal_file_event_read(char *filename, gn_calnote *cnote, int 
number) GNOKII_DEPRECATED;

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

Summary of changes:
 common/gsm-filetypes.c |    2 +-
 common/phones/nk6510.c |   63 ++++++++++++++++++++++++++++++++++++++---------
 include/gnokii.h.in    |    2 +-
 3 files changed, 53 insertions(+), 14 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

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