summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/phone/nokia
Unidiff
Diffstat (limited to 'gammu/emb/common/phone/nokia') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/phone/nokia/dct3/dct3func.c16
-rw-r--r--gammu/emb/common/phone/nokia/dct3/dct3func.h2
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n6110.c17
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n7110.c9
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n9210.c3
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n3320.c3
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n3650.c3
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n6510.c168
-rw-r--r--gammu/emb/common/phone/nokia/dct4/n6510.h2
-rw-r--r--gammu/emb/common/phone/nokia/nauto.c2
-rw-r--r--gammu/emb/common/phone/nokia/nfunc.c14
11 files changed, 179 insertions, 60 deletions
diff --git a/gammu/emb/common/phone/nokia/dct3/dct3func.c b/gammu/emb/common/phone/nokia/dct3/dct3func.c
index beef33c..17cd0a4 100644
--- a/gammu/emb/common/phone/nokia/dct3/dct3func.c
+++ b/gammu/emb/common/phone/nokia/dct3/dct3func.c
@@ -1,4 +1,7 @@
1/* (c) 2001-2004 by Marcin Wiacek */ 1/* (c) 2001-2004 by Marcin Wiacek */
2/* based on some work from Markus Plail, Pavel Janik, others and Gnokii */
3/* resetting DCT4 phones settings (c) by Walek */ 2/* resetting DCT4 phones settings (c) by Walek */
3/* based on some Markus Plail, Pavel Janik & others work from Gnokii (www.gnokii.org)
4 * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
5 * GNU GPL version 2 or later
6 */
4 7
@@ -396,2 +399,3 @@ GSM_Error DCT3_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *s)
396 Data->SMSC->Validity.Relative= msg.Buffer[8]; 399 Data->SMSC->Validity.Relative= msg.Buffer[8];
400 if (msg.Buffer[8] == 0x00) Data->SMSC->Validity.Relative = SMS_VALID_Max_Time;
397 401
@@ -444,3 +448,3 @@ GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s
444 smprintf(s, "Network info received\n"); 448 smprintf(s, "Network info received\n");
445 smprintf(s, " Status : "); 449 smprintf(s, "Status : ");
446 switch (msg.Buffer[8]) { 450 switch (msg.Buffer[8]) {
@@ -453,3 +457,3 @@ GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s
453 smprintf(s, "\n"); 457 smprintf(s, "\n");
454 smprintf(s, "Network selection : %s\n", msg.Buffer[9]==1?"manual":"automatic"); 458 smprintf(s, "Network selection : %s\n", msg.Buffer[9]==1?"manual":"automatic");
455 if (msg.Buffer[8]<0x03) { 459 if (msg.Buffer[8]<0x03) {
@@ -461,4 +465,4 @@ GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s
461 465
462 smprintf(s, "Network code : %s\n", NetInfo.NetworkCode);
463 NOKIA_DecodeNetworkCode(msg.Buffer+14,NetInfo.NetworkCode); 466 NOKIA_DecodeNetworkCode(msg.Buffer+14,NetInfo.NetworkCode);
467 smprintf(s, "Network code : %s\n", NetInfo.NetworkCode);
464 smprintf(s, "Network name for Gammu : %s ", 468 smprintf(s, "Network name for Gammu : %s ",
@@ -1210,3 +1214,3 @@ GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s
1210 smprintf(s, "SMS sent OK\n"); 1214 smprintf(s, "SMS sent OK\n");
1211 if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,0,0); 1215 if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,0,msg.Buffer[5]);
1212 return ERR_NONE; 1216 return ERR_NONE;
@@ -1214,3 +1218,3 @@ GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s
1214 smprintf(s, "Error %i\n",msg.Buffer[6]); 1218 smprintf(s, "Error %i\n",msg.Buffer[6]);
1215 if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,msg.Buffer[6],0); 1219 if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,msg.Buffer[6],-1);
1216 return ERR_NONE; 1220 return ERR_NONE;
diff --git a/gammu/emb/common/phone/nokia/dct3/dct3func.h b/gammu/emb/common/phone/nokia/dct3/dct3func.h
index 66b67ec..18b2026 100644
--- a/gammu/emb/common/phone/nokia/dct3/dct3func.h
+++ b/gammu/emb/common/phone/nokia/dct3/dct3func.h
@@ -5,2 +5,4 @@
5 5
6#include "../ncommon.h"
7
6 GSM_Error DCT3_ReplyPressKey (GSM_Protocol_Message msg, GSM_StateMachine *s); 8 GSM_Error DCT3_ReplyPressKey (GSM_Protocol_Message msg, GSM_StateMachine *s);
diff --git a/gammu/emb/common/phone/nokia/dct3/n6110.c b/gammu/emb/common/phone/nokia/dct3/n6110.c
index 263d12b..dac6c12 100644
--- a/gammu/emb/common/phone/nokia/dct3/n6110.c
+++ b/gammu/emb/common/phone/nokia/dct3/n6110.c
@@ -1,5 +1,7 @@
1/* (c) 2001-2004 by Marcin Wiacek */ 1/* (c) 2001-2004 by Marcin Wiacek */
2/* based on some work from Markus Plail and Gnokii */
3/* Authentication function (c) 1999 or earlier by Pavel Janik */
4/* 5210 calendar IDs by Frederick Ros */ 2/* 5210 calendar IDs by Frederick Ros */
3/* based on some Markus Plail, Pavel Janik & others work from Gnokii (www.gnokii.org)
4 * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
5 * GNU GPL version 2 or later
6 */
5 7
@@ -129,2 +131,3 @@ static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const
129 131
132/* Pavel Janik */
130/* This function provides Nokia authentication protocol. 133/* This function provides Nokia authentication protocol.
@@ -826,2 +829,3 @@ static GSM_Error N6110_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
826 case RING_MIDI: 829 case RING_MIDI:
830 case RING_MMF:
827 return ERR_NOTSUPPORTED; 831 return ERR_NOTSUPPORTED;
@@ -1526,2 +1530,3 @@ static GSM_Error N6110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi
1526 case RING_MIDI: 1530 case RING_MIDI:
1531 case RING_MMF:
1527 return ERR_NOTSUPPORTED; 1532 return ERR_NOTSUPPORTED;
@@ -1563,2 +1568,3 @@ static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
1563 case RING_MIDI: 1568 case RING_MIDI:
1569 case RING_MMF:
1564 return ERR_NOTSUPPORTED; 1570 return ERR_NOTSUPPORTED;
@@ -2445,4 +2451,4 @@ GSM_Error N6110_ReplyUSSDInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
2445 2451
2446 tmp=GSM_UnpackEightBitsToSeven(0, 82, 82, msg.Buffer+8, buffer); 2452 tmp=GSM_UnpackEightBitsToSeven(0, msg.Buffer[7], 82, msg.Buffer+8, buffer);
2447 msg.Buffer[tmp] = 0; 2453 buffer[tmp] = 0;
2448 2454
@@ -2809,2 +2815,3 @@ GSM_Phone_Functions N6110Phone = {
2809 NOTSUPPORTED, /* SendSavedSMS */ 2815 NOTSUPPORTED, /* SendSavedSMS */
2816 NOTSUPPORTED, /* SetFastSMSSending*/
2810 NOKIA_SetIncomingSMS, 2817 NOKIA_SetIncomingSMS,
@@ -2863,3 +2870,3 @@ GSM_Phone_Functions N6110Phone = {
2863 NOTSUPPORTED, /* SetCalendarSettings */ 2870 NOTSUPPORTED, /* SetCalendarSettings */
2864 NOTSUPPORTED, /* GetNote */ 2871 NOTSUPPORTED, /* GetNextNote */
2865 N6110_GetProfile, 2872 N6110_GetProfile,
diff --git a/gammu/emb/common/phone/nokia/dct3/n7110.c b/gammu/emb/common/phone/nokia/dct3/n7110.c
index 5a02c9c..b597f9b 100644
--- a/gammu/emb/common/phone/nokia/dct3/n7110.c
+++ b/gammu/emb/common/phone/nokia/dct3/n7110.c
@@ -1,3 +1,6 @@
1/* (c) 2001-2004 by Marcin Wiacek */ 1/* (c) 2001-2004 by Marcin Wiacek */
2/* based on some work from Markus Plail and Gnokii */ 2/* based on some Markus Plail work from Gnokii (www.gnokii.org)
3 * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
4 * GNU GPL version 2 or later
5 */
3 6
@@ -528,2 +531,3 @@ static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
528 case RING_MIDI: 531 case RING_MIDI:
532 case RING_MMF:
529 return ERR_NOTSUPPORTED; 533 return ERR_NOTSUPPORTED;
@@ -1649,2 +1653,3 @@ GSM_Phone_Functions N7110Phone = {
1649 NOTSUPPORTED, /* SendSavedSMS */ 1653 NOTSUPPORTED, /* SendSavedSMS */
1654 NOTSUPPORTED, /* SetFastSMSSending*/
1650 N7110_SetIncomingSMS, 1655 N7110_SetIncomingSMS,
@@ -1703,3 +1708,3 @@ GSM_Phone_Functions N7110Phone = {
1703 NOTSUPPORTED, /* SetCalendarSettings*/ 1708 NOTSUPPORTED, /* SetCalendarSettings*/
1704 NOTSUPPORTED, /* GetNote */ 1709 NOTSUPPORTED, /* GetNextNote */
1705 N7110_GetProfile, 1710 N7110_GetProfile,
diff --git a/gammu/emb/common/phone/nokia/dct3/n9210.c b/gammu/emb/common/phone/nokia/dct3/n9210.c
index e82d530..ff71ad3 100644
--- a/gammu/emb/common/phone/nokia/dct3/n9210.c
+++ b/gammu/emb/common/phone/nokia/dct3/n9210.c
@@ -321,2 +321,3 @@ GSM_Phone_Functions N9210Phone = {
321 NOTSUPPORTED, /* SendSavedSMS */ 321 NOTSUPPORTED, /* SendSavedSMS */
322 NOTSUPPORTED, /* SetFastSMSSending*/
322 N9210_SetIncomingSMS, 323 N9210_SetIncomingSMS,
@@ -375,3 +376,3 @@ GSM_Phone_Functions N9210Phone = {
375 NOTSUPPORTED, /* SetCalendarSettings*/ 376 NOTSUPPORTED, /* SetCalendarSettings*/
376 NOTSUPPORTED, /* GetNote */ 377 NOTSUPPORTED, /* GetNextNote */
377 NOTIMPLEMENTED, /* GetProfile */ 378 NOTIMPLEMENTED, /* GetProfile */
diff --git a/gammu/emb/common/phone/nokia/dct4/n3320.c b/gammu/emb/common/phone/nokia/dct4/n3320.c
index 51e6f18..9b1d6cd 100644
--- a/gammu/emb/common/phone/nokia/dct4/n3320.c
+++ b/gammu/emb/common/phone/nokia/dct4/n3320.c
@@ -196,2 +196,3 @@ GSM_Phone_Functions N3320Phone = {
196 NOTSUPPORTED, /* SendSavedSMS */ 196 NOTSUPPORTED, /* SendSavedSMS */
197 NOTSUPPORTED, /* SetFastSMSSending*/
197 NOTSUPPORTED, /* SetIncomingSMS */ 198 NOTSUPPORTED, /* SetIncomingSMS */
@@ -250,3 +251,3 @@ GSM_Phone_Functions N3320Phone = {
250 NOTSUPPORTED, /* SetCalendarSettings*/ 251 NOTSUPPORTED, /* SetCalendarSettings*/
251 NOTSUPPORTED, /* GetNote */ 252 NOTSUPPORTED, /* GetNextNote */
252 NOTSUPPORTED, /* GetProfile */ 253 NOTSUPPORTED, /* GetProfile */
diff --git a/gammu/emb/common/phone/nokia/dct4/n3650.c b/gammu/emb/common/phone/nokia/dct4/n3650.c
index 2da55bf..d4746a7 100644
--- a/gammu/emb/common/phone/nokia/dct4/n3650.c
+++ b/gammu/emb/common/phone/nokia/dct4/n3650.c
@@ -317,2 +317,3 @@ GSM_Phone_Functions N3650Phone = {
317 NOTSUPPORTED, /* SendSavedSMS */ 317 NOTSUPPORTED, /* SendSavedSMS */
318 NOTSUPPORTED, /* SetFastSMSSending*/
318 NOTSUPPORTED, /* SetIncomingSMS */ 319 NOTSUPPORTED, /* SetIncomingSMS */
@@ -371,3 +372,3 @@ GSM_Phone_Functions N3650Phone = {
371 NOTSUPPORTED, /* SetCalendarSettings*/ 372 NOTSUPPORTED, /* SetCalendarSettings*/
372 NOTSUPPORTED, /* GetNote */ 373 NOTSUPPORTED, /* GetNextNote */
373 NOTSUPPORTED, /* GetProfile */ 374 NOTSUPPORTED, /* GetProfile */
diff --git a/gammu/emb/common/phone/nokia/dct4/n6510.c b/gammu/emb/common/phone/nokia/dct4/n6510.c
index 67fe492..2208def 100644
--- a/gammu/emb/common/phone/nokia/dct4/n6510.c
+++ b/gammu/emb/common/phone/nokia/dct4/n6510.c
@@ -1,3 +1,6 @@
1/* (c) 2002-2004 by Marcin Wiacek */ 1/* (c) 2002-2004 by Marcin Wiacek */
2/* based on some work from Markus Plail, Pawel Kot and Gnokii */ 2/* based on some Markus Plail, Pawel Kot work from Gnokii (www.gnokii.org)
3 * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot
4 * GNU GPL version 2 or later
5 */
3/* function for making CRC for filesystem (c) 2003 by Michael Schroeder */ 6/* function for making CRC for filesystem (c) 2003 by Michael Schroeder */
@@ -121,2 +124,4 @@ static GSM_Error N6510_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *
121 Data->SMSC->Validity.Relative= msg.Buffer[12]; 124 Data->SMSC->Validity.Relative= msg.Buffer[12];
125 if (msg.Buffer[12] == 0x00) Data->SMSC->Validity.Relative = SMS_VALID_Max_Time;
126
122 current = 14; 127 current = 14;
@@ -267,3 +272,3 @@ static GSM_Error N6510_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMa
267 272
268 smprintf(s, "Network status: "); 273 smprintf(s, "Network status : ");
269 switch (msg.Buffer[8]) { 274 switch (msg.Buffer[8]) {
@@ -987,2 +992,3 @@ static GSM_Error N6510_ReplyGetOperatorLogo(GSM_Protocol_Message msg, GSM_StateM
987 smprintf(s, "Operator logo received\n"); 992 smprintf(s, "Operator logo received\n");
993 if (msg.Length == 18) return ERR_EMPTY;
988 NOKIA_DecodeNetworkCode(msg.Buffer+12,Data->Bitmap->NetworkCode); 994 NOKIA_DecodeNetworkCode(msg.Buffer+12,Data->Bitmap->NetworkCode);
@@ -991,3 +997,2 @@ static GSM_Error N6510_ReplyGetOperatorLogo(GSM_Protocol_Message msg, GSM_StateM
991 Data->Bitmap->BitmapHeight= msg.Buffer[21]; 997 Data->Bitmap->BitmapHeight= msg.Buffer[21];
992 if (msg.Length == 18) return ERR_EMPTY;
993 PHONE_DecodeBitmap(GSM_Nokia6510OperatorLogo,msg.Buffer+26,Data->Bitmap); 998 PHONE_DecodeBitmap(GSM_Nokia6510OperatorLogo,msg.Buffer+26,Data->Bitmap);
@@ -1767,3 +1772,4 @@ static GSM_Error N6510_GetSyncMLSettings(GSM_StateMachine *s, GSM_SyncMLSettings
1767 settings->Name[1] = 0; 1772 settings->Name[1] = 0;
1768 //s->Phone.Data.SyncMLSettings = settings; 1773 s->Phone.Data.SyncMLSettings = settings;
1774
1769 //smprintf(s, "Getting SyncML settings name\n"); 1775 //smprintf(s, "Getting SyncML settings name\n");
@@ -2285,3 +2291,3 @@ static GSM_Error N6510_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMa
2285 case 0x00: 2291 case 0x00:
2286 smprintf(s, "SMS sent OK, TPMR for sent sms is %02x\n",msg.Buffer[10]); 2292 smprintf(s, "SMS sent OK, TPMR for sent sms is %d\n",msg.Buffer[10]);
2287 if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,0,msg.Buffer[10]); 2293 if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,0,msg.Buffer[10]);
@@ -2772,2 +2778,3 @@ static GSM_Error N6510_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone,
2772 case RING_MIDI: 2778 case RING_MIDI:
2779 case RING_MMF:
2773 return ERR_NOTSUPPORTED; 2780 return ERR_NOTSUPPORTED;
@@ -2988,2 +2995,5 @@ static GSM_Error N6510_GetProfile(GSM_StateMachine *s, GSM_Profile *Profile)
2988 } 2995 }
2996 if (!strcmp(s->Phone.Data.ModelInfo->model,"5140")) {
2997 return ERR_NOTSUPPORTED;
2998 }
2989 2999
@@ -3117,5 +3127,17 @@ static GSM_Error N6510_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShow
3117{ 3127{
3128 unsigned int pos2 = 15;
3118 unsigned intpos = 4; 3129 unsigned intpos = 4;
3130 unsigned char req2[100] = {N6110_FRAME_HEADER,0x01,
3131 0x00,0x02,0x07,0x04,
3132 0x01, // 1 - voice, 2 - data
3133 0x00,0x03,
3134 0x18, // length of rest + 1
3135 0x00,0x00,0x00};
3119 unsigned char req[100] = {N6110_FRAME_HEADER,0x01, 3136 unsigned char req[100] = {N6110_FRAME_HEADER,0x01,
3120 0x0c};/* Number length */ 3137 0x0c};/* Number length */
3138 GSM_Errorerror;
3139
3140 /* USSD not supported */
3141 if (number[0] == '*') return ERR_NOTSUPPORTED;
3142 if (number[0] == '#') return ERR_NOTSUPPORTED;
3121 3143
@@ -3142,5 +3164,17 @@ static GSM_Error N6510_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShow
3142 } 3164 }
3165 smprintf(s, "Making voice call\n");
3166 error = GSM_WaitFor (s, req, pos, 0x01, 4, ID_DialVoice);
3167 if (error != ERR_NOTSUPPORTED) return error;
3168
3169 if (ShowNumber != GSM_CALL_DefaultNumberPresence) return ERR_NOTSUPPORTED;
3170
3171 req2[11] = strlen(number)*2+6;
3172 req2[pos2++] = strlen(number);
3173 EncodeUnicode(req2+pos2,number,strlen(number));
3174 pos2 += strlen(number)*2;
3143 3175
3144 smprintf(s, "Making voice call\n"); 3176 smprintf(s, "Making voice call\n");
3145 return GSM_WaitFor (s, req, pos, 0x01, 4, ID_DialVoice); 3177 error = GSM_WaitFor (s, req2, pos2, 0x01, 4, ID_DialVoice);
3178 if (error == ERR_NOTSUPPORTED) return ERR_NONE;
3179 return error;
3146} 3180}
@@ -3176,5 +3210,5 @@ static GSM_Error N6510_ReplyGetCalendarInfo3(GSM_Protocol_Message msg, GSM_State
3176/* method 3 */ 3210/* method 3 */
3177static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last, bool Calendar) 3211static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last, char Type)
3178{ 3212{
3179 GSM_Error error; 3213 GSM_Error error = ERR_UNKNOWN;
3180 int i; 3214 int i;
@@ -3182,3 +3216,3 @@ static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLoc
3182 0x00, 0x00,/* First location */ 3216 0x00, 0x00,/* First location */
3183 0x00}; /* 0 = calendar, 1 = ToDo in 6610 style */ 3217 0x00}; /* 0 = calendar, 1 = ToDo in 6610 style, 2 = Notes */
3184 3218
@@ -3187,9 +3221,12 @@ static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLoc
3187 3221
3188 if (Calendar) { 3222 req[10] = Type;
3223 if (Type == 0) {
3189 smprintf(s, "Getting locations for calendar method 3\n"); 3224 smprintf(s, "Getting locations for calendar method 3\n");
3190 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetCalendarNotesInfo); 3225 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetCalendarNotesInfo);
3191 } else { 3226 } else if (Type == 1) {
3192 req[10] = 0x01;
3193 smprintf(s, "Getting locations for ToDo method 2\n"); 3227 smprintf(s, "Getting locations for ToDo method 2\n");
3194 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetToDo); 3228 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetToDo);
3229 } else if (Type == 2) {
3230 smprintf(s, "Getting locations for Notes\n");
3231 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetNote);
3195 } 3232 }
@@ -3209,8 +3246,11 @@ static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLoc
3209 req[9] = Last->Location[i-1] % 256; 3246 req[9] = Last->Location[i-1] % 256;
3210 if (Calendar) { 3247 if (Type == 0) {
3211 smprintf(s, "Getting locations for calendar method 3\n"); 3248 smprintf(s, "Getting locations for calendar method 3\n");
3212 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetCalendarNotesInfo); 3249 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetCalendarNotesInfo);
3213 } else { 3250 } else if (Type == 1) {
3214 smprintf(s, "Getting locations for todo method 2\n"); 3251 smprintf(s, "Getting locations for todo method 2\n");
3215 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetToDo); 3252 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetToDo);
3253 } else if (Type == 2) {
3254 smprintf(s, "Getting locations for Notes\n");
3255 error = GSM_WaitFor (s, req, 11, 0x13, 4, ID_GetNote);
3216 } 3256 }
@@ -3352,2 +3392,14 @@ GSM_Error N6510_ReplyGetCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s)
3352 3392
3393static GSM_Error N6510_PrivGetGenericCalendar3(GSM_StateMachine *s, int Location, GSM_Phone_RequestID ID)
3394{
3395 unsigned char req[] = {N6110_FRAME_HEADER,0x7D,0x00,0x00,0x00,0x00,
3396 0x00,0x99,/* Location */
3397 0xff,0xff,0xff,0xff};
3398
3399 req[8] = Location / 256;
3400 req[9] = Location % 256;
3401
3402 return GSM_WaitFor (s, req, 14, 0x13, 4, ID);
3403}
3404
3353static GSM_Error N6510_PrivGetCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, int *LastCalendarYear) 3405static GSM_Error N6510_PrivGetCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, int *LastCalendarYear)
@@ -3356,5 +3408,2 @@ static GSM_Error N6510_PrivGetCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *
3356 GSM_DateTime date_time; 3408 GSM_DateTime date_time;
3357 unsigned char req[] = {N6110_FRAME_HEADER,0x7D,0x00,0x00,0x00,0x00,
3358 0x00,0x99,/* Location */
3359 0xff,0xff,0xff,0xff,0x01};
3360 3409
@@ -3381,8 +3430,5 @@ static GSM_Error N6510_PrivGetCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *
3381 3430
3382 req[8] = Note->Location / 256;
3383 req[9] = Note->Location % 256;
3384
3385 s->Phone.Data.Cal=Note; 3431 s->Phone.Data.Cal=Note;
3386 smprintf(s, "Getting calendar note method 3\n"); 3432 smprintf(s, "Getting calendar note method 3\n");
3387 return GSM_WaitFor (s, req, 15, 0x13, 4, ID_GetCalendarNote); 3433 return N6510_PrivGetGenericCalendar3(s, Note->Location, ID_GetCalendarNote);
3388} 3434}
@@ -3396,3 +3442,3 @@ GSM_Error N6510_GetNextCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, b
3396 if (start) { 3442 if (start) {
3397 error=N6510_GetCalendarInfo3(s,LastCalendar,true); 3443 error=N6510_GetCalendarInfo3(s,LastCalendar,0);
3398 if (error!=ERR_NONE) return error; 3444 if (error!=ERR_NONE) return error;
@@ -3479,3 +3525,3 @@ static GSM_Error N6510_FindCalendarIconID3(GSM_StateMachine *s, GSM_CalendarEntr
3479 3525
3480 error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,true); 3526 error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,0);
3481 memcpy(&LastCalendar1,&Priv->LastCalendar,sizeof(GSM_NOKIACalToDoLocations)); 3527 memcpy(&LastCalendar1,&Priv->LastCalendar,sizeof(GSM_NOKIACalToDoLocations));
@@ -3496,3 +3542,3 @@ static GSM_Error N6510_FindCalendarIconID3(GSM_StateMachine *s, GSM_CalendarEntr
3496 3542
3497 error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,true); 3543 error=N6510_GetCalendarInfo3(s, &Priv->LastCalendar,0);
3498 memcpy(&LastCalendar2,&Priv->LastCalendar,sizeof(GSM_NOKIACalToDoLocations)); 3544 memcpy(&LastCalendar2,&Priv->LastCalendar,sizeof(GSM_NOKIACalToDoLocations));
@@ -3739,3 +3785,3 @@ static GSM_Error N6510_GetCalendarStatus(GSM_StateMachine *s, GSM_CalendarStatus
3739 /* Method 3 */ 3785 /* Method 3 */
3740 error=N6510_GetCalendarInfo3(s,&s->Phone.Data.Priv.N6510.LastCalendar,true); 3786 error=N6510_GetCalendarInfo3(s,&s->Phone.Data.Priv.N6510.LastCalendar,0);
3741 if (error!=ERR_NONE) return error; 3787 if (error!=ERR_NONE) return error;
@@ -3974,2 +4020,38 @@ static GSM_Error N6510_ShowStartInfo(GSM_StateMachine *s, bool enable)
3974 4020
4021static GSM_Error N6510_ReplyGetNoteInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
4022{
4023 return N6510_ReplyGetCalendarInfo3(msg, s, &s->Phone.Data.Priv.N6510.LastNote);
4024}
4025
4026static GSM_Error N6510_ReplyGetNote(GSM_Protocol_Message msg, GSM_StateMachine *s)
4027{
4028 smprintf(s, "Note received\n");
4029 memcpy(s->Phone.Data.Note->Text,msg.Buffer+54,(msg.Buffer[50]*256+msg.Buffer[51])*2);
4030 s->Phone.Data.Note->Text[(msg.Buffer[50]*256+msg.Buffer[51])*2] = 0;
4031 s->Phone.Data.Note->Text[(msg.Buffer[50]*256+msg.Buffer[51])*2+1] = 0;
4032 return ERR_NONE;
4033}
4034
4035GSM_Error N6510_GetNextNote(GSM_StateMachine *s, GSM_NoteEntry *Note, bool start)
4036{
4037 GSM_Error error;
4038 GSM_NOKIACalToDoLocations *LastNote = &s->Phone.Data.Priv.N6510.LastNote;
4039
4040 if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOTES)) return ERR_NOTSUPPORTED;
4041
4042 if (start) {
4043 error=N6510_GetCalendarInfo3(s,LastNote,2);
4044 if (error!=ERR_NONE) return error;
4045 Note->Location = 1;
4046 } else {
4047 Note->Location++;
4048 }
4049
4050 if (Note->Location > LastNote->Number) return ERR_EMPTY;
4051
4052 s->Phone.Data.Note = Note;
4053 smprintf(s, "Getting note\n");
4054 return N6510_PrivGetGenericCalendar3(s, LastNote->Location[Note->Location-1], ID_GetNote);
4055}
4056
3975static int N6510_FindFileCheckSum(unsigned char *ptr, int len) 4057static int N6510_FindFileCheckSum(unsigned char *ptr, int len)
@@ -4057,3 +4139,3 @@ static GSM_Error N6510_ReplyGetFileFolderInfo(GSM_Protocol_Message msg, GSM_Stat
4057 File->Type = GSM_File_Java_JAR; 4139 File->Type = GSM_File_Java_JAR;
4058#if DEVELOP 4140#ifdef DEVELOP
4059 else if (msg.Buffer[i]==0x00 && msg.Buffer[i+2]==0x01) 4141 else if (msg.Buffer[i]==0x00 && msg.Buffer[i+2]==0x01)
@@ -4400,3 +4482,3 @@ static GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, int *Pos
4400 error = N6510_SearchForFileName(s,File); 4482 error = N6510_SearchForFileName(s,File);
4401 if (error == ERR_NONE) return ERR_INVALIDLOCATION; 4483 if (error == ERR_NONE) return ERR_FILEALREADYEXIST;
4402 if (error != ERR_EMPTY) return error; 4484 if (error != ERR_EMPTY) return error;
@@ -4816,3 +4898,3 @@ static GSM_Error N6510_GetToDoStatus2(GSM_StateMachine *s, GSM_ToDoStatus *statu
4816 4898
4817 error = N6510_GetCalendarInfo3(s,LastToDo,false); 4899 error = N6510_GetCalendarInfo3(s,LastToDo,1);
4818 if (error!=ERR_NONE) return error; 4900 if (error!=ERR_NONE) return error;
@@ -4946,4 +5028,3 @@ static GSM_Error N6510_ReplyGetToDo2(GSM_Protocol_Message msg, GSM_StateMachine
4946 5028
4947 if (msg.Buffer[14] == 0xFF && msg.Buffer[15] == 0xFF && msg.Buffer[16] == 0xff && msg.Buffer[17] == 0xff) 5029 if (msg.Buffer[14] == 0xFF && msg.Buffer[15] == 0xFF && msg.Buffer[16] == 0xff && msg.Buffer[17] == 0xff) {
4948 {
4949 smprintf(s, "No alarm\n"); 5030 smprintf(s, "No alarm\n");
@@ -4980,10 +5061,5 @@ static GSM_Error N6510_GetNextToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bo
4980 GSM_NOKIACalToDoLocations *LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; 5061 GSM_NOKIACalToDoLocations *LastToDo = &s->Phone.Data.Priv.N6510.LastToDo;
4981 /* The same to getting calendar method 3 */
4982 unsigned char req[] = {
4983 N6110_FRAME_HEADER,0x7D,0x00,0x00,0x00,0x00,
4984 0x00,0x99, /* Location */
4985 0xff,0xff,0xff,0xff,0x01};
4986 5062
4987 if (refresh) { 5063 if (refresh) {
4988 error=N6510_GetCalendarInfo3(s,LastToDo,false); 5064 error=N6510_GetCalendarInfo3(s,LastToDo,1);
4989 if (error!=ERR_NONE) return error; 5065 if (error!=ERR_NONE) return error;
@@ -4996,8 +5072,5 @@ static GSM_Error N6510_GetNextToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bo
4996 5072
4997 req[8] = LastToDo->Location[ToDo->Location-1] / 256;
4998 req[9] = LastToDo->Location[ToDo->Location-1] % 256;
4999
5000 s->Phone.Data.ToDo = ToDo; 5073 s->Phone.Data.ToDo = ToDo;
5001 smprintf(s, "Getting todo method 2\n"); 5074 smprintf(s, "Getting todo method 2\n");
5002 return GSM_WaitFor (s, req, 15, 0x13, 4, ID_GetToDo); 5075 return N6510_PrivGetGenericCalendar3(s, LastToDo->Location[ToDo->Location-1], ID_GetToDo);
5003} 5076}
@@ -5045,3 +5118,3 @@ static GSM_Error N6510_DeleteToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
5045 5118
5046 error=N6510_GetCalendarInfo3(s,LastToDo,false); 5119 error=N6510_GetCalendarInfo3(s,LastToDo,1);
5047 if (error!=ERR_NONE) return error; 5120 if (error!=ERR_NONE) return error;
@@ -5453,2 +5526,5 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
5453 {N71_65_ReplyCallInfo, "\x01",0x03,0x0C,ID_IncomingFrame }, 5526 {N71_65_ReplyCallInfo, "\x01",0x03,0x0C,ID_IncomingFrame },
5527 {N71_65_ReplyCallInfo, "\x01",0x03,0x0F,ID_IncomingFrame },
5528 {N71_65_ReplyCallInfo, "\x01",0x03,0x10,ID_DialVoice },
5529 {N71_65_ReplyCallInfo, "\x01",0x03,0x10,ID_IncomingFrame },
5454 {N71_65_ReplyCallInfo, "\x01",0x03,0x23,ID_IncomingFrame }, 5530 {N71_65_ReplyCallInfo, "\x01",0x03,0x23,ID_IncomingFrame },
@@ -5460,2 +5536,5 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
5460 {N71_65_ReplySendDTMF, "\x01",0x03,0x5E,ID_SendDTMF }, 5536 {N71_65_ReplySendDTMF, "\x01",0x03,0x5E,ID_SendDTMF },
5537 {N71_65_ReplyCallInfo, "\x01",0x03,0xA6,ID_IncomingFrame },
5538 {N71_65_ReplyCallInfo, "\x01",0x03,0xD2,ID_IncomingFrame },
5539 {N71_65_ReplyCallInfo, "\x01",0x03,0xD3,ID_IncomingFrame },
5461 5540
@@ -5510,2 +5589,3 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
5510 {N6510_ReplyGetToDo2, "\x13",0x03,0x7E,ID_GetToDo }, 5589 {N6510_ReplyGetToDo2, "\x13",0x03,0x7E,ID_GetToDo },
5590 {N6510_ReplyGetNote, "\x13",0x03,0x7E,ID_GetNote },
5511 {N6510_ReplyGetCalendarSettings, "\x13",0x03,0x86,ID_GetCalendarSettings }, 5591 {N6510_ReplyGetCalendarSettings, "\x13",0x03,0x86,ID_GetCalendarSettings },
@@ -5517,2 +5597,3 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
5517 {N6510_ReplyGetToDoStatus2, "\x13",0x03,0x9F,ID_GetToDo }, 5597 {N6510_ReplyGetToDoStatus2, "\x13",0x03,0x9F,ID_GetToDo },
5598 {N6510_ReplyGetNoteInfo, "\x13",0x03,0x9F,ID_GetNote },
5518 5599
@@ -5653,3 +5734,3 @@ static GSM_Reply_Function N6510ReplyFunctions[] = {
5653GSM_Phone_Functions N6510Phone = { 5734GSM_Phone_Functions N6510Phone = {
5654 "1100|1100a|1100b|3100|3100b|3108|3200|3200a|3300|3510|3510i|3530|3589i|3590|3595|5100|6100|6200|6220|6230|6310|6310i|6385|6510|6610|6800|7210|7250|7250i|7600|8310|8390|8910|8910i", 5735 "1100|1100a|1100b|3100|3100b|3108|3200|3200a|3300|3510|3510i|3530|3589i|3590|3595|5100|5140|6100|6200|6220|6230|6310|6310i|6385|6510|6610|6610i|6800|6810|6820|7210|7250|7250i|7600|8310|8390|8910|8910i",
5655 N6510ReplyFunctions, 5736 N6510ReplyFunctions,
@@ -5707,2 +5788,3 @@ GSM_Phone_Functions N6510Phone = {
5707 NOTSUPPORTED, /* SendSavedSMS */ 5788 NOTSUPPORTED, /* SendSavedSMS */
5789 NOTSUPPORTED, /* SetFastSMSSending*/
5708 NOKIA_SetIncomingSMS, 5790 NOKIA_SetIncomingSMS,
@@ -5761,3 +5843,3 @@ GSM_Phone_Functions N6510Phone = {
5761 NOTSUPPORTED, /* SetCalendarSettings*/ 5843 NOTSUPPORTED, /* SetCalendarSettings*/
5762 NOTIMPLEMENTED, /* GetNote */ 5844 N6510_GetNextNote,
5763 N6510_GetProfile, 5845 N6510_GetProfile,
diff --git a/gammu/emb/common/phone/nokia/dct4/n6510.h b/gammu/emb/common/phone/nokia/dct4/n6510.h
index 4717aeb..26623d6 100644
--- a/gammu/emb/common/phone/nokia/dct4/n6510.h
+++ b/gammu/emb/common/phone/nokia/dct4/n6510.h
@@ -36,2 +36,4 @@ typedef struct {
36 36
37 GSM_NOKIACalToDoLocationsLastNote;
38
37 unsigned char RingtoneID;/* When set with preview */ 39 unsigned char RingtoneID;/* When set with preview */
diff --git a/gammu/emb/common/phone/nokia/nauto.c b/gammu/emb/common/phone/nokia/nauto.c
index bf74bc9..3bb53ec 100644
--- a/gammu/emb/common/phone/nokia/nauto.c
+++ b/gammu/emb/common/phone/nokia/nauto.c
@@ -123,3 +123,3 @@ GSM_Phone_Functions NAUTOPhone = {
123 NOTSUPPORTED, /* SetCalendarSettings*/ 123 NOTSUPPORTED, /* SetCalendarSettings*/
124 NOTSUPPORTED, /* GetNote */ 124 NOTSUPPORTED, /* GetNextNote */
125 NOTSUPPORTED, /* GetProfile */ 125 NOTSUPPORTED, /* GetProfile */
diff --git a/gammu/emb/common/phone/nokia/nfunc.c b/gammu/emb/common/phone/nokia/nfunc.c
index 3acfb10..d4d8b03 100644
--- a/gammu/emb/common/phone/nokia/nfunc.c
+++ b/gammu/emb/common/phone/nokia/nfunc.c
@@ -1395,2 +1395,7 @@ GSM_Error N71_65_ReplyCallInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
1395 break; 1395 break;
1396 case 0x0f:
1397 case 0x10:
1398 smprintf(s, "Meaning not known\n");
1399 call.CallIDAvailable = false;
1400 break;
1396 case 0x23: 1401 case 0x23:
@@ -1418,2 +1423,8 @@ GSM_Error N71_65_ReplyCallInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
1418 break; 1423 break;
1424 case 0xA6:
1425 case 0xD2:
1426 case 0xD3:
1427 smprintf(s, "Meaning not known\n");
1428 call.CallIDAvailable = false;
1429 break;
1419 } 1430 }
@@ -1424,2 +1435,5 @@ GSM_Error N71_65_ReplyCallInfo(GSM_Protocol_Message msg, GSM_StateMachine *s)
1424 } 1435 }
1436 if (s->Phone.Data.RequestID == ID_DialVoice) {
1437 if (msg.Buffer[3] == 0x10) return ERR_NOTSUPPORTED;
1438 }
1425 if (s->Phone.Data.RequestID == ID_CancelCall) { 1439 if (s->Phone.Data.RequestID == ID_CancelCall) {