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_28-20


From: Pawel Kot
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_28-201-g87c5251
Date: Wed, 21 Apr 2010 13:34:58 +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  87c525112b95d9ebedb2dbe52ffb64a89f3f0ec2 (commit)
      from  7ffa43febb6e0d4c45c6d2614baaf1446e2d7f4a (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=87c525112b95d9ebedb2dbe52ffb64a89f3f0ec2


commit 87c525112b95d9ebedb2dbe52ffb64a89f3f0ec2
Author: Pawel Kot <address@hidden>
Date:   Wed Apr 21 15:31:45 2010 +0200

    Misc cleanups. Add support for a few new FBUS frames.

diff --git a/common/misc.c b/common/misc.c
index b1be8c8..e425909 100644
--- a/common/misc.c
+++ b/common/misc.c
@@ -136,7 +136,7 @@ static gn_phone_model models[] = {
        {"3108",  "RH-6",       PM_OLD_DEFAULT },
        {"3110",  "NHE-8",      PM_OLD_DEFAULT | PM_DATA },
        {"3110",  "0310" ,      PM_OLD_DEFAULT | PM_DATA }, /* NHE-8 */
-       {"3110c", "RM-237",     PM_DEFAULT | PM_SMSFILE | PM_EXTPBK2 }, /* 
Nokia 3110 classic */
+       {"3110c", "RM-237",     PM_DEFAULT | PM_SMSFILE | PM_EXTPBK2 | 
PM_EXTCALENDAR }, /* Nokia 3110 classic */
        {"3120",  "RH-19",      PM_DEFAULT },
        {"3120b", "RH-50",      PM_DEFAULT },
        {"3200",  "RH-30",      PM_DEFAULT | PM_XGNOKIIBREAKAGE },
@@ -242,8 +242,8 @@ static gn_phone_model models[] = {
        {"6233",  "RM123_145_-", PM_DEFAULT | PM_NETMONITOR },
        {"6250",  "NHM-3",      PM_DEFAULT | PM_NETMONITOR },
        {"6280",  "RH-78",      PM_DEFAULT | PM_NETMONITOR },
-       {"6300",  "RM-217",     PM_DEFAULT | PM_FULLPBK | PM_SMSFILE | 
PM_EXTPBK2 },
-       {"6303",  "RM-443",     PM_DEFAULT | PM_FULLPBK | PM_SMSFILE | 
PM_EXTPBK2 }, /* Nokia 6303 classic */
+       {"6300",  "RM-217",     PM_DEFAULT | PM_FULLPBK | PM_SMSFILE | 
PM_EXTPBK2 | PM_EXTCALENDAR },
+       {"6303",  "RM-443",     PM_DEFAULT | PM_FULLPBK | PM_SMSFILE | 
PM_EXTPBK2 | PM_EXTCALENDAR }, /* Nokia 6303 classic */
        {"6310",  "NPE-4",      PM_DEFAULT },
        {"6310i", "NPL-1",      PM_DEFAULT },
        {"6340",  "NPM-2",      PM_OLD_DEFAULT },
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index 51584d0..1b8de40 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -442,7 +442,7 @@ static gn_error NK6510_Functions(gn_operation op, gn_data 
*data, struct gn_state
        case GN_OP_GetCalendarNote:
                return NK6510_GetCalendarNote(data, state);
        case GN_OP_WriteCalendarNote:
-               return NK6510_WriteCalendarNote2(data, state);
+               return NK6510_WriteCalendarNote(data, state);
        case GN_OP_DeleteCalendarNote:
                return NK6510_DeleteCalendarNote(data, state);
        case GN_OP_DeleteWAPBookmark:
@@ -2295,9 +2295,9 @@ static gn_error NK6510_GetFile(gn_data *data, struct 
gn_statemachine *state)
        unsigned char req[512] = {FBUS_FRAME_HEADER, 0x68, 0x00};
        unsigned char req2[512] = {FBUS_FRAME_HEADER, 0x72, 0x00, 0x00, 0x00};
        unsigned char req3[] = {FBUS_FRAME_HEADER, 0x5e, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x03,
-                               0x00, 0x00, 0x00, 0x00, // Start position
+                               0x00, 0x00, 0x00, 0x00, /* Start position */
                                0x00, 0x00, 0x04, 0x00,
-                               0x00, 0x00, 0x00, 0x00}; // Size
+                               0x00, 0x00, 0x00, 0x00}; /* Size */
        unsigned char req4[] = {FBUS_FRAME_HEADER, 0x74, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x03};
        gn_error err;
        int i;
@@ -2438,7 +2438,7 @@ static gn_error NK6510_PutFile(gn_data *data, struct 
gn_statemachine *state)
 {
        unsigned char req1[512] = {FBUS_FRAME_HEADER, 0x72, 0x11, 0x00, 0x00};
        unsigned char req2[512] = {FBUS_FRAME_HEADER, 0x58, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x03,
-                               0x00, 0x00, 0x00, 0x00}; // Size
+                               0x00, 0x00, 0x00, 0x00}; /* Size */
        unsigned char req3[] = {FBUS_FRAME_HEADER, 0x74, 0x00, 0x00, 0x00, 
0x00, 0x00, 0x03};
        gn_error err;
        int i;
@@ -3576,13 +3576,13 @@ static gn_error NK6510_IncomingCalendar(int 
messagetype, unsigned char *message,
        if (!data || !data->calnote) return GN_ERR_INTERNALERROR;
 
        switch (message[3]) {
-       case NK6510_SUBCAL_NOTE_RCVD:
+       case NK6510_SUBCAL_NOTE_RCVD: /* 0x1a */
                e = calnote_decode(message, length, data);
                break;
-       case NK6510_SUBCAL_NOTE2_RCVD:
+       case NK6510_SUBCAL_NOTE2_RCVD: /* 0x7e */
                e = calnote2_decode(message, length, data);
                break;
-       case 0x9f:
+       case NK6510_SUBCAL_INFO2_RCVD: /* 0x9f */
                /* message[4]   - number of notes locations in this frame
                 * message[5]   - 0x07
                 * message[6-7] - 0x00 0x00
@@ -3603,7 +3603,7 @@ static gn_error NK6510_IncomingCalendar(int messagetype, 
unsigned char *message,
                if (message[4] == 0)
                        data->calnote_list->number = data->calnote_list->last;
                break;
-       case NK6510_SUBCAL_INFO_RCVD:
+       case NK6510_SUBCAL_INFO_RCVD: /* 0x3b */
                dprintf("Calendar Notes Info received!\n Total count: %i\n", 
message[4] * 256 + message[5]);
                data->calnote_list->number = message[4] * 256 + message[5];
                dprintf("Location of Notes: ");
@@ -3618,23 +3618,27 @@ static gn_error NK6510_IncomingCalendar(int 
messagetype, unsigned char *message,
                if (message[7] != 0)
                        data->calnote_list->number = data->calnote_list->last;
                break;
-       case NK6510_SUBCAL_FREEPOS_RCVD:
+       case NK6510_SUBCAL_FREEPOS_RCVD: /* 0x32 */
                dprintf("First free position received: %i!\n", message[4] * 256 
+ message[5]);
                data->calnote->location = (((unsigned int)message[4]) << 8) + 
message[5];
                break;
-       case NK6510_SUBCAL_DEL_NOTE_RESP:
+       case NK6510_SUBCAL_FREEPOS2_RCVD: /* 0x96 */
+               dprintf("First free position received: %i!\n", message[7] * 256 
+ message[8]);
+               data->calnote->location = (((unsigned int)message[7]) << 8) + 
message[8];
+               break;
+       case NK6510_SUBCAL_DEL_NOTE_RESP: /* 0x0c */
                dprintf("Succesfully deleted calendar note: %i!\n", message[4] 
* 256 + message[5]);
                break;
-       case NK6510_SUBCAL_ADD_MEETING_RESP:
-       case NK6510_SUBCAL_ADD_CALL_RESP:
-       case NK6510_SUBCAL_ADD_BIRTHDAY_RESP:
-       case NK6510_SUBCAL_ADD_REMINDER_RESP:
+       case NK6510_SUBCAL_ADD_MEETING_RESP: /* 0x02 */
+       case NK6510_SUBCAL_ADD_CALL_RESP: /* 0x04 */
+       case NK6510_SUBCAL_ADD_BIRTHDAY_RESP: /* 0x06 */
+       case NK6510_SUBCAL_ADD_REMINDER_RESP: /* 0x08 */
                if (message[6]) e = GN_ERR_FAILED;
                dprintf("Attempt to write calendar note at %i. Status: %i\n",
                        message[4] * 256 + message[5],
                        1 - message[6]);
                break;
-       case NK6510_SUBCAL_ADD_NOTE_RESP:
+       case NK6510_SUBCAL_ADD_NOTE_RESP: /* 0x66 */
                switch (message[4]) {
                case 0x00:
                        dprintf("Calendar note written at %d location\n", 
message[8] * 256 + message[9]);
@@ -3773,6 +3777,12 @@ static gn_error NK6510_FirstCalendarFreePos(gn_data 
*data, struct gn_statemachin
        SEND_MESSAGE_BLOCK(NK6510_MSG_CALENDAR, 4);
 }
 
+static gn_error NK6510_FirstCalendarFreePos2(gn_data *data, struct 
gn_statemachine *state)
+{
+       unsigned char req[] = { FBUS_FRAME_HEADER, 0x95, 0x00 };
+       SEND_MESSAGE_BLOCK(NK6510_MSG_CALENDAR, 5);
+}
+
 static gn_error NK6510_WriteCalendarNote2(gn_data *data, struct 
gn_statemachine *state)
 {
        gn_error error = GN_ERR_NONE;
@@ -3806,13 +3816,16 @@ static gn_error NK6510_WriteCalendarNote2(gn_data 
*data, struct gn_statemachine
                                    0x00, /* phone length/meeting location */
                                    0x00, 0x00, 0x00};
 
-       if (!data->calnote) return GN_ERR_INTERNALERROR;
+       dprintf("WriteCalendarNote2\n");
+       if (!data->calnote)
+               return GN_ERR_INTERNALERROR;
 
        calnote = data->calnote;
 
        /* 6510 needs to seek the first free pos to inhabit with next note */
-       error = NK6510_FirstCalendarFreePos(data, state);
-       if (error != GN_ERR_NONE) return error;
+       error = NK6510_FirstCalendarFreePos2(data, state);
+       if (error != GN_ERR_NONE)
+               return error;
 
        /* Set location */
        req[8] = calnote->location / 256;
@@ -3862,10 +3875,11 @@ static gn_error NK6510_WriteCalendarNote2(gn_data 
*data, struct gn_statemachine
        req[41] = calnote->recurrence % 256;
 
        /* Occurrences */
+       /* FIXME: it doesn't work 
        if (calnote->recurrence) {
                req[46] = calnote->occurrences / 256;
                req[47] = calnote->occurrences % 256;
-       }
+       }*/
 
        /* Set start time and end time */
        req[28] = calnote->time.year / 256;
@@ -3924,13 +3938,19 @@ static gn_error NK6510_WriteCalendarNote(gn_data *data, 
struct gn_statemachine *
        long seconds, minutes;
        gn_error error;
 
-       if (!data->calnote) return GN_ERR_INTERNALERROR;
+       if (DRVINSTANCE(state)->pm->flags & PM_EXTCALENDAR)
+               return NK6510_WriteCalendarNote(data, state);
+
+       dprintf("WriteCalendarNote\n");
+       if (!data->calnote)
+               return GN_ERR_INTERNALERROR;
 
        calnote = data->calnote;
 
        /* 6510 needs to seek the first free pos to inhabit with next note */
        error = NK6510_FirstCalendarFreePos(data, state);
-       if (error != GN_ERR_NONE) return error;
+       if (error != GN_ERR_NONE)
+               return error;
 
        /* Location */
        req[4] = calnote->location >> 8;
@@ -4123,7 +4143,8 @@ static gn_error NK6510_DeleteCalendarNote(gn_data *data, 
struct gn_statemachine
                return GN_ERR_INVALIDLOCATION;
        }
 
-       if (own_list) data->calnote_list = NULL;
+       if (own_list)
+               data->calnote_list = NULL;
        SEND_MESSAGE_BLOCK(NK6510_MSG_CALENDAR, 6);
 }
 
@@ -5858,7 +5879,7 @@ static gn_error NK6510_WriteWAPSetting(gn_data *data, 
struct gn_statemachine *st
        req[pos++] = length / 256;
        req[pos++] = length % 256;
 
-       req[pos++] = 0x00; // data->wap_setting->gprs_authentication;
+       req[pos++] = 0x00; /* data->wap_setting->gprs_authentication; */
        req[pos++] = data->wap_setting->gprs_connection;
        req[pos++] = data->wap_setting->gprs_login;
 
diff --git a/include/misc.h b/include/misc.h
index 7558189..6fa29bd 100644
--- a/include/misc.h
+++ b/include/misc.h
@@ -92,8 +92,10 @@
 #define PM_AUTHENTICATION      0x0200
 #define PM_FOLDERS             0x0400
 #define PM_FULLPBK             0x0800
+/* Verify if these three might not be coupled into one */
 #define PM_SMSFILE             0x1000
 #define PM_EXTPBK2             0x2000
+#define PM_EXTCALENDAR         0x4000
 
 /* This one indicated reported cases of breaking the phone by xgnokii
  * in FBUS orver IrDA mode */
diff --git a/include/phones/nk6510.h b/include/phones/nk6510.h
index 44772ba..a3f6a4c 100644
--- a/include/phones/nk6510.h
+++ b/include/phones/nk6510.h
@@ -123,6 +123,8 @@ typedef enum {
 #define NK6510_SUBCAL_INFO_RCVD                0x3b    /* Received calendar 
summary */
 #define NK6510_SUBCAL_NOTE2_RCVD       0x7e    /* Received note (with more 
details) */
 #define NK6510_SUBCAL_ADD_NOTE_RESP    0x66    /* Add calendar note response */
+#define NK6510_SUBCAL_INFO2_RCVD       0x9f    /* Received calendar summary */
+#define NK6510_SUBCAL_FREEPOS2_RCVD    0x96    /* Received first free position 
*/
 
 /* Calendar note types */
 #define NK6510_NOTE_REMINDER           0x00    /* Reminder */

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

Summary of changes:
 common/misc.c           |    6 ++--
 common/phones/nk6510.c  |   67 ++++++++++++++++++++++++++++++----------------
 include/misc.h          |    2 +
 include/phones/nk6510.h |    2 +
 4 files changed, 51 insertions(+), 26 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs




reply via email to

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