author | zautrix <zautrix> | 2004-10-05 11:13:51 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2004-10-05 11:13:51 (UTC) |
commit | 50ab40e1e02ad7c65c17a78d08116a808b1257aa (patch) (unidiff) | |
tree | 0d1939e2297fa7bbd8e1f2030f154463854164c6 /gammu/emb/common/phone/nokia | |
parent | cf8616f64f20e5448d4ff644f7cc15750cf3f85f (diff) | |
download | kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.zip kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.gz kdepimpi-50ab40e1e02ad7c65c17a78d08116a808b1257aa.tar.bz2 |
updated to latest gammu version
Diffstat (limited to 'gammu/emb/common/phone/nokia') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/dct3func.c | 16 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/dct3func.h | 2 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/n6110.c | 17 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/n7110.c | 9 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/n9210.c | 3 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct4/n3320.c | 3 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct4/n3650.c | 3 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct4/n6510.c | 168 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/dct4/n6510.h | 2 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/nauto.c | 2 | ||||
-rw-r--r-- | gammu/emb/common/phone/nokia/nfunc.c | 14 |
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,27 +1,30 @@ | |||
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 | ||
5 | #include <string.h> /* memcpy only */ | 8 | #include <string.h> /* memcpy only */ |
6 | #include <stdio.h> | 9 | #include <stdio.h> |
7 | #include <ctype.h> | 10 | #include <ctype.h> |
8 | 11 | ||
9 | #include "../../../gsmstate.h" | 12 | #include "../../../gsmstate.h" |
10 | #include "../../../misc/coding/coding.h" | 13 | #include "../../../misc/coding/coding.h" |
11 | #include "../../../service/sms/gsmsms.h" | 14 | #include "../../../service/sms/gsmsms.h" |
12 | #include "../../pfunc.h" | 15 | #include "../../pfunc.h" |
13 | #include "../nfunc.h" | 16 | #include "../nfunc.h" |
14 | #include "dct3func.h" | 17 | #include "dct3func.h" |
15 | 18 | ||
16 | #ifdef GSM_ENABLE_NOKIA_DCT3 | 19 | #ifdef GSM_ENABLE_NOKIA_DCT3 |
17 | 20 | ||
18 | GSM_Error DCT3_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) | 21 | GSM_Error DCT3_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) |
19 | { | 22 | { |
20 | GSM_Error error; | 23 | GSM_Error error; |
21 | 24 | ||
22 | /* We have to enable WAP frames in phone */ | 25 | /* We have to enable WAP frames in phone */ |
23 | error=DCT3DCT4_EnableWAPFunctions(s); | 26 | error=DCT3DCT4_EnableWAPFunctions(s); |
24 | if (error!=ERR_NONE) return error; | 27 | if (error!=ERR_NONE) return error; |
25 | 28 | ||
26 | return DCT3DCT4_DeleteWAPBookmarkPart(s,bookmark); | 29 | return DCT3DCT4_DeleteWAPBookmarkPart(s,bookmark); |
27 | } | 30 | } |
@@ -373,115 +376,116 @@ GSM_Error DCT3_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm, unsigned char msg | |||
373 | req[8] = alarm->DateTime.Hour; | 376 | req[8] = alarm->DateTime.Hour; |
374 | req[9] = alarm->DateTime.Minute; | 377 | req[9] = alarm->DateTime.Minute; |
375 | 378 | ||
376 | smprintf(s, "Setting alarm\n"); | 379 | smprintf(s, "Setting alarm\n"); |
377 | return GSM_WaitFor (s, req, 11, msgtype, 4, ID_SetAlarm); | 380 | return GSM_WaitFor (s, req, 11, msgtype, 4, ID_SetAlarm); |
378 | } | 381 | } |
379 | 382 | ||
380 | GSM_Error DCT3_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *s) | 383 | GSM_Error DCT3_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *s) |
381 | { | 384 | { |
382 | int i; | 385 | int i; |
383 | GSM_Phone_Data*Data = &s->Phone.Data; | 386 | GSM_Phone_Data*Data = &s->Phone.Data; |
384 | 387 | ||
385 | switch (msg.Buffer[3]) { | 388 | switch (msg.Buffer[3]) { |
386 | case 0x34: | 389 | case 0x34: |
387 | smprintf(s, "SMSC received\n"); | 390 | smprintf(s, "SMSC received\n"); |
388 | Data->SMSC->Format = SMS_FORMAT_Text; | 391 | Data->SMSC->Format = SMS_FORMAT_Text; |
389 | switch (msg.Buffer[6]) { | 392 | switch (msg.Buffer[6]) { |
390 | case 0x00: Data->SMSC->Format = SMS_FORMAT_Text; break; | 393 | case 0x00: Data->SMSC->Format = SMS_FORMAT_Text; break; |
391 | case 0x22: Data->SMSC->Format = SMS_FORMAT_Fax; break; | 394 | case 0x22: Data->SMSC->Format = SMS_FORMAT_Fax; break; |
392 | case 0x26: Data->SMSC->Format = SMS_FORMAT_Pager;break; | 395 | case 0x26: Data->SMSC->Format = SMS_FORMAT_Pager;break; |
393 | case 0x32: Data->SMSC->Format = SMS_FORMAT_Email;break; | 396 | case 0x32: Data->SMSC->Format = SMS_FORMAT_Email;break; |
394 | } | 397 | } |
395 | Data->SMSC->Validity.Format = SMS_Validity_RelativeFormat; | 398 | Data->SMSC->Validity.Format = SMS_Validity_RelativeFormat; |
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 | ||
398 | i=33; | 402 | i=33; |
399 | while (msg.Buffer[i]!=0) {i++;} | 403 | while (msg.Buffer[i]!=0) {i++;} |
400 | i=i-33; | 404 | i=i-33; |
401 | if (i>GSM_MAX_SMSC_NAME_LENGTH) { | 405 | if (i>GSM_MAX_SMSC_NAME_LENGTH) { |
402 | smprintf(s, "Too long name\n"); | 406 | smprintf(s, "Too long name\n"); |
403 | return ERR_UNKNOWNRESPONSE; | 407 | return ERR_UNKNOWNRESPONSE; |
404 | } | 408 | } |
405 | EncodeUnicode(Data->SMSC->Name,msg.Buffer+33,i); | 409 | EncodeUnicode(Data->SMSC->Name,msg.Buffer+33,i); |
406 | smprintf(s, "Name \"%s\"\n", DecodeUnicodeString(Data->SMSC->Name)); | 410 | smprintf(s, "Name \"%s\"\n", DecodeUnicodeString(Data->SMSC->Name)); |
407 | 411 | ||
408 | GSM_UnpackSemiOctetNumber(Data->SMSC->DefaultNumber,msg.Buffer+9,true); | 412 | GSM_UnpackSemiOctetNumber(Data->SMSC->DefaultNumber,msg.Buffer+9,true); |
409 | smprintf(s, "Default number \"%s\"\n", DecodeUnicodeString(Data->SMSC->DefaultNumber)); | 413 | smprintf(s, "Default number \"%s\"\n", DecodeUnicodeString(Data->SMSC->DefaultNumber)); |
410 | 414 | ||
411 | GSM_UnpackSemiOctetNumber(Data->SMSC->Number,msg.Buffer+21,false); | 415 | GSM_UnpackSemiOctetNumber(Data->SMSC->Number,msg.Buffer+21,false); |
412 | smprintf(s, "Number \"%s\"\n", DecodeUnicodeString(Data->SMSC->Number)); | 416 | smprintf(s, "Number \"%s\"\n", DecodeUnicodeString(Data->SMSC->Number)); |
413 | 417 | ||
414 | return ERR_NONE; | 418 | return ERR_NONE; |
415 | case 0x35: | 419 | case 0x35: |
416 | smprintf(s, "Getting SMSC failed\n"); | 420 | smprintf(s, "Getting SMSC failed\n"); |
417 | return ERR_INVALIDLOCATION; | 421 | return ERR_INVALIDLOCATION; |
418 | } | 422 | } |
419 | return ERR_UNKNOWNRESPONSE; | 423 | return ERR_UNKNOWNRESPONSE; |
420 | } | 424 | } |
421 | 425 | ||
422 | GSM_Error DCT3_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc) | 426 | GSM_Error DCT3_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc) |
423 | { | 427 | { |
424 | unsigned char req[] = {N6110_FRAME_HEADER, 0x33, 0x64, | 428 | unsigned char req[] = {N6110_FRAME_HEADER, 0x33, 0x64, |
425 | 0x00}; /* Location */ | 429 | 0x00}; /* Location */ |
426 | 430 | ||
427 | if (smsc->Location==0x00) return ERR_INVALIDLOCATION; | 431 | if (smsc->Location==0x00) return ERR_INVALIDLOCATION; |
428 | 432 | ||
429 | req[5]=smsc->Location; | 433 | req[5]=smsc->Location; |
430 | 434 | ||
431 | s->Phone.Data.SMSC=smsc; | 435 | s->Phone.Data.SMSC=smsc; |
432 | smprintf(s, "Getting SMSC\n"); | 436 | smprintf(s, "Getting SMSC\n"); |
433 | return GSM_WaitFor (s, req, 6, 0x02, 4, ID_GetSMSC); | 437 | return GSM_WaitFor (s, req, 6, 0x02, 4, ID_GetSMSC); |
434 | } | 438 | } |
435 | 439 | ||
436 | GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 440 | GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
437 | { | 441 | { |
438 | int count; | 442 | int count; |
439 | GSM_Phone_Data*Data = &s->Phone.Data; | 443 | GSM_Phone_Data*Data = &s->Phone.Data; |
440 | #ifdef DEBUG | 444 | #ifdef DEBUG |
441 | GSM_NetworkInfo NetInfo; | 445 | GSM_NetworkInfo NetInfo; |
442 | char name[100]; | 446 | char name[100]; |
443 | 447 | ||
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]) { |
447 | case 0x01: smprintf(s, "home network"); break; | 451 | case 0x01: smprintf(s, "home network"); break; |
448 | case 0x02: smprintf(s, "roaming network"); break; | 452 | case 0x02: smprintf(s, "roaming network"); break; |
449 | case 0x03: smprintf(s, "requesting network"); break; | 453 | case 0x03: smprintf(s, "requesting network"); break; |
450 | case 0x04: smprintf(s, "not registered in the network");break; | 454 | case 0x04: smprintf(s, "not registered in the network");break; |
451 | default : smprintf(s, "unknown"); | 455 | default : smprintf(s, "unknown"); |
452 | } | 456 | } |
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) { |
456 | sprintf(NetInfo.CID, "%02x%02x", msg.Buffer[10], msg.Buffer[11]); | 460 | sprintf(NetInfo.CID, "%02x%02x", msg.Buffer[10], msg.Buffer[11]); |
457 | smprintf(s, "CID : %s\n", NetInfo.CID); | 461 | smprintf(s, "CID : %s\n", NetInfo.CID); |
458 | 462 | ||
459 | sprintf(NetInfo.LAC, "%02x%02x", msg.Buffer[12], msg.Buffer[13]); | 463 | sprintf(NetInfo.LAC, "%02x%02x", msg.Buffer[12], msg.Buffer[13]); |
460 | smprintf(s, "LAC : %s\n", NetInfo.LAC); | 464 | smprintf(s, "LAC : %s\n", NetInfo.LAC); |
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 ", |
465 | DecodeUnicodeString(GSM_GetNetworkName(NetInfo.NetworkCode))); | 469 | DecodeUnicodeString(GSM_GetNetworkName(NetInfo.NetworkCode))); |
466 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(NetInfo.NetworkCode))); | 470 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(NetInfo.NetworkCode))); |
467 | 471 | ||
468 | if (msg.Length>18) { | 472 | if (msg.Length>18) { |
469 | if (msg.Buffer[18]==0x00) { | 473 | if (msg.Buffer[18]==0x00) { |
470 | /* In 6210 name is in "normal" Unicode */ | 474 | /* In 6210 name is in "normal" Unicode */ |
471 | memcpy(name,msg.Buffer+18,msg.Buffer[17]*2); | 475 | memcpy(name,msg.Buffer+18,msg.Buffer[17]*2); |
472 | name[msg.Buffer[17]*2]=0x00; | 476 | name[msg.Buffer[17]*2]=0x00; |
473 | name[msg.Buffer[17]*2+1]=0x00; | 477 | name[msg.Buffer[17]*2+1]=0x00; |
474 | smprintf(s, "Network name for phone : %s\n",DecodeUnicodeString(name)); | 478 | smprintf(s, "Network name for phone : %s\n",DecodeUnicodeString(name)); |
475 | } else { | 479 | } else { |
476 | /* In 9210 first 0x00 is cut from Unicode string */ | 480 | /* In 9210 first 0x00 is cut from Unicode string */ |
477 | name[0] = 0; | 481 | name[0] = 0; |
478 | memcpy(name+1,msg.Buffer+18,msg.Buffer[17]*2); | 482 | memcpy(name+1,msg.Buffer+18,msg.Buffer[17]*2); |
479 | name[msg.Buffer[17]*2+1]=0x00; | 483 | name[msg.Buffer[17]*2+1]=0x00; |
480 | name[msg.Buffer[17]*2+2]=0x00; | 484 | name[msg.Buffer[17]*2+2]=0x00; |
481 | smprintf(s, "Network name for phone : %s\n",DecodeUnicodeString(name)); | 485 | smprintf(s, "Network name for phone : %s\n",DecodeUnicodeString(name)); |
482 | } | 486 | } |
483 | } | 487 | } |
484 | } | 488 | } |
485 | #endif | 489 | #endif |
486 | if (Data->RequestID==ID_GetNetworkInfo) { | 490 | if (Data->RequestID==ID_GetNetworkInfo) { |
487 | Data->NetworkInfo->NetworkName[0] = 0x00; | 491 | Data->NetworkInfo->NetworkName[0] = 0x00; |
@@ -1187,53 +1191,53 @@ GSM_Error DCT3_SetWAPSettings(GSM_StateMachine *s, GSM_MultiWAPSettings *setting | |||
1187 | pos++; | 1191 | pos++; |
1188 | if (loc3 != -1) { | 1192 | if (loc3 != -1) { |
1189 | /* Service number or IP address */ | 1193 | /* Service number or IP address */ |
1190 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc3].Service, false); | 1194 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc3].Service, false); |
1191 | /* Code number */ | 1195 | /* Code number */ |
1192 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc3].Code, false); | 1196 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc3].Code, false); |
1193 | } else pos+=2; | 1197 | } else pos+=2; |
1194 | memcpy(SetReq2 + pos, "\x80\x00\x00\x00\x00\x00\x00\x00", 8); | 1198 | memcpy(SetReq2 + pos, "\x80\x00\x00\x00\x00\x00\x00\x00", 8); |
1195 | pos += 8; | 1199 | pos += 8; |
1196 | smprintf(s, "Writing WAP settings part 2 (USSD bearer)\n"); | 1200 | smprintf(s, "Writing WAP settings part 2 (USSD bearer)\n"); |
1197 | error=GSM_WaitFor (s, SetReq2, pos, 0x3f, 4, ID_SetConnectSet); | 1201 | error=GSM_WaitFor (s, SetReq2, pos, 0x3f, 4, ID_SetConnectSet); |
1198 | if (error != ERR_NONE) return error; | 1202 | if (error != ERR_NONE) return error; |
1199 | } | 1203 | } |
1200 | error = DCT3DCT4_SetActiveConnectSet(s, settings); | 1204 | error = DCT3DCT4_SetActiveConnectSet(s, settings); |
1201 | if (error != ERR_NONE) return error; | 1205 | if (error != ERR_NONE) return error; |
1202 | 1206 | ||
1203 | return DCT3DCT4_DisableConnectionFunctions(s); | 1207 | return DCT3DCT4_DisableConnectionFunctions(s); |
1204 | } | 1208 | } |
1205 | 1209 | ||
1206 | GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1210 | GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1207 | { | 1211 | { |
1208 | switch (msg.Buffer[3]) { | 1212 | switch (msg.Buffer[3]) { |
1209 | case 0x02: | 1213 | case 0x02: |
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; |
1213 | case 0x03: | 1217 | case 0x03: |
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; |
1217 | } | 1221 | } |
1218 | return ERR_UNKNOWNRESPONSE; | 1222 | return ERR_UNKNOWNRESPONSE; |
1219 | } | 1223 | } |
1220 | 1224 | ||
1221 | GSM_Error DCT3_SendSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms) | 1225 | GSM_Error DCT3_SendSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms) |
1222 | { | 1226 | { |
1223 | int length; | 1227 | int length; |
1224 | GSM_Error error; | 1228 | GSM_Error error; |
1225 | unsigned char req[256] = {N6110_FRAME_HEADER, 0x01, 0x02, 0x00}; | 1229 | unsigned char req[256] = {N6110_FRAME_HEADER, 0x01, 0x02, 0x00}; |
1226 | 1230 | ||
1227 | error=PHONE_EncodeSMSFrame(s,sms,req+6,PHONE_SMSSubmit,&length, true); | 1231 | error=PHONE_EncodeSMSFrame(s,sms,req+6,PHONE_SMSSubmit,&length, true); |
1228 | if (error != ERR_NONE) return error; | 1232 | if (error != ERR_NONE) return error; |
1229 | 1233 | ||
1230 | smprintf(s, "Sending sms\n"); | 1234 | smprintf(s, "Sending sms\n"); |
1231 | return s->Protocol.Functions->WriteMessage(s, req, 6+length, 0x02); | 1235 | return s->Protocol.Functions->WriteMessage(s, req, 6+length, 0x02); |
1232 | } | 1236 | } |
1233 | 1237 | ||
1234 | GSM_Error DCT3_ReplyNetmonitor(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1238 | GSM_Error DCT3_ReplyNetmonitor(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1235 | { | 1239 | { |
1236 | switch (msg.Buffer[3]) { | 1240 | switch (msg.Buffer[3]) { |
1237 | case 0x00: | 1241 | case 0x00: |
1238 | smprintf(s, "Netmonitor correctly set\n"); | 1242 | smprintf(s, "Netmonitor correctly set\n"); |
1239 | break; | 1243 | break; |
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 | |||
@@ -1,29 +1,31 @@ | |||
1 | /* (c) 2002-2003 by Marcin Wiacek */ | 1 | /* (c) 2002-2003 by Marcin Wiacek */ |
2 | 2 | ||
3 | #ifndef phone_nokia_dct3_h | 3 | #ifndef phone_nokia_dct3_h |
4 | #define phone_nokia_dct3_h | 4 | #define phone_nokia_dct3_h |
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); |
7 | GSM_Error DCT3_ReplyPlayTone (GSM_Protocol_Message msg, GSM_StateMachine *s); | 9 | GSM_Error DCT3_ReplyPlayTone (GSM_Protocol_Message msg, GSM_StateMachine *s); |
8 | GSM_Error DCT3_ReplyEnableSecurity(GSM_Protocol_Message msg, GSM_StateMachine *s); | 10 | GSM_Error DCT3_ReplyEnableSecurity(GSM_Protocol_Message msg, GSM_StateMachine *s); |
9 | GSM_Error DCT3_ReplyGetIMEI (GSM_Protocol_Message msg, GSM_StateMachine *s); | 11 | GSM_Error DCT3_ReplyGetIMEI (GSM_Protocol_Message msg, GSM_StateMachine *s); |
10 | GSM_Error DCT3_ReplyGetSMSC (GSM_Protocol_Message msg, GSM_StateMachine *s); | 12 | GSM_Error DCT3_ReplyGetSMSC (GSM_Protocol_Message msg, GSM_StateMachine *s); |
11 | GSM_Error DCT3_ReplySIMLogin (GSM_Protocol_Message msg, GSM_StateMachine *s); | 13 | GSM_Error DCT3_ReplySIMLogin (GSM_Protocol_Message msg, GSM_StateMachine *s); |
12 | GSM_Error DCT3_ReplySIMLogout (GSM_Protocol_Message msg, GSM_StateMachine *s); | 14 | GSM_Error DCT3_ReplySIMLogout (GSM_Protocol_Message msg, GSM_StateMachine *s); |
13 | GSM_Error DCT3_ReplyGetDateTime (GSM_Protocol_Message msg, GSM_StateMachine *s); | 15 | GSM_Error DCT3_ReplyGetDateTime (GSM_Protocol_Message msg, GSM_StateMachine *s); |
14 | GSM_Error DCT3_ReplyGetAlarm (GSM_Protocol_Message msg, GSM_StateMachine *s); | 16 | GSM_Error DCT3_ReplyGetAlarm (GSM_Protocol_Message msg, GSM_StateMachine *s); |
15 | GSM_Error DCT3_ReplySetDateTime (GSM_Protocol_Message msg, GSM_StateMachine *s); | 17 | GSM_Error DCT3_ReplySetDateTime (GSM_Protocol_Message msg, GSM_StateMachine *s); |
16 | GSM_Error DCT3_ReplySetAlarm (GSM_Protocol_Message msg, GSM_StateMachine *s); | 18 | GSM_Error DCT3_ReplySetAlarm (GSM_Protocol_Message msg, GSM_StateMachine *s); |
17 | GSM_Error DCT3_ReplyDialCommand (GSM_Protocol_Message msg, GSM_StateMachine *s); | 19 | GSM_Error DCT3_ReplyDialCommand (GSM_Protocol_Message msg, GSM_StateMachine *s); |
18 | GSM_Error DCT3_ReplyGetWAPBookmark(GSM_Protocol_Message msg, GSM_StateMachine *s); | 20 | GSM_Error DCT3_ReplyGetWAPBookmark(GSM_Protocol_Message msg, GSM_StateMachine *s); |
19 | GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s); | 21 | GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s); |
20 | GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s); | 22 | GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s); |
21 | GSM_Error DCT3_ReplySetSMSC (GSM_Protocol_Message msg, GSM_StateMachine *s); | 23 | GSM_Error DCT3_ReplySetSMSC (GSM_Protocol_Message msg, GSM_StateMachine *s); |
22 | GSM_Error DCT3_ReplyGetWAPSettings(GSM_Protocol_Message msg, GSM_StateMachine *s); | 24 | GSM_Error DCT3_ReplyGetWAPSettings(GSM_Protocol_Message msg, GSM_StateMachine *s); |
23 | GSM_Error DCT3_ReplySetWAPSettings(GSM_Protocol_Message msg, GSM_StateMachine *s); | 25 | GSM_Error DCT3_ReplySetWAPSettings(GSM_Protocol_Message msg, GSM_StateMachine *s); |
24 | GSM_Error DCT3_ReplyNetmonitor (GSM_Protocol_Message msg, GSM_StateMachine *s); | 26 | GSM_Error DCT3_ReplyNetmonitor (GSM_Protocol_Message msg, GSM_StateMachine *s); |
25 | GSM_Error DCT3_ReplyDeleteSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s); | 27 | GSM_Error DCT3_ReplyDeleteSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s); |
26 | GSM_Error N71_92_ReplyGetSignalQuality(GSM_Protocol_Message msg, GSM_StateMachine *s); | 28 | GSM_Error N71_92_ReplyGetSignalQuality(GSM_Protocol_Message msg, GSM_StateMachine *s); |
27 | GSM_Error N71_92_ReplyGetBatteryCharge(GSM_Protocol_Message msg, GSM_StateMachine *s); | 29 | GSM_Error N71_92_ReplyGetBatteryCharge(GSM_Protocol_Message msg, GSM_StateMachine *s); |
28 | GSM_Error N71_92_ReplyPhoneSetting(GSM_Protocol_Message msg, GSM_StateMachine *s); | 30 | GSM_Error N71_92_ReplyPhoneSetting(GSM_Protocol_Message msg, GSM_StateMachine *s); |
29 | GSM_Error N61_71_ReplyResetPhoneSettings(GSM_Protocol_Message msg, GSM_StateMachine *s); | 31 | GSM_Error N61_71_ReplyResetPhoneSettings(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,28 +1,30 @@ | |||
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 | ||
6 | #include "../../../gsmstate.h" | 8 | #include "../../../gsmstate.h" |
7 | 9 | ||
8 | #ifdef GSM_ENABLE_NOKIA6110 | 10 | #ifdef GSM_ENABLE_NOKIA6110 |
9 | 11 | ||
10 | #include <string.h> | 12 | #include <string.h> |
11 | 13 | ||
12 | #include "../../../../cfg/config.h" | 14 | #include "../../../../cfg/config.h" |
13 | #include "../../../misc/coding/coding.h" | 15 | #include "../../../misc/coding/coding.h" |
14 | #include "../../../service/sms/gsmsms.h" | 16 | #include "../../../service/sms/gsmsms.h" |
15 | #include "../../../gsmcomon.h" | 17 | #include "../../../gsmcomon.h" |
16 | #include "../../pfunc.h" | 18 | #include "../../pfunc.h" |
17 | #include "../nfunc.h" | 19 | #include "../nfunc.h" |
18 | #include "n6110.h" | 20 | #include "n6110.h" |
19 | #include "dct3func.h" | 21 | #include "dct3func.h" |
20 | 22 | ||
21 | static unsigned char N6110_MEMORY_TYPES[] = { | 23 | static unsigned char N6110_MEMORY_TYPES[] = { |
22 | MEM_ME, 0x02, | 24 | MEM_ME, 0x02, |
23 | MEM_SM, 0x03, | 25 | MEM_SM, 0x03, |
24 | MEM_ON, 0x05, | 26 | MEM_ON, 0x05, |
25 | MEM_DC, 0x07, | 27 | MEM_DC, 0x07, |
26 | MEM_RC, 0x08, | 28 | MEM_RC, 0x08, |
27 | MEM_MC, 0x09, | 29 | MEM_MC, 0x09, |
28 | MEM_VM, 0x0b, | 30 | MEM_VM, 0x0b, |
@@ -106,48 +108,49 @@ static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const | |||
106 | if (N6110_Lang_Table[i].Lang == 0) break; | 108 | if (N6110_Lang_Table[i].Lang == 0) break; |
107 | if (N6110_Lang_Table[i].Lang == Priv->PhoneLanguage && | 109 | if (N6110_Lang_Table[i].Lang == Priv->PhoneLanguage && |
108 | N6110_Lang_Table[i].Phone == src[i_len]) { | 110 | N6110_Lang_Table[i].Phone == src[i_len]) { |
109 | dest[o_len*2] = N6110_Lang_Table[i].Unicode1; | 111 | dest[o_len*2] = N6110_Lang_Table[i].Unicode1; |
110 | dest[(o_len*2)+1] = N6110_Lang_Table[i].Unicode2; | 112 | dest[(o_len*2)+1] = N6110_Lang_Table[i].Unicode2; |
111 | i_len++; | 113 | i_len++; |
112 | found = true; | 114 | found = true; |
113 | break; | 115 | break; |
114 | } | 116 | } |
115 | i++; | 117 | i++; |
116 | } | 118 | } |
117 | } | 119 | } |
118 | if (!found) { | 120 | if (!found) { |
119 | i_len += EncodeWithUnicodeAlphabet(&src[i_len], &wc); | 121 | i_len += EncodeWithUnicodeAlphabet(&src[i_len], &wc); |
120 | dest[o_len*2] = (wc >> 8) & 0xff; | 122 | dest[o_len*2] = (wc >> 8) & 0xff; |
121 | dest[(o_len*2)+1] = wc & 0xff; | 123 | dest[(o_len*2)+1] = wc & 0xff; |
122 | } | 124 | } |
123 | } | 125 | } |
124 | dest[o_len*2] = 0; | 126 | dest[o_len*2] = 0; |
125 | dest[(o_len*2)+1] = 0; | 127 | dest[(o_len*2)+1] = 0; |
126 | } | 128 | } |
127 | 129 | ||
128 | #ifndef ENABLE_LGPL | 130 | #ifndef ENABLE_LGPL |
129 | 131 | ||
132 | /* Pavel Janik */ | ||
130 | /* This function provides Nokia authentication protocol. | 133 | /* This function provides Nokia authentication protocol. |
131 | * Nokia authentication protocol is used in the communication between Nokia | 134 | * Nokia authentication protocol is used in the communication between Nokia |
132 | * mobile phones (e.g. Nokia 6110) and Nokia Cellular Data Suite software, | 135 | * mobile phones (e.g. Nokia 6110) and Nokia Cellular Data Suite software, |
133 | * commercially sold by Nokia Corp. | 136 | * commercially sold by Nokia Corp. |
134 | * The authentication scheme is based on the token send by the phone to the | 137 | * The authentication scheme is based on the token send by the phone to the |
135 | * software. The software does it's magic (see the function | 138 | * software. The software does it's magic (see the function |
136 | * N6110_GetNokiaAuthentication) and returns the result back to the phone. | 139 | * N6110_GetNokiaAuthentication) and returns the result back to the phone. |
137 | * If the result is correct the phone responds with the message "Accessory | 140 | * If the result is correct the phone responds with the message "Accessory |
138 | * connected!" displayed on the LCD. Otherwise it will display "Accessory not | 141 | * connected!" displayed on the LCD. Otherwise it will display "Accessory not |
139 | * supported" and some functions will not be available for use (?). | 142 | * supported" and some functions will not be available for use (?). |
140 | * The specification of the protocol is not publicly available, no comment. | 143 | * The specification of the protocol is not publicly available, no comment. |
141 | */ | 144 | */ |
142 | static void N6110_GetNokiaAuthentication(unsigned char *Imei, unsigned char *MagicBytes, unsigned char *MagicResponse) | 145 | static void N6110_GetNokiaAuthentication(unsigned char *Imei, unsigned char *MagicBytes, unsigned char *MagicResponse) |
143 | { | 146 | { |
144 | int i, j, CRC=0; | 147 | int i, j, CRC=0; |
145 | unsigned char Temp[16]; /* This is our temporary working area. */ | 148 | unsigned char Temp[16]; /* This is our temporary working area. */ |
146 | 149 | ||
147 | /* Here we put FAC (Final Assembly Code) and serial number into our area. */ | 150 | /* Here we put FAC (Final Assembly Code) and serial number into our area. */ |
148 | Temp[0] = Imei[6]; Temp[1] = Imei[7]; | 151 | Temp[0] = Imei[6]; Temp[1] = Imei[7]; |
149 | Temp[2] = Imei[8]; Temp[3] = Imei[9]; | 152 | Temp[2] = Imei[8]; Temp[3] = Imei[9]; |
150 | Temp[4] = Imei[10]; Temp[5] = Imei[11]; | 153 | Temp[4] = Imei[10]; Temp[5] = Imei[11]; |
151 | Temp[6] = Imei[12]; Temp[7] = Imei[13]; | 154 | Temp[6] = Imei[12]; Temp[7] = Imei[13]; |
152 | 155 | ||
153 | /* And now the TAC (Type Approval Code). */ | 156 | /* And now the TAC (Type Approval Code). */ |
@@ -803,48 +806,49 @@ static GSM_Error N6110_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, | |||
803 | return DCT3_GetNetworkInfo(s,&NetInfo); | 806 | return DCT3_GetNetworkInfo(s,&NetInfo); |
804 | } else { | 807 | } else { |
805 | return ERR_NOTSUPPORTED; | 808 | return ERR_NOTSUPPORTED; |
806 | } | 809 | } |
807 | } | 810 | } |
808 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+7, &size); | 811 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+7, &size); |
809 | req[4] = Ringtone->Location - 1; | 812 | req[4] = Ringtone->Location - 1; |
810 | smprintf(s, "Setting ringtone\n"); | 813 | smprintf(s, "Setting ringtone\n"); |
811 | return GSM_WaitFor (s, req, 7 + size, 0x05, 4, ID_SetRingtone); | 814 | return GSM_WaitFor (s, req, 7 + size, 0x05, 4, ID_SetRingtone); |
812 | case RING_NOKIABINARY: | 815 | case RING_NOKIABINARY: |
813 | error=DCT3_EnableSecurity (s, 0x01); | 816 | error=DCT3_EnableSecurity (s, 0x01); |
814 | if (error!=ERR_NONE) return error; | 817 | if (error!=ERR_NONE) return error; |
815 | memcpy(reqBin+current,DecodeUnicodeString(Ringtone->Name),UnicodeLength(Ringtone->Name)); | 818 | memcpy(reqBin+current,DecodeUnicodeString(Ringtone->Name),UnicodeLength(Ringtone->Name)); |
816 | current += UnicodeLength(Ringtone->Name); | 819 | current += UnicodeLength(Ringtone->Name); |
817 | reqBin[current++] = 0x00; | 820 | reqBin[current++] = 0x00; |
818 | reqBin[current++] = 0x00; | 821 | reqBin[current++] = 0x00; |
819 | reqBin[current++] = 0x00;/*xxx*/ | 822 | reqBin[current++] = 0x00;/*xxx*/ |
820 | memcpy(reqBin+current,Ringtone->NokiaBinary.Frame,Ringtone->NokiaBinary.Length); | 823 | memcpy(reqBin+current,Ringtone->NokiaBinary.Frame,Ringtone->NokiaBinary.Length); |
821 | current=current+Ringtone->NokiaBinary.Length; | 824 | current=current+Ringtone->NokiaBinary.Length; |
822 | reqBin[3]=Ringtone->Location-1; | 825 | reqBin[3]=Ringtone->Location-1; |
823 | if (!strcmp(s->Phone.Data.ModelInfo->model,"3210")) reqBin[5]=0x10; | 826 | if (!strcmp(s->Phone.Data.ModelInfo->model,"3210")) reqBin[5]=0x10; |
824 | smprintf(s, "Setting binary ringtone\n"); | 827 | smprintf(s, "Setting binary ringtone\n"); |
825 | return GSM_WaitFor (s, reqBin, current, 0x40, 4, ID_SetRingtone); | 828 | return GSM_WaitFor (s, reqBin, current, 0x40, 4, ID_SetRingtone); |
826 | case RING_MIDI: | 829 | case RING_MIDI: |
830 | case RING_MMF: | ||
827 | return ERR_NOTSUPPORTED; | 831 | return ERR_NOTSUPPORTED; |
828 | } | 832 | } |
829 | return ERR_NOTSUPPORTED; | 833 | return ERR_NOTSUPPORTED; |
830 | } | 834 | } |
831 | 835 | ||
832 | static GSM_Error N6110_ReplyGetOpLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 836 | static GSM_Error N6110_ReplyGetOpLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
833 | { | 837 | { |
834 | int count=5; | 838 | int count=5; |
835 | GSM_Phone_Data *Data = &s->Phone.Data; | 839 | GSM_Phone_Data *Data = &s->Phone.Data; |
836 | 840 | ||
837 | smprintf(s, "Operator logo received\n"); | 841 | smprintf(s, "Operator logo received\n"); |
838 | NOKIA_DecodeNetworkCode(msg.Buffer+count,Data->Bitmap->NetworkCode); | 842 | NOKIA_DecodeNetworkCode(msg.Buffer+count,Data->Bitmap->NetworkCode); |
839 | count = count + 3; | 843 | count = count + 3; |
840 | smprintf(s, "Network code : %s\n", Data->Bitmap->NetworkCode); | 844 | smprintf(s, "Network code : %s\n", Data->Bitmap->NetworkCode); |
841 | smprintf(s, "Network name for Gammu : %s ", | 845 | smprintf(s, "Network name for Gammu : %s ", |
842 | DecodeUnicodeString(GSM_GetNetworkName(Data->Bitmap->NetworkCode))); | 846 | DecodeUnicodeString(GSM_GetNetworkName(Data->Bitmap->NetworkCode))); |
843 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(Data->Bitmap->NetworkCode))); | 847 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(Data->Bitmap->NetworkCode))); |
844 | 848 | ||
845 | count = count + 3; /* We ignore size */ | 849 | count = count + 3; /* We ignore size */ |
846 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; | 850 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; |
847 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; | 851 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; |
848 | count++; | 852 | count++; |
849 | PHONE_DecodeBitmap(GSM_NokiaOperatorLogo,msg.Buffer+count,Data->Bitmap); | 853 | PHONE_DecodeBitmap(GSM_NokiaOperatorLogo,msg.Buffer+count,Data->Bitmap); |
850 | return ERR_NONE; | 854 | return ERR_NONE; |
@@ -1503,85 +1507,87 @@ static GSM_Error N6110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi | |||
1503 | while (true) { | 1507 | while (true) { |
1504 | if (start!=0) { | 1508 | if (start!=0) { |
1505 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { | 1509 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { |
1506 | end=i+2; break; | 1510 | end=i+2; break; |
1507 | } | 1511 | } |
1508 | if (msg.Buffer[i]==0x0e && msg.Buffer[i+1]==0x0b) { | 1512 | if (msg.Buffer[i]==0x0e && msg.Buffer[i+1]==0x0b) { |
1509 | end=i+2; break; | 1513 | end=i+2; break; |
1510 | } | 1514 | } |
1511 | } else { | 1515 | } else { |
1512 | if (msg.Buffer[i]==0x02 && msg.Buffer[i+1]==0xfc && msg.Buffer[i+2]==0x09) { | 1516 | if (msg.Buffer[i]==0x02 && msg.Buffer[i+1]==0xfc && msg.Buffer[i+2]==0x09) { |
1513 | start = i; | 1517 | start = i; |
1514 | } | 1518 | } |
1515 | } | 1519 | } |
1516 | i++; | 1520 | i++; |
1517 | if (i==msg.Length-3) return ERR_EMPTY; | 1521 | if (i==msg.Length-3) return ERR_EMPTY; |
1518 | } | 1522 | } |
1519 | /* Copying frame */ | 1523 | /* Copying frame */ |
1520 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+start,end-start); | 1524 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+start,end-start); |
1521 | Data->Ringtone->NokiaBinary.Length=end-start; | 1525 | Data->Ringtone->NokiaBinary.Length=end-start; |
1522 | #ifdef DEBUG | 1526 | #ifdef DEBUG |
1523 | if (di.dl == DL_TEXTALL || di.dl == DL_TEXTALLDATE) DumpMessage(di.df, di.dl, Data->Ringtone->NokiaBinary.Frame, Data->Ringtone->NokiaBinary.Length); | 1527 | if (di.dl == DL_TEXTALL || di.dl == DL_TEXTALLDATE) DumpMessage(di.df, di.dl, Data->Ringtone->NokiaBinary.Frame, Data->Ringtone->NokiaBinary.Length); |
1524 | #endif | 1528 | #endif |
1525 | return ERR_NONE; | 1529 | return ERR_NONE; |
1526 | case RING_MIDI: | 1530 | case RING_MIDI: |
1531 | case RING_MMF: | ||
1527 | return ERR_NOTSUPPORTED; | 1532 | return ERR_NOTSUPPORTED; |
1528 | } | 1533 | } |
1529 | smprintf(s, "Ringtone format is %i\n",Data->Ringtone->Format); | 1534 | smprintf(s, "Ringtone format is %i\n",Data->Ringtone->Format); |
1530 | break; | 1535 | break; |
1531 | default: | 1536 | default: |
1532 | smprintf(s, "Invalid location. Too high ?\n"); | 1537 | smprintf(s, "Invalid location. Too high ?\n"); |
1533 | return ERR_INVALIDLOCATION; | 1538 | return ERR_INVALIDLOCATION; |
1534 | } | 1539 | } |
1535 | return ERR_UNKNOWNRESPONSE; | 1540 | return ERR_UNKNOWNRESPONSE; |
1536 | } | 1541 | } |
1537 | 1542 | ||
1538 | static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) | 1543 | static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) |
1539 | { | 1544 | { |
1540 | GSM_Error error; | 1545 | GSM_Error error; |
1541 | unsigned char req[] = {0x00, 0x01, 0x9e, | 1546 | unsigned char req[] = {0x00, 0x01, 0x9e, |
1542 | 0x00}; /* location */ | 1547 | 0x00}; /* location */ |
1543 | 1548 | ||
1544 | if (PhoneRingtone) return ERR_NOTSUPPORTED; | 1549 | if (PhoneRingtone) return ERR_NOTSUPPORTED; |
1545 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_NORING)) return ERR_NOTSUPPORTED; | 1550 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_NORING)) return ERR_NOTSUPPORTED; |
1546 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; | 1551 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; |
1547 | 1552 | ||
1548 | if (Ringtone->Format == 0x00) { | 1553 | if (Ringtone->Format == 0x00) { |
1549 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) { | 1554 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) { |
1550 | Ringtone->Format = RING_NOTETONE; | 1555 | Ringtone->Format = RING_NOTETONE; |
1551 | } else { | 1556 | } else { |
1552 | Ringtone->Format = RING_NOKIABINARY; | 1557 | Ringtone->Format = RING_NOKIABINARY; |
1553 | } | 1558 | } |
1554 | } | 1559 | } |
1555 | 1560 | ||
1556 | switch (Ringtone->Format) { | 1561 | switch (Ringtone->Format) { |
1557 | case RING_NOTETONE: | 1562 | case RING_NOTETONE: |
1558 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; | 1563 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; |
1559 | break; | 1564 | break; |
1560 | case RING_NOKIABINARY: | 1565 | case RING_NOKIABINARY: |
1561 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; | 1566 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; |
1562 | break; | 1567 | break; |
1563 | case RING_MIDI: | 1568 | case RING_MIDI: |
1569 | case RING_MMF: | ||
1564 | return ERR_NOTSUPPORTED; | 1570 | return ERR_NOTSUPPORTED; |
1565 | } | 1571 | } |
1566 | 1572 | ||
1567 | error=DCT3_EnableSecurity (s, 0x01); | 1573 | error=DCT3_EnableSecurity (s, 0x01); |
1568 | if (error!=ERR_NONE) return error; | 1574 | if (error!=ERR_NONE) return error; |
1569 | 1575 | ||
1570 | req[3]=Ringtone->Location-1; | 1576 | req[3]=Ringtone->Location-1; |
1571 | s->Phone.Data.Ringtone=Ringtone; | 1577 | s->Phone.Data.Ringtone=Ringtone; |
1572 | smprintf(s, "Getting (binary) ringtone\n"); | 1578 | smprintf(s, "Getting (binary) ringtone\n"); |
1573 | return GSM_WaitFor (s, req, 4, 0x40, 4, ID_GetRingtone); | 1579 | return GSM_WaitFor (s, req, 4, 0x40, 4, ID_GetRingtone); |
1574 | } | 1580 | } |
1575 | 1581 | ||
1576 | static GSM_Error N6110_ReplyGetSecurityStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1582 | static GSM_Error N6110_ReplyGetSecurityStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1577 | { | 1583 | { |
1578 | *s->Phone.Data.SecurityStatus = msg.Buffer[4]; | 1584 | *s->Phone.Data.SecurityStatus = msg.Buffer[4]; |
1579 | 1585 | ||
1580 | #ifdef DEBUG | 1586 | #ifdef DEBUG |
1581 | smprintf(s, "Security code status\n"); | 1587 | smprintf(s, "Security code status\n"); |
1582 | switch(msg.Buffer[4]) { | 1588 | switch(msg.Buffer[4]) { |
1583 | case SEC_SecurityCode: smprintf(s, "waiting for Security Code.\n"); break; | 1589 | case SEC_SecurityCode: smprintf(s, "waiting for Security Code.\n"); break; |
1584 | case SEC_Pin : smprintf(s, "waiting for PIN.\n"); break; | 1590 | case SEC_Pin : smprintf(s, "waiting for PIN.\n"); break; |
1585 | case SEC_Pin2 : smprintf(s, "waiting for PIN2.\n"); break; | 1591 | case SEC_Pin2 : smprintf(s, "waiting for PIN2.\n"); break; |
1586 | case SEC_Puk : smprintf(s, "waiting for PUK.\n"); break; | 1592 | case SEC_Puk : smprintf(s, "waiting for PUK.\n"); break; |
1587 | case SEC_Puk2 : smprintf(s, "waiting for PUK2.\n"); break; | 1593 | case SEC_Puk2 : smprintf(s, "waiting for PUK2.\n"); break; |
@@ -2422,50 +2428,50 @@ static GSM_Error N6110_GetNextCalendarNote(GSM_StateMachine *s, GSM_CalendarEntr | |||
2422 | Priv->LastCalendarPos++; | 2428 | Priv->LastCalendarPos++; |
2423 | } | 2429 | } |
2424 | 2430 | ||
2425 | Note->Location = Priv->LastCalendarPos; | 2431 | Note->Location = Priv->LastCalendarPos; |
2426 | req[4] = Priv->LastCalendarPos; | 2432 | req[4] = Priv->LastCalendarPos; |
2427 | 2433 | ||
2428 | s->Phone.Data.Cal=Note; | 2434 | s->Phone.Data.Cal=Note; |
2429 | smprintf(s, "Getting calendar note\n"); | 2435 | smprintf(s, "Getting calendar note\n"); |
2430 | error=GSM_WaitFor (s, req, 5, 0x13, 4, ID_GetCalendarNote); | 2436 | error=GSM_WaitFor (s, req, 5, 0x13, 4, ID_GetCalendarNote); |
2431 | 2437 | ||
2432 | GSM_CalendarFindDefaultTextTimeAlarmPhoneRecurrance(Note, &Text, &Time, &Alarm, &Phone, &Recurrance, &EndTime, &Location); | 2438 | GSM_CalendarFindDefaultTextTimeAlarmPhoneRecurrance(Note, &Text, &Time, &Alarm, &Phone, &Recurrance, &EndTime, &Location); |
2433 | /* 2090 year is set for example in 3310 */ | 2439 | /* 2090 year is set for example in 3310 */ |
2434 | if (error == ERR_NONE && Note->Entries[Time].Date.Year == 2090) { | 2440 | if (error == ERR_NONE && Note->Entries[Time].Date.Year == 2090) { |
2435 | error=N6110_GetDateTime(s, &date_time); | 2441 | error=N6110_GetDateTime(s, &date_time); |
2436 | if (error == ERR_NONE) Note->Entries[Time].Date.Year = date_time.Year; | 2442 | if (error == ERR_NONE) Note->Entries[Time].Date.Year = date_time.Year; |
2437 | } | 2443 | } |
2438 | return error; | 2444 | return error; |
2439 | } | 2445 | } |
2440 | 2446 | ||
2441 | GSM_Error N6110_ReplyUSSDInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 2447 | GSM_Error N6110_ReplyUSSDInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
2442 | { | 2448 | { |
2443 | unsigned char buffer[2000],buffer2[4000]; | 2449 | unsigned char buffer[2000],buffer2[4000]; |
2444 | int tmp; | 2450 | int tmp; |
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 | ||
2449 | smprintf(s, "USSD reply: \"%s\"\n",buffer); | 2455 | smprintf(s, "USSD reply: \"%s\"\n",buffer); |
2450 | 2456 | ||
2451 | if (s->Phone.Data.EnableIncomingUSSD && s->User.IncomingUSSD!=NULL) { | 2457 | if (s->Phone.Data.EnableIncomingUSSD && s->User.IncomingUSSD!=NULL) { |
2452 | EncodeUnicode(buffer2,buffer,strlen(buffer)); | 2458 | EncodeUnicode(buffer2,buffer,strlen(buffer)); |
2453 | s->User.IncomingUSSD(s->CurrentConfig->Device, buffer2); | 2459 | s->User.IncomingUSSD(s->CurrentConfig->Device, buffer2); |
2454 | } | 2460 | } |
2455 | 2461 | ||
2456 | return ERR_NONE; | 2462 | return ERR_NONE; |
2457 | } | 2463 | } |
2458 | 2464 | ||
2459 | GSM_Error N6110_AnswerCall(GSM_StateMachine *s, int ID, bool all) | 2465 | GSM_Error N6110_AnswerCall(GSM_StateMachine *s, int ID, bool all) |
2460 | { | 2466 | { |
2461 | GSM_Error error; | 2467 | GSM_Error error; |
2462 | unsigned char req1[] = {N6110_FRAME_HEADER, 0x42, 0x05, 0x01, | 2468 | unsigned char req1[] = {N6110_FRAME_HEADER, 0x42, 0x05, 0x01, |
2463 | 0x07, 0xa2, 0x88, 0x81, 0x21, 0x15, 0x63, 0xa8, | 2469 | 0x07, 0xa2, 0x88, 0x81, 0x21, 0x15, 0x63, 0xa8, |
2464 | 0x00, 0x00, 0x07, 0xa3, 0xb8, 0x81, 0x20, 0x15, | 2470 | 0x00, 0x00, 0x07, 0xa3, 0xb8, 0x81, 0x20, 0x15, |
2465 | 0x63, 0x80}; | 2471 | 0x63, 0x80}; |
2466 | 2472 | ||
2467 | if (!all) { | 2473 | if (!all) { |
2468 | smprintf(s, "Answering call part 1\n"); | 2474 | smprintf(s, "Answering call part 1\n"); |
2469 | error = GSM_WaitFor (s, req1, 24, 0x01, 5, ID_AnswerCall); | 2475 | error = GSM_WaitFor (s, req1, 24, 0x01, 5, ID_AnswerCall); |
2470 | if (error != ERR_NONE) return error; | 2476 | if (error != ERR_NONE) return error; |
2471 | return DCT3DCT4_AnswerCall(s,ID); | 2477 | return DCT3DCT4_AnswerCall(s,ID); |
@@ -2786,48 +2792,49 @@ GSM_Phone_Functions N6110Phone = { | |||
2786 | N6110_GetSignalQuality, | 2792 | N6110_GetSignalQuality, |
2787 | DCT3_GetNetworkInfo, | 2793 | DCT3_GetNetworkInfo, |
2788 | NOTSUPPORTED, /* GetCategory */ | 2794 | NOTSUPPORTED, /* GetCategory */ |
2789 | NOTSUPPORTED, /* AddCategory */ | 2795 | NOTSUPPORTED, /* AddCategory */ |
2790 | NOTSUPPORTED, /* GetCategoryStatus */ | 2796 | NOTSUPPORTED, /* GetCategoryStatus */ |
2791 | N6110_GetMemoryStatus, | 2797 | N6110_GetMemoryStatus, |
2792 | N6110_GetMemory, | 2798 | N6110_GetMemory, |
2793 | NOTIMPLEMENTED, /* GetNextMemory */ | 2799 | NOTIMPLEMENTED, /* GetNextMemory */ |
2794 | N6110_SetMemory, | 2800 | N6110_SetMemory, |
2795 | NOTIMPLEMENTED, /* AddMemory */ | 2801 | NOTIMPLEMENTED, /* AddMemory */ |
2796 | N6110_DeleteMemory, | 2802 | N6110_DeleteMemory, |
2797 | NOTIMPLEMENTED, /* DeleteAllMemory */ | 2803 | NOTIMPLEMENTED, /* DeleteAllMemory */ |
2798 | N6110_GetSpeedDial, | 2804 | N6110_GetSpeedDial, |
2799 | NOTIMPLEMENTED, /* SetSpeedDial */ | 2805 | NOTIMPLEMENTED, /* SetSpeedDial */ |
2800 | DCT3_GetSMSC, | 2806 | DCT3_GetSMSC, |
2801 | DCT3_SetSMSC, | 2807 | DCT3_SetSMSC, |
2802 | DCT3_GetSMSStatus, | 2808 | DCT3_GetSMSStatus, |
2803 | N6110_GetSMSMessage, | 2809 | N6110_GetSMSMessage, |
2804 | N6110_GetNextSMSMessage, | 2810 | N6110_GetNextSMSMessage, |
2805 | N6110_SetSMS, | 2811 | N6110_SetSMS, |
2806 | N6110_AddSMS, | 2812 | N6110_AddSMS, |
2807 | N6110_DeleteSMSMessage, | 2813 | N6110_DeleteSMSMessage, |
2808 | DCT3_SendSMSMessage, | 2814 | DCT3_SendSMSMessage, |
2809 | NOTSUPPORTED, /* SendSavedSMS */ | 2815 | NOTSUPPORTED, /* SendSavedSMS */ |
2816 | NOTSUPPORTED, /* SetFastSMSSending*/ | ||
2810 | NOKIA_SetIncomingSMS, | 2817 | NOKIA_SetIncomingSMS, |
2811 | DCT3_SetIncomingCB, | 2818 | DCT3_SetIncomingCB, |
2812 | PHONE_GetSMSFolders, | 2819 | PHONE_GetSMSFolders, |
2813 | NOTSUPPORTED, /* AddSMSFolder */ | 2820 | NOTSUPPORTED, /* AddSMSFolder */ |
2814 | NOTSUPPORTED, /* DeleteSMSFolder */ | 2821 | NOTSUPPORTED, /* DeleteSMSFolder */ |
2815 | N6110_DialVoice, | 2822 | N6110_DialVoice, |
2816 | N6110_AnswerCall, | 2823 | N6110_AnswerCall, |
2817 | DCT3_CancelCall, | 2824 | DCT3_CancelCall, |
2818 | N6110_HoldCall, | 2825 | N6110_HoldCall, |
2819 | N6110_UnholdCall, | 2826 | N6110_UnholdCall, |
2820 | N6110_ConferenceCall, | 2827 | N6110_ConferenceCall, |
2821 | N6110_SplitCall, | 2828 | N6110_SplitCall, |
2822 | N6110_TransferCall, | 2829 | N6110_TransferCall, |
2823 | N6110_SwitchCall, | 2830 | N6110_SwitchCall, |
2824 | DCT3DCT4_GetCallDivert, | 2831 | DCT3DCT4_GetCallDivert, |
2825 | DCT3DCT4_SetCallDivert, | 2832 | DCT3DCT4_SetCallDivert, |
2826 | DCT3DCT4_CancelAllDiverts, | 2833 | DCT3DCT4_CancelAllDiverts, |
2827 | NOKIA_SetIncomingCall, | 2834 | NOKIA_SetIncomingCall, |
2828 | NOKIA_SetIncomingUSSD, | 2835 | NOKIA_SetIncomingUSSD, |
2829 | DCT3DCT4_SendDTMF, | 2836 | DCT3DCT4_SendDTMF, |
2830 | N6110_GetRingtone, | 2837 | N6110_GetRingtone, |
2831 | N6110_SetRingtone, | 2838 | N6110_SetRingtone, |
2832 | NOTSUPPORTED, /* GetRingtonesInfo */ | 2839 | NOTSUPPORTED, /* GetRingtonesInfo */ |
2833 | NOTSUPPORTED, /* DeleteUserRingtones */ | 2840 | NOTSUPPORTED, /* DeleteUserRingtones */ |
@@ -2840,45 +2847,45 @@ GSM_Phone_Functions N6110Phone = { | |||
2840 | NOTSUPPORTED, /* GetMMSSettings */ | 2847 | NOTSUPPORTED, /* GetMMSSettings */ |
2841 | NOTSUPPORTED, /* SetMMSSettings */ | 2848 | NOTSUPPORTED, /* SetMMSSettings */ |
2842 | NOTSUPPORTED, /* GetSyncMLSettings*/ | 2849 | NOTSUPPORTED, /* GetSyncMLSettings*/ |
2843 | NOTSUPPORTED, /* SetSyncMLSettings*/ | 2850 | NOTSUPPORTED, /* SetSyncMLSettings*/ |
2844 | NOTSUPPORTED, /* GetChatSettings */ | 2851 | NOTSUPPORTED, /* GetChatSettings */ |
2845 | NOTSUPPORTED, /* SetChatSettings */ | 2852 | NOTSUPPORTED, /* SetChatSettings */ |
2846 | N6110_GetBitmap, | 2853 | N6110_GetBitmap, |
2847 | N6110_SetBitmap, | 2854 | N6110_SetBitmap, |
2848 | NOTSUPPORTED, /* GetToDoStatus */ | 2855 | NOTSUPPORTED, /* GetToDoStatus */ |
2849 | NOTSUPPORTED, /* GetToDo */ | 2856 | NOTSUPPORTED, /* GetToDo */ |
2850 | NOTSUPPORTED, /* GetNextToDo */ | 2857 | NOTSUPPORTED, /* GetNextToDo */ |
2851 | NOTSUPPORTED, /* SetToDo */ | 2858 | NOTSUPPORTED, /* SetToDo */ |
2852 | NOTSUPPORTED, /* AddToDo */ | 2859 | NOTSUPPORTED, /* AddToDo */ |
2853 | NOTSUPPORTED, /* DeleteToDo */ | 2860 | NOTSUPPORTED, /* DeleteToDo */ |
2854 | NOTSUPPORTED, /* DeleteAllToDo */ | 2861 | NOTSUPPORTED, /* DeleteAllToDo */ |
2855 | NOTIMPLEMENTED, /* GetCalendarStatus */ | 2862 | NOTIMPLEMENTED, /* GetCalendarStatus */ |
2856 | NOTIMPLEMENTED, /* GetCalendar */ | 2863 | NOTIMPLEMENTED, /* GetCalendar */ |
2857 | N6110_GetNextCalendarNote, | 2864 | N6110_GetNextCalendarNote, |
2858 | NOTIMPLEMENTED, /* SetCalendar */ | 2865 | NOTIMPLEMENTED, /* SetCalendar */ |
2859 | N6110_AddCalendarNote, | 2866 | N6110_AddCalendarNote, |
2860 | N6110_DeleteCalendarNote, | 2867 | N6110_DeleteCalendarNote, |
2861 | NOTIMPLEMENTED, /* DeleteAllCalendar */ | 2868 | NOTIMPLEMENTED, /* DeleteAllCalendar */ |
2862 | NOTSUPPORTED, /* GetCalendarSettings */ | 2869 | NOTSUPPORTED, /* GetCalendarSettings */ |
2863 | NOTSUPPORTED, /* SetCalendarSettings */ | 2870 | NOTSUPPORTED, /* SetCalendarSettings */ |
2864 | NOTSUPPORTED, /* GetNote */ | 2871 | NOTSUPPORTED, /* GetNextNote */ |
2865 | N6110_GetProfile, | 2872 | N6110_GetProfile, |
2866 | N6110_SetProfile, | 2873 | N6110_SetProfile, |
2867 | NOTSUPPORTED, /* GetFMStation */ | 2874 | NOTSUPPORTED, /* GetFMStation */ |
2868 | NOTSUPPORTED, /* SetFMStation */ | 2875 | NOTSUPPORTED, /* SetFMStation */ |
2869 | NOTSUPPORTED, /* ClearFMStations */ | 2876 | NOTSUPPORTED, /* ClearFMStations */ |
2870 | NOTSUPPORTED, /* GetNextFileFolder */ | 2877 | NOTSUPPORTED, /* GetNextFileFolder */ |
2871 | NOTSUPPORTED, /* GetFilePart */ | 2878 | NOTSUPPORTED, /* GetFilePart */ |
2872 | NOTSUPPORTED, /* AddFile */ | 2879 | NOTSUPPORTED, /* AddFile */ |
2873 | NOTSUPPORTED, /* GetFileSystemStatus */ | 2880 | NOTSUPPORTED, /* GetFileSystemStatus */ |
2874 | NOTSUPPORTED, /* DeleteFile */ | 2881 | NOTSUPPORTED, /* DeleteFile */ |
2875 | NOTSUPPORTED, /* AddFolder */ | 2882 | NOTSUPPORTED, /* AddFolder */ |
2876 | NOTSUPPORTED, /* GetGPRSAccessPoint */ | 2883 | NOTSUPPORTED, /* GetGPRSAccessPoint */ |
2877 | NOTSUPPORTED /* SetGPRSAccessPoint */ | 2884 | NOTSUPPORTED /* SetGPRSAccessPoint */ |
2878 | }; | 2885 | }; |
2879 | 2886 | ||
2880 | #endif | 2887 | #endif |
2881 | 2888 | ||
2882 | /* How should editor hadle tabs in this file? Add editor commands here. | 2889 | /* How should editor hadle tabs in this file? Add editor commands here. |
2883 | * vim: noexpandtab sw=8 ts=8 sts=8: | 2890 | * vim: noexpandtab sw=8 ts=8 sts=8: |
2884 | */ | 2891 | */ |
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,26 +1,29 @@ | |||
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 | ||
4 | #include "../../../gsmstate.h" | 7 | #include "../../../gsmstate.h" |
5 | 8 | ||
6 | #ifdef GSM_ENABLE_NOKIA7110 | 9 | #ifdef GSM_ENABLE_NOKIA7110 |
7 | 10 | ||
8 | #include <string.h> | 11 | #include <string.h> |
9 | #include <time.h> | 12 | #include <time.h> |
10 | 13 | ||
11 | #include "../../../misc/coding/coding.h" | 14 | #include "../../../misc/coding/coding.h" |
12 | #include "../../../gsmcomon.h" | 15 | #include "../../../gsmcomon.h" |
13 | #include "../../../service/gsmlogo.h" | 16 | #include "../../../service/gsmlogo.h" |
14 | #include "../../pfunc.h" | 17 | #include "../../pfunc.h" |
15 | #include "../nfunc.h" | 18 | #include "../nfunc.h" |
16 | #include "../nfuncold.h" | 19 | #include "../nfuncold.h" |
17 | #include "n7110.h" | 20 | #include "n7110.h" |
18 | #include "dct3func.h" | 21 | #include "dct3func.h" |
19 | 22 | ||
20 | static GSM_Error N7110_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) | 23 | static GSM_Error N7110_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) |
21 | { | 24 | { |
22 | return DCT3_GetAlarm(s, alarm, 0x19); | 25 | return DCT3_GetAlarm(s, alarm, 0x19); |
23 | } | 26 | } |
24 | 27 | ||
25 | static GSM_Error N7110_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) | 28 | static GSM_Error N7110_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) |
26 | { | 29 | { |
@@ -505,48 +508,49 @@ static GSM_Error N7110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi | |||
505 | case 0x24: | 508 | case 0x24: |
506 | smprintf(s, "Invalid location. Too high ?\n"); | 509 | smprintf(s, "Invalid location. Too high ?\n"); |
507 | return ERR_INVALIDLOCATION; | 510 | return ERR_INVALIDLOCATION; |
508 | } | 511 | } |
509 | return ERR_UNKNOWNRESPONSE; | 512 | return ERR_UNKNOWNRESPONSE; |
510 | } | 513 | } |
511 | 514 | ||
512 | static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) | 515 | static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) |
513 | { | 516 | { |
514 | unsigned char req[] = {N7110_FRAME_HEADER, 0x22, 0x00, 0x00}; | 517 | unsigned char req[] = {N7110_FRAME_HEADER, 0x22, 0x00, 0x00}; |
515 | 518 | ||
516 | if (PhoneRingtone) return ERR_NOTSUPPORTED; | 519 | if (PhoneRingtone) return ERR_NOTSUPPORTED; |
517 | if (Ringtone->Format == 0x00) Ringtone->Format = RING_NOKIABINARY; | 520 | if (Ringtone->Format == 0x00) Ringtone->Format = RING_NOKIABINARY; |
518 | 521 | ||
519 | switch (Ringtone->Format) { | 522 | switch (Ringtone->Format) { |
520 | case RING_NOTETONE: | 523 | case RING_NOTETONE: |
521 | /* In the future get binary and convert */ | 524 | /* In the future get binary and convert */ |
522 | return ERR_NOTSUPPORTED; | 525 | return ERR_NOTSUPPORTED; |
523 | case RING_NOKIABINARY: | 526 | case RING_NOKIABINARY: |
524 | req[5]=N7110_ReturnBinaryRingtoneLocation(s->Phone.Data.Model)+Ringtone->Location; | 527 | req[5]=N7110_ReturnBinaryRingtoneLocation(s->Phone.Data.Model)+Ringtone->Location; |
525 | s->Phone.Data.Ringtone=Ringtone; | 528 | s->Phone.Data.Ringtone=Ringtone; |
526 | smprintf(s, "Getting binary ringtone\n"); | 529 | smprintf(s, "Getting binary ringtone\n"); |
527 | return GSM_WaitFor (s, req, 6, 0x1f, 4, ID_GetRingtone); | 530 | return GSM_WaitFor (s, req, 6, 0x1f, 4, ID_GetRingtone); |
528 | case RING_MIDI: | 531 | case RING_MIDI: |
532 | case RING_MMF: | ||
529 | return ERR_NOTSUPPORTED; | 533 | return ERR_NOTSUPPORTED; |
530 | } | 534 | } |
531 | return ERR_NOTSUPPORTED; | 535 | return ERR_NOTSUPPORTED; |
532 | } | 536 | } |
533 | 537 | ||
534 | static GSM_Error N7110_ReplyGetPictureImageInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 538 | static GSM_Error N7110_ReplyGetPictureImageInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
535 | { | 539 | { |
536 | int i; | 540 | int i; |
537 | GSM_Phone_N7110Data*Priv = &s->Phone.Data.Priv.N7110; | 541 | GSM_Phone_N7110Data*Priv = &s->Phone.Data.Priv.N7110; |
538 | 542 | ||
539 | smprintf(s, "Received info for Picture Images\n"); | 543 | smprintf(s, "Received info for Picture Images\n"); |
540 | smprintf(s, "Number : %i\n",msg.Buffer[4]*256+msg.Buffer[5]); | 544 | smprintf(s, "Number : %i\n",msg.Buffer[4]*256+msg.Buffer[5]); |
541 | smprintf(s, "Locations :"); | 545 | smprintf(s, "Locations :"); |
542 | Priv->LastPictureImageFolder.Number=msg.Buffer[4]*256+msg.Buffer[5]; | 546 | Priv->LastPictureImageFolder.Number=msg.Buffer[4]*256+msg.Buffer[5]; |
543 | for (i=0;i<Priv->LastPictureImageFolder.Number;i++) { | 547 | for (i=0;i<Priv->LastPictureImageFolder.Number;i++) { |
544 | Priv->LastPictureImageFolder.Location[i]=msg.Buffer[6+i*2]*256+msg.Buffer[7+i*2]; | 548 | Priv->LastPictureImageFolder.Location[i]=msg.Buffer[6+i*2]*256+msg.Buffer[7+i*2]; |
545 | smprintf(s, " %i",Priv->LastPictureImageFolder.Location[i]); | 549 | smprintf(s, " %i",Priv->LastPictureImageFolder.Location[i]); |
546 | } | 550 | } |
547 | smprintf(s, "\n"); | 551 | smprintf(s, "\n"); |
548 | return ERR_NONE; | 552 | return ERR_NONE; |
549 | } | 553 | } |
550 | 554 | ||
551 | static GSM_Error N7110_GetPictureImageLocation(GSM_StateMachine *s, GSM_Bitmap *Bitmap, unsigned char *folder, int *location) | 555 | static GSM_Error N7110_GetPictureImageLocation(GSM_StateMachine *s, GSM_Bitmap *Bitmap, unsigned char *folder, int *location) |
552 | { | 556 | { |
@@ -1626,48 +1630,49 @@ GSM_Phone_Functions N7110Phone = { | |||
1626 | N71_92_GetSignalQuality, | 1630 | N71_92_GetSignalQuality, |
1627 | DCT3_GetNetworkInfo, | 1631 | DCT3_GetNetworkInfo, |
1628 | NOTSUPPORTED, /* GetCategory */ | 1632 | NOTSUPPORTED, /* GetCategory */ |
1629 | NOTSUPPORTED, /* AddCategory */ | 1633 | NOTSUPPORTED, /* AddCategory */ |
1630 | NOTSUPPORTED, /* GetCategoryStatus */ | 1634 | NOTSUPPORTED, /* GetCategoryStatus */ |
1631 | N7110_GetMemoryStatus, | 1635 | N7110_GetMemoryStatus, |
1632 | N7110_GetMemory, | 1636 | N7110_GetMemory, |
1633 | NOTIMPLEMENTED, /* GetNextMemory */ | 1637 | NOTIMPLEMENTED, /* GetNextMemory */ |
1634 | N7110_SetMemory, | 1638 | N7110_SetMemory, |
1635 | NOTIMPLEMENTED, /* AddMemory */ | 1639 | NOTIMPLEMENTED, /* AddMemory */ |
1636 | N7110_DeleteMemory, | 1640 | N7110_DeleteMemory, |
1637 | NOTIMPLEMENTED, /* DeleteAllMemory */ | 1641 | NOTIMPLEMENTED, /* DeleteAllMemory */ |
1638 | N7110_GetSpeedDial, | 1642 | N7110_GetSpeedDial, |
1639 | NOTIMPLEMENTED, /* SetSpeedDial */ | 1643 | NOTIMPLEMENTED, /* SetSpeedDial */ |
1640 | DCT3_GetSMSC, | 1644 | DCT3_GetSMSC, |
1641 | DCT3_SetSMSC, | 1645 | DCT3_SetSMSC, |
1642 | N7110_GetSMSStatus, | 1646 | N7110_GetSMSStatus, |
1643 | N7110_GetSMSMessage, | 1647 | N7110_GetSMSMessage, |
1644 | N7110_GetNextSMSMessage, | 1648 | N7110_GetNextSMSMessage, |
1645 | N7110_SetSMS, | 1649 | N7110_SetSMS, |
1646 | N7110_AddSMS, | 1650 | N7110_AddSMS, |
1647 | N7110_DeleteSMS, | 1651 | N7110_DeleteSMS, |
1648 | DCT3_SendSMSMessage, | 1652 | DCT3_SendSMSMessage, |
1649 | NOTSUPPORTED, /* SendSavedSMS */ | 1653 | NOTSUPPORTED, /* SendSavedSMS */ |
1654 | NOTSUPPORTED, /* SetFastSMSSending*/ | ||
1650 | N7110_SetIncomingSMS, | 1655 | N7110_SetIncomingSMS, |
1651 | DCT3_SetIncomingCB, | 1656 | DCT3_SetIncomingCB, |
1652 | N7110_GetSMSFolders, | 1657 | N7110_GetSMSFolders, |
1653 | NOTIMPLEMENTED, /* AddSMSFolder */ | 1658 | NOTIMPLEMENTED, /* AddSMSFolder */ |
1654 | NOTIMPLEMENTED, /* DeleteSMSFolder */ | 1659 | NOTIMPLEMENTED, /* DeleteSMSFolder */ |
1655 | DCT3_DialVoice, | 1660 | DCT3_DialVoice, |
1656 | N7110_AnswerCall, | 1661 | N7110_AnswerCall, |
1657 | DCT3_CancelCall, | 1662 | DCT3_CancelCall, |
1658 | NOTIMPLEMENTED, /* HoldCall */ | 1663 | NOTIMPLEMENTED, /* HoldCall */ |
1659 | NOTIMPLEMENTED, /* UnholdCall */ | 1664 | NOTIMPLEMENTED, /* UnholdCall */ |
1660 | NOTIMPLEMENTED, /* ConferenceCall */ | 1665 | NOTIMPLEMENTED, /* ConferenceCall */ |
1661 | NOTIMPLEMENTED, /* SplitCall */ | 1666 | NOTIMPLEMENTED, /* SplitCall */ |
1662 | NOTIMPLEMENTED, /* TransferCall */ | 1667 | NOTIMPLEMENTED, /* TransferCall */ |
1663 | NOTIMPLEMENTED, /* SwitchCall */ | 1668 | NOTIMPLEMENTED, /* SwitchCall */ |
1664 | NOTSUPPORTED, /* GetCallDivert */ | 1669 | NOTSUPPORTED, /* GetCallDivert */ |
1665 | N7110_SetCallDivert, | 1670 | N7110_SetCallDivert, |
1666 | N7110_CancelAllDiverts, | 1671 | N7110_CancelAllDiverts, |
1667 | N7110_SetIncomingCall, | 1672 | N7110_SetIncomingCall, |
1668 | N7110_SetIncomingUSSD, | 1673 | N7110_SetIncomingUSSD, |
1669 | DCT3DCT4_SendDTMF, | 1674 | DCT3DCT4_SendDTMF, |
1670 | N7110_GetRingtone, | 1675 | N7110_GetRingtone, |
1671 | N7110_SetRingtone, | 1676 | N7110_SetRingtone, |
1672 | NOTSUPPORTED, /* GetRingtonesInfo*/ | 1677 | NOTSUPPORTED, /* GetRingtonesInfo*/ |
1673 | NOTSUPPORTED, /* DeleteUserRingtones*/ | 1678 | NOTSUPPORTED, /* DeleteUserRingtones*/ |
@@ -1680,45 +1685,45 @@ GSM_Phone_Functions N7110Phone = { | |||
1680 | NOTSUPPORTED, /* GetMMSSettings */ | 1685 | NOTSUPPORTED, /* GetMMSSettings */ |
1681 | NOTSUPPORTED, /* SetMMSSettings */ | 1686 | NOTSUPPORTED, /* SetMMSSettings */ |
1682 | NOTSUPPORTED, /* GetSyncMLSettings*/ | 1687 | NOTSUPPORTED, /* GetSyncMLSettings*/ |
1683 | NOTSUPPORTED, /* SetSyncMLSettings*/ | 1688 | NOTSUPPORTED, /* SetSyncMLSettings*/ |
1684 | NOTSUPPORTED, /* GetChatSettings */ | 1689 | NOTSUPPORTED, /* GetChatSettings */ |
1685 | NOTSUPPORTED, /* SetChatSettings */ | 1690 | NOTSUPPORTED, /* SetChatSettings */ |
1686 | N7110_GetBitmap, | 1691 | N7110_GetBitmap, |
1687 | N7110_SetBitmap, | 1692 | N7110_SetBitmap, |
1688 | NOTSUPPORTED, /* GetToDoStatus */ | 1693 | NOTSUPPORTED, /* GetToDoStatus */ |
1689 | NOTSUPPORTED, /* GetToDo */ | 1694 | NOTSUPPORTED, /* GetToDo */ |
1690 | NOTSUPPORTED, /* GetNextToDo */ | 1695 | NOTSUPPORTED, /* GetNextToDo */ |
1691 | NOTSUPPORTED, /* SetToDo */ | 1696 | NOTSUPPORTED, /* SetToDo */ |
1692 | NOTSUPPORTED, /* AddToDo */ | 1697 | NOTSUPPORTED, /* AddToDo */ |
1693 | NOTSUPPORTED, /* DeleteToDo */ | 1698 | NOTSUPPORTED, /* DeleteToDo */ |
1694 | NOTSUPPORTED, /* DeleteAllToDo */ | 1699 | NOTSUPPORTED, /* DeleteAllToDo */ |
1695 | N7110_GetCalendarStatus, | 1700 | N7110_GetCalendarStatus, |
1696 | NOTIMPLEMENTED, /* GetCalendar */ | 1701 | NOTIMPLEMENTED, /* GetCalendar */ |
1697 | N7110_GetNextCalendar, | 1702 | N7110_GetNextCalendar, |
1698 | NOTIMPLEMENTED, /* SetCalendar */ | 1703 | NOTIMPLEMENTED, /* SetCalendar */ |
1699 | N7110_AddCalendar, | 1704 | N7110_AddCalendar, |
1700 | N71_65_DelCalendar, | 1705 | N71_65_DelCalendar, |
1701 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ | 1706 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ |
1702 | NOTSUPPORTED, /* GetCalendarSettings*/ | 1707 | NOTSUPPORTED, /* GetCalendarSettings*/ |
1703 | NOTSUPPORTED, /* SetCalendarSettings*/ | 1708 | NOTSUPPORTED, /* SetCalendarSettings*/ |
1704 | NOTSUPPORTED, /* GetNote */ | 1709 | NOTSUPPORTED, /* GetNextNote */ |
1705 | N7110_GetProfile, | 1710 | N7110_GetProfile, |
1706 | N7110_SetProfile, | 1711 | N7110_SetProfile, |
1707 | NOTSUPPORTED, /* GetFMStation */ | 1712 | NOTSUPPORTED, /* GetFMStation */ |
1708 | NOTSUPPORTED, /* SetFMStation */ | 1713 | NOTSUPPORTED, /* SetFMStation */ |
1709 | NOTSUPPORTED, /* ClearFMStations */ | 1714 | NOTSUPPORTED, /* ClearFMStations */ |
1710 | NOTSUPPORTED, /* GetNextFileFolder*/ | 1715 | NOTSUPPORTED, /* GetNextFileFolder*/ |
1711 | NOTSUPPORTED, /* GetFilePart */ | 1716 | NOTSUPPORTED, /* GetFilePart */ |
1712 | NOTSUPPORTED, /* AddFile */ | 1717 | NOTSUPPORTED, /* AddFile */ |
1713 | NOTSUPPORTED, /* GetFileSystemStatus*/ | 1718 | NOTSUPPORTED, /* GetFileSystemStatus*/ |
1714 | NOTSUPPORTED, /* DeleteFile */ | 1719 | NOTSUPPORTED, /* DeleteFile */ |
1715 | NOTSUPPORTED, /* AddFolder */ | 1720 | NOTSUPPORTED, /* AddFolder */ |
1716 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ | 1721 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ |
1717 | NOTSUPPORTED /* SetGPRSAccessPoint*/ | 1722 | NOTSUPPORTED /* SetGPRSAccessPoint*/ |
1718 | }; | 1723 | }; |
1719 | 1724 | ||
1720 | #endif | 1725 | #endif |
1721 | 1726 | ||
1722 | /* How should editor hadle tabs in this file? Add editor commands here. | 1727 | /* How should editor hadle tabs in this file? Add editor commands here. |
1723 | * vim: noexpandtab sw=8 ts=8 sts=8: | 1728 | * vim: noexpandtab sw=8 ts=8 sts=8: |
1724 | */ | 1729 | */ |
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 | |||
@@ -298,48 +298,49 @@ GSM_Phone_Functions N9210Phone = { | |||
298 | N71_92_GetSignalQuality, | 298 | N71_92_GetSignalQuality, |
299 | DCT3_GetNetworkInfo, | 299 | DCT3_GetNetworkInfo, |
300 | NOTSUPPORTED, /* GetCategory */ | 300 | NOTSUPPORTED, /* GetCategory */ |
301 | NOTSUPPORTED, /* AddCategory */ | 301 | NOTSUPPORTED, /* AddCategory */ |
302 | NOTSUPPORTED, /* GetCategoryStatus */ | 302 | NOTSUPPORTED, /* GetCategoryStatus */ |
303 | NOTIMPLEMENTED, /* GetMemoryStatus */ | 303 | NOTIMPLEMENTED, /* GetMemoryStatus */ |
304 | NOTIMPLEMENTED, /* GetMemory */ | 304 | NOTIMPLEMENTED, /* GetMemory */ |
305 | NOTIMPLEMENTED, /* GetNextMemory */ | 305 | NOTIMPLEMENTED, /* GetNextMemory */ |
306 | NOTIMPLEMENTED, /* SetMemory */ | 306 | NOTIMPLEMENTED, /* SetMemory */ |
307 | NOTIMPLEMENTED, /* AddMemory */ | 307 | NOTIMPLEMENTED, /* AddMemory */ |
308 | NOTIMPLEMENTED, /* DeleteMemory */ | 308 | NOTIMPLEMENTED, /* DeleteMemory */ |
309 | NOTIMPLEMENTED, /* DeleteAllMemory */ | 309 | NOTIMPLEMENTED, /* DeleteAllMemory */ |
310 | NOTIMPLEMENTED, /* GetSpeedDial */ | 310 | NOTIMPLEMENTED, /* GetSpeedDial */ |
311 | NOTIMPLEMENTED, /* SetSpeedDial */ | 311 | NOTIMPLEMENTED, /* SetSpeedDial */ |
312 | DCT3_GetSMSC, | 312 | DCT3_GetSMSC, |
313 | DCT3_SetSMSC, /* FIXME: test it */ | 313 | DCT3_SetSMSC, /* FIXME: test it */ |
314 | NOTIMPLEMENTED, /* GetSMSStatus */ | 314 | NOTIMPLEMENTED, /* GetSMSStatus */ |
315 | NOTIMPLEMENTED, /* GetSMS */ | 315 | NOTIMPLEMENTED, /* GetSMS */ |
316 | NOTIMPLEMENTED, /* GetNextSMS */ | 316 | NOTIMPLEMENTED, /* GetNextSMS */ |
317 | NOTIMPLEMENTED, /* SetSMS */ | 317 | NOTIMPLEMENTED, /* SetSMS */ |
318 | NOTIMPLEMENTED, /* AddSMS */ | 318 | NOTIMPLEMENTED, /* AddSMS */ |
319 | NOTIMPLEMENTED, /* DeleteSMS */ | 319 | NOTIMPLEMENTED, /* DeleteSMS */ |
320 | DCT3_SendSMSMessage, | 320 | DCT3_SendSMSMessage, |
321 | NOTSUPPORTED, /* SendSavedSMS */ | 321 | NOTSUPPORTED, /* SendSavedSMS */ |
322 | NOTSUPPORTED, /* SetFastSMSSending*/ | ||
322 | N9210_SetIncomingSMS, | 323 | N9210_SetIncomingSMS, |
323 | DCT3_SetIncomingCB, | 324 | DCT3_SetIncomingCB, |
324 | NOTIMPLEMENTED, /* GetSMSFolders */ | 325 | NOTIMPLEMENTED, /* GetSMSFolders */ |
325 | NOTSUPPORTED, /* AddSMSFolder */ | 326 | NOTSUPPORTED, /* AddSMSFolder */ |
326 | NOTSUPPORTED, /* DeleteSMSFolder */ | 327 | NOTSUPPORTED, /* DeleteSMSFolder */ |
327 | DCT3_DialVoice, | 328 | DCT3_DialVoice, |
328 | N9210_AnswerCall, | 329 | N9210_AnswerCall, |
329 | DCT3_CancelCall, | 330 | DCT3_CancelCall, |
330 | NOTSUPPORTED, /* HoldCall */ | 331 | NOTSUPPORTED, /* HoldCall */ |
331 | NOTSUPPORTED, /* UnholdCall */ | 332 | NOTSUPPORTED, /* UnholdCall */ |
332 | NOTSUPPORTED, /* ConferenceCall */ | 333 | NOTSUPPORTED, /* ConferenceCall */ |
333 | NOTSUPPORTED, /* SplitCall */ | 334 | NOTSUPPORTED, /* SplitCall */ |
334 | NOTSUPPORTED, /* TransferCall */ | 335 | NOTSUPPORTED, /* TransferCall */ |
335 | NOTSUPPORTED, /* SwitchCall */ | 336 | NOTSUPPORTED, /* SwitchCall */ |
336 | NOTSUPPORTED, /* GetCallDivert */ | 337 | NOTSUPPORTED, /* GetCallDivert */ |
337 | NOTSUPPORTED, /* SetCallDivert */ | 338 | NOTSUPPORTED, /* SetCallDivert */ |
338 | NOTSUPPORTED, /* CancelAllDiverts*/ | 339 | NOTSUPPORTED, /* CancelAllDiverts*/ |
339 | NOTSUPPORTED, /* SetIncomingCall */ | 340 | NOTSUPPORTED, /* SetIncomingCall */ |
340 | NOTIMPLEMENTED, /* SetIncomingUSSD */ | 341 | NOTIMPLEMENTED, /* SetIncomingUSSD */ |
341 | NOTSUPPORTED, /* SendDTMF */ | 342 | NOTSUPPORTED, /* SendDTMF */ |
342 | NOTIMPLEMENTED, /* GetRingtone */ | 343 | NOTIMPLEMENTED, /* GetRingtone */ |
343 | NOTIMPLEMENTED, /* SetRingtone */ | 344 | NOTIMPLEMENTED, /* SetRingtone */ |
344 | NOTSUPPORTED, /* GetRingtonesInfo*/ | 345 | NOTSUPPORTED, /* GetRingtonesInfo*/ |
345 | NOTSUPPORTED, /* DeleteUserRingtones*/ | 346 | NOTSUPPORTED, /* DeleteUserRingtones*/ |
@@ -352,45 +353,45 @@ GSM_Phone_Functions N9210Phone = { | |||
352 | NOTSUPPORTED, /* GetMMSSettings */ | 353 | NOTSUPPORTED, /* GetMMSSettings */ |
353 | NOTSUPPORTED, /* SetMMSSettings */ | 354 | NOTSUPPORTED, /* SetMMSSettings */ |
354 | NOTSUPPORTED, /* GetSyncMLSettings*/ | 355 | NOTSUPPORTED, /* GetSyncMLSettings*/ |
355 | NOTSUPPORTED, /* SetSyncMLSettings*/ | 356 | NOTSUPPORTED, /* SetSyncMLSettings*/ |
356 | NOTSUPPORTED, /* GetChatSettings */ | 357 | NOTSUPPORTED, /* GetChatSettings */ |
357 | NOTSUPPORTED, /* SetChatSettings */ | 358 | NOTSUPPORTED, /* SetChatSettings */ |
358 | N9210_GetBitmap, | 359 | N9210_GetBitmap, |
359 | N9210_SetBitmap, | 360 | N9210_SetBitmap, |
360 | NOTSUPPORTED, /* GetToDoStatus */ | 361 | NOTSUPPORTED, /* GetToDoStatus */ |
361 | NOTSUPPORTED, /* GetToDo */ | 362 | NOTSUPPORTED, /* GetToDo */ |
362 | NOTSUPPORTED, /* GetNextToDo */ | 363 | NOTSUPPORTED, /* GetNextToDo */ |
363 | NOTSUPPORTED, /* SetToDo */ | 364 | NOTSUPPORTED, /* SetToDo */ |
364 | NOTSUPPORTED, /* AddToDo */ | 365 | NOTSUPPORTED, /* AddToDo */ |
365 | NOTSUPPORTED, /* DeleteToDo */ | 366 | NOTSUPPORTED, /* DeleteToDo */ |
366 | NOTSUPPORTED, /* DeleteAllToDo */ | 367 | NOTSUPPORTED, /* DeleteAllToDo */ |
367 | NOTSUPPORTED, /* GetCalendarStatus*/ | 368 | NOTSUPPORTED, /* GetCalendarStatus*/ |
368 | NOTSUPPORTED, /* GetCalendar */ | 369 | NOTSUPPORTED, /* GetCalendar */ |
369 | NOTSUPPORTED, /* GetNextCalendar */ | 370 | NOTSUPPORTED, /* GetNextCalendar */ |
370 | NOTSUPPORTED, /* SetCalendar */ | 371 | NOTSUPPORTED, /* SetCalendar */ |
371 | NOTSUPPORTED, /* AddCalendar */ | 372 | NOTSUPPORTED, /* AddCalendar */ |
372 | NOTSUPPORTED, /* DeleteCalendar */ | 373 | NOTSUPPORTED, /* DeleteCalendar */ |
373 | NOTSUPPORTED, /* DeleteAllCalendar*/ | 374 | NOTSUPPORTED, /* DeleteAllCalendar*/ |
374 | NOTSUPPORTED, /* GetCalendarSettings*/ | 375 | NOTSUPPORTED, /* GetCalendarSettings*/ |
375 | NOTSUPPORTED, /* SetCalendarSettings*/ | 376 | NOTSUPPORTED, /* SetCalendarSettings*/ |
376 | NOTSUPPORTED, /* GetNote */ | 377 | NOTSUPPORTED, /* GetNextNote */ |
377 | NOTIMPLEMENTED, /* GetProfile */ | 378 | NOTIMPLEMENTED, /* GetProfile */ |
378 | NOTSUPPORTED, /* SetProfile */ | 379 | NOTSUPPORTED, /* SetProfile */ |
379 | NOTSUPPORTED, /* GetFMStation */ | 380 | NOTSUPPORTED, /* GetFMStation */ |
380 | NOTSUPPORTED, /* SetFMStation */ | 381 | NOTSUPPORTED, /* SetFMStation */ |
381 | NOTSUPPORTED, /* ClearFMStations */ | 382 | NOTSUPPORTED, /* ClearFMStations */ |
382 | NOTSUPPORTED, /* GetNextFileFolder*/ | 383 | NOTSUPPORTED, /* GetNextFileFolder*/ |
383 | NOTSUPPORTED, /* GetFilePart */ | 384 | NOTSUPPORTED, /* GetFilePart */ |
384 | NOTSUPPORTED, /* AddFile */ | 385 | NOTSUPPORTED, /* AddFile */ |
385 | NOTSUPPORTED, /* GetFileSystemStatus*/ | 386 | NOTSUPPORTED, /* GetFileSystemStatus*/ |
386 | NOTSUPPORTED, /* DeleteFile */ | 387 | NOTSUPPORTED, /* DeleteFile */ |
387 | NOTSUPPORTED, /* AddFolder */ | 388 | NOTSUPPORTED, /* AddFolder */ |
388 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ | 389 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ |
389 | NOTSUPPORTED /* SetGPRSAccessPoint*/ | 390 | NOTSUPPORTED /* SetGPRSAccessPoint*/ |
390 | }; | 391 | }; |
391 | 392 | ||
392 | #endif | 393 | #endif |
393 | 394 | ||
394 | /* How should editor hadle tabs in this file? Add editor commands here. | 395 | /* How should editor hadle tabs in this file? Add editor commands here. |
395 | * vim: noexpandtab sw=8 ts=8 sts=8: | 396 | * vim: noexpandtab sw=8 ts=8 sts=8: |
396 | */ | 397 | */ |
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 | |||
@@ -173,48 +173,49 @@ GSM_Phone_Functions N3320Phone = { | |||
173 | NOTSUPPORTED, /* GetSignalQuality*/ | 173 | NOTSUPPORTED, /* GetSignalQuality*/ |
174 | NOTSUPPORTED, /* GetNetworkInfo */ | 174 | NOTSUPPORTED, /* GetNetworkInfo */ |
175 | NOTSUPPORTED, /* GetCategory */ | 175 | NOTSUPPORTED, /* GetCategory */ |
176 | NOTSUPPORTED, /* AddCategory */ | 176 | NOTSUPPORTED, /* AddCategory */ |
177 | NOTSUPPORTED, /* GetCategoryStatus */ | 177 | NOTSUPPORTED, /* GetCategoryStatus */ |
178 | N3320_GetMemoryStatus, | 178 | N3320_GetMemoryStatus, |
179 | N3320_GetMemory, | 179 | N3320_GetMemory, |
180 | NOTSUPPORTED, /* GetNextMemory */ | 180 | NOTSUPPORTED, /* GetNextMemory */ |
181 | NOTSUPPORTED, /* SetMemory */ | 181 | NOTSUPPORTED, /* SetMemory */ |
182 | NOTSUPPORTED, /* AddMemory */ | 182 | NOTSUPPORTED, /* AddMemory */ |
183 | NOTSUPPORTED, /* DeleteMemory */ | 183 | NOTSUPPORTED, /* DeleteMemory */ |
184 | NOTIMPLEMENTED, /* DeleteAllMemory */ | 184 | NOTIMPLEMENTED, /* DeleteAllMemory */ |
185 | NOTSUPPORTED, /* GetSpeedDial */ | 185 | NOTSUPPORTED, /* GetSpeedDial */ |
186 | NOTSUPPORTED, /* SetSpeedDial */ | 186 | NOTSUPPORTED, /* SetSpeedDial */ |
187 | NOTSUPPORTED, /* GetSMSC */ | 187 | NOTSUPPORTED, /* GetSMSC */ |
188 | NOTSUPPORTED, /* SetSMSC */ | 188 | NOTSUPPORTED, /* SetSMSC */ |
189 | NOTSUPPORTED, /* GetSMSStatus */ | 189 | NOTSUPPORTED, /* GetSMSStatus */ |
190 | NOTSUPPORTED, /* GetSMS */ | 190 | NOTSUPPORTED, /* GetSMS */ |
191 | NOTSUPPORTED, /* GetNextSMS */ | 191 | NOTSUPPORTED, /* GetNextSMS */ |
192 | NOTSUPPORTED, /* SetSMS */ | 192 | NOTSUPPORTED, /* SetSMS */ |
193 | NOTSUPPORTED, /* AddSMS */ | 193 | NOTSUPPORTED, /* AddSMS */ |
194 | NOTSUPPORTED, /* DeleteSMS */ | 194 | NOTSUPPORTED, /* DeleteSMS */ |
195 | NOTSUPPORTED, /* SendSMS */ | 195 | NOTSUPPORTED, /* SendSMS */ |
196 | NOTSUPPORTED, /* SendSavedSMS */ | 196 | NOTSUPPORTED, /* SendSavedSMS */ |
197 | NOTSUPPORTED, /* SetFastSMSSending*/ | ||
197 | NOTSUPPORTED, /* SetIncomingSMS */ | 198 | NOTSUPPORTED, /* SetIncomingSMS */ |
198 | NOTSUPPORTED, /* SetIncomingCB */ | 199 | NOTSUPPORTED, /* SetIncomingCB */ |
199 | NOTSUPPORTED, /* GetSMSFolders */ | 200 | NOTSUPPORTED, /* GetSMSFolders */ |
200 | NOTSUPPORTED, /* AddSMSFolder */ | 201 | NOTSUPPORTED, /* AddSMSFolder */ |
201 | NOTSUPPORTED, /* DeleteSMSFolder */ | 202 | NOTSUPPORTED, /* DeleteSMSFolder */ |
202 | NOTIMPLEMENTED, /* DialVoice */ | 203 | NOTIMPLEMENTED, /* DialVoice */ |
203 | NOTIMPLEMENTED, /* AnswerCall */ | 204 | NOTIMPLEMENTED, /* AnswerCall */ |
204 | NOTIMPLEMENTED, /* CancelCall */ | 205 | NOTIMPLEMENTED, /* CancelCall */ |
205 | NOTIMPLEMENTED, /* HoldCall */ | 206 | NOTIMPLEMENTED, /* HoldCall */ |
206 | NOTIMPLEMENTED, /* UnholdCall */ | 207 | NOTIMPLEMENTED, /* UnholdCall */ |
207 | NOTIMPLEMENTED, /* ConferenceCall */ | 208 | NOTIMPLEMENTED, /* ConferenceCall */ |
208 | NOTIMPLEMENTED, /* SplitCall */ | 209 | NOTIMPLEMENTED, /* SplitCall */ |
209 | NOTIMPLEMENTED, /* TransferCall */ | 210 | NOTIMPLEMENTED, /* TransferCall */ |
210 | NOTIMPLEMENTED, /* SwitchCall */ | 211 | NOTIMPLEMENTED, /* SwitchCall */ |
211 | NOTSUPPORTED, /* GetCallDivert */ | 212 | NOTSUPPORTED, /* GetCallDivert */ |
212 | NOTSUPPORTED, /* SetCallDivert */ | 213 | NOTSUPPORTED, /* SetCallDivert */ |
213 | NOTSUPPORTED, /* CancelAllDiverts*/ | 214 | NOTSUPPORTED, /* CancelAllDiverts*/ |
214 | NOTIMPLEMENTED, /* SetIncomingCall */ | 215 | NOTIMPLEMENTED, /* SetIncomingCall */ |
215 | NOTIMPLEMENTED, /* SetIncomingUSSD */ | 216 | NOTIMPLEMENTED, /* SetIncomingUSSD */ |
216 | NOTSUPPORTED, /* SendDTMF */ | 217 | NOTSUPPORTED, /* SendDTMF */ |
217 | NOTSUPPORTED, /* GetRingtone */ | 218 | NOTSUPPORTED, /* GetRingtone */ |
218 | NOTSUPPORTED, /* SetRingtone */ | 219 | NOTSUPPORTED, /* SetRingtone */ |
219 | NOTSUPPORTED, /* GetRingtonesInfo*/ | 220 | NOTSUPPORTED, /* GetRingtonesInfo*/ |
220 | NOTIMPLEMENTED, /* DeleteUserRingtones*/ | 221 | NOTIMPLEMENTED, /* DeleteUserRingtones*/ |
@@ -227,45 +228,45 @@ GSM_Phone_Functions N3320Phone = { | |||
227 | NOTSUPPORTED, /* GetMMSSettings */ | 228 | NOTSUPPORTED, /* GetMMSSettings */ |
228 | NOTSUPPORTED, /* SetMMSSettings */ | 229 | NOTSUPPORTED, /* SetMMSSettings */ |
229 | NOTSUPPORTED, /* GetSyncMLSettings*/ | 230 | NOTSUPPORTED, /* GetSyncMLSettings*/ |
230 | NOTSUPPORTED, /* SetSyncMLSettings*/ | 231 | NOTSUPPORTED, /* SetSyncMLSettings*/ |
231 | NOTSUPPORTED, /* GetChatSettings */ | 232 | NOTSUPPORTED, /* GetChatSettings */ |
232 | NOTSUPPORTED, /* SetChatSettings */ | 233 | NOTSUPPORTED, /* SetChatSettings */ |
233 | NOTSUPPORTED, /* GetBitmap */ | 234 | NOTSUPPORTED, /* GetBitmap */ |
234 | NOTSUPPORTED, /* SetBitmap */ | 235 | NOTSUPPORTED, /* SetBitmap */ |
235 | NOTSUPPORTED, /* GetToDoStatus */ | 236 | NOTSUPPORTED, /* GetToDoStatus */ |
236 | NOTSUPPORTED, /* GetToDo */ | 237 | NOTSUPPORTED, /* GetToDo */ |
237 | NOTSUPPORTED, /* GetNextToDo */ | 238 | NOTSUPPORTED, /* GetNextToDo */ |
238 | NOTSUPPORTED, /* SetToDo */ | 239 | NOTSUPPORTED, /* SetToDo */ |
239 | NOTSUPPORTED, /* AddToDo */ | 240 | NOTSUPPORTED, /* AddToDo */ |
240 | NOTSUPPORTED, /* DeleteToDo */ | 241 | NOTSUPPORTED, /* DeleteToDo */ |
241 | NOTSUPPORTED, /* DeleteAllToDo */ | 242 | NOTSUPPORTED, /* DeleteAllToDo */ |
242 | N3320_GetCalendarStatus, | 243 | N3320_GetCalendarStatus, |
243 | NOTIMPLEMENTED, /* GetCalendar */ | 244 | NOTIMPLEMENTED, /* GetCalendar */ |
244 | N3320_GetNextCalendar, | 245 | N3320_GetNextCalendar, |
245 | NOTIMPLEMENTED, /* SetCalendar */ | 246 | NOTIMPLEMENTED, /* SetCalendar */ |
246 | NOTSUPPORTED, /* AddCalendar */ | 247 | NOTSUPPORTED, /* AddCalendar */ |
247 | NOTSUPPORTED, /* DeleteCalendar */ | 248 | NOTSUPPORTED, /* DeleteCalendar */ |
248 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ | 249 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ |
249 | NOTSUPPORTED, /* GetCalendarSettings*/ | 250 | NOTSUPPORTED, /* GetCalendarSettings*/ |
250 | NOTSUPPORTED, /* SetCalendarSettings*/ | 251 | NOTSUPPORTED, /* SetCalendarSettings*/ |
251 | NOTSUPPORTED, /* GetNote */ | 252 | NOTSUPPORTED, /* GetNextNote */ |
252 | NOTSUPPORTED, /* GetProfile */ | 253 | NOTSUPPORTED, /* GetProfile */ |
253 | NOTSUPPORTED, /* SetProfile */ | 254 | NOTSUPPORTED, /* SetProfile */ |
254 | NOTSUPPORTED, /* GetFMStation */ | 255 | NOTSUPPORTED, /* GetFMStation */ |
255 | NOTSUPPORTED, /* SetFMStation */ | 256 | NOTSUPPORTED, /* SetFMStation */ |
256 | NOTSUPPORTED, /* ClearFMStations */ | 257 | NOTSUPPORTED, /* ClearFMStations */ |
257 | NOTSUPPORTED, /* GetNextFileFolder*/ | 258 | NOTSUPPORTED, /* GetNextFileFolder*/ |
258 | NOTSUPPORTED, /* GetFilePart */ | 259 | NOTSUPPORTED, /* GetFilePart */ |
259 | NOTIMPLEMENTED, /* AddFilePart */ | 260 | NOTIMPLEMENTED, /* AddFilePart */ |
260 | NOTSUPPORTED, /* GetFileSystemStatus*/ | 261 | NOTSUPPORTED, /* GetFileSystemStatus*/ |
261 | NOTIMPLEMENTED, /* DeleteFile */ | 262 | NOTIMPLEMENTED, /* DeleteFile */ |
262 | NOTIMPLEMENTED, /* AddFolder */ | 263 | NOTIMPLEMENTED, /* AddFolder */ |
263 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ | 264 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ |
264 | NOTSUPPORTED /* SetGPRSAccessPoint*/ | 265 | NOTSUPPORTED /* SetGPRSAccessPoint*/ |
265 | }; | 266 | }; |
266 | 267 | ||
267 | #endif | 268 | #endif |
268 | 269 | ||
269 | /* How should editor hadle tabs in this file? Add editor commands here. | 270 | /* How should editor hadle tabs in this file? Add editor commands here. |
270 | * vim: noexpandtab sw=8 ts=8 sts=8: | 271 | * vim: noexpandtab sw=8 ts=8 sts=8: |
271 | */ | 272 | */ |
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 | |||
@@ -294,48 +294,49 @@ GSM_Phone_Functions N3650Phone = { | |||
294 | NOTSUPPORTED, /* GetSignalQuality*/ | 294 | NOTSUPPORTED, /* GetSignalQuality*/ |
295 | NOTSUPPORTED, /* GetNetworkInfo */ | 295 | NOTSUPPORTED, /* GetNetworkInfo */ |
296 | NOTSUPPORTED, /* GetCategory */ | 296 | NOTSUPPORTED, /* GetCategory */ |
297 | NOTSUPPORTED, /* AddCategory */ | 297 | NOTSUPPORTED, /* AddCategory */ |
298 | NOTSUPPORTED, /* GetCategoryStatus */ | 298 | NOTSUPPORTED, /* GetCategoryStatus */ |
299 | NOTSUPPORTED, /* GetMemoryStatus */ | 299 | NOTSUPPORTED, /* GetMemoryStatus */ |
300 | NOTSUPPORTED, /* GetMemory */ | 300 | NOTSUPPORTED, /* GetMemory */ |
301 | NOTSUPPORTED, /* GetNextMemory */ | 301 | NOTSUPPORTED, /* GetNextMemory */ |
302 | NOTSUPPORTED, /* SetMemory */ | 302 | NOTSUPPORTED, /* SetMemory */ |
303 | NOTSUPPORTED, /* AddMemory */ | 303 | NOTSUPPORTED, /* AddMemory */ |
304 | NOTSUPPORTED, /* DeleteMemory */ | 304 | NOTSUPPORTED, /* DeleteMemory */ |
305 | NOTIMPLEMENTED, /* DeleteAllMemory */ | 305 | NOTIMPLEMENTED, /* DeleteAllMemory */ |
306 | NOTSUPPORTED, /* GetSpeedDial */ | 306 | NOTSUPPORTED, /* GetSpeedDial */ |
307 | NOTSUPPORTED, /* SetSpeedDial */ | 307 | NOTSUPPORTED, /* SetSpeedDial */ |
308 | NOTSUPPORTED, /* GetSMSC */ | 308 | NOTSUPPORTED, /* GetSMSC */ |
309 | NOTSUPPORTED, /* SetSMSC */ | 309 | NOTSUPPORTED, /* SetSMSC */ |
310 | NOTSUPPORTED, /* GetSMSStatus */ | 310 | NOTSUPPORTED, /* GetSMSStatus */ |
311 | NOTSUPPORTED, /* GetSMS */ | 311 | NOTSUPPORTED, /* GetSMS */ |
312 | NOTSUPPORTED, /* GetNextSMS */ | 312 | NOTSUPPORTED, /* GetNextSMS */ |
313 | NOTSUPPORTED, /* SetSMS */ | 313 | NOTSUPPORTED, /* SetSMS */ |
314 | NOTSUPPORTED, /* AddSMS */ | 314 | NOTSUPPORTED, /* AddSMS */ |
315 | NOTSUPPORTED, /* DeleteSMS */ | 315 | NOTSUPPORTED, /* DeleteSMS */ |
316 | NOTSUPPORTED, /* SendSMS */ | 316 | NOTSUPPORTED, /* SendSMS */ |
317 | NOTSUPPORTED, /* SendSavedSMS */ | 317 | NOTSUPPORTED, /* SendSavedSMS */ |
318 | NOTSUPPORTED, /* SetFastSMSSending*/ | ||
318 | NOTSUPPORTED, /* SetIncomingSMS */ | 319 | NOTSUPPORTED, /* SetIncomingSMS */ |
319 | NOTSUPPORTED, /* SetIncomingCB */ | 320 | NOTSUPPORTED, /* SetIncomingCB */ |
320 | NOTSUPPORTED, /* GetSMSFolders */ | 321 | NOTSUPPORTED, /* GetSMSFolders */ |
321 | NOTSUPPORTED, /* AddSMSFolder */ | 322 | NOTSUPPORTED, /* AddSMSFolder */ |
322 | NOTSUPPORTED, /* DeleteSMSFolder */ | 323 | NOTSUPPORTED, /* DeleteSMSFolder */ |
323 | NOTIMPLEMENTED, /* DialVoice */ | 324 | NOTIMPLEMENTED, /* DialVoice */ |
324 | NOTIMPLEMENTED, /* AnswerCall */ | 325 | NOTIMPLEMENTED, /* AnswerCall */ |
325 | NOTIMPLEMENTED, /* CancelCall */ | 326 | NOTIMPLEMENTED, /* CancelCall */ |
326 | NOTIMPLEMENTED, /* HoldCall */ | 327 | NOTIMPLEMENTED, /* HoldCall */ |
327 | NOTIMPLEMENTED, /* UnholdCall */ | 328 | NOTIMPLEMENTED, /* UnholdCall */ |
328 | NOTIMPLEMENTED, /* ConferenceCall */ | 329 | NOTIMPLEMENTED, /* ConferenceCall */ |
329 | NOTIMPLEMENTED, /* SplitCall */ | 330 | NOTIMPLEMENTED, /* SplitCall */ |
330 | NOTIMPLEMENTED, /* TransferCall */ | 331 | NOTIMPLEMENTED, /* TransferCall */ |
331 | NOTIMPLEMENTED, /* SwitchCall */ | 332 | NOTIMPLEMENTED, /* SwitchCall */ |
332 | NOTSUPPORTED, /* GetCallDivert */ | 333 | NOTSUPPORTED, /* GetCallDivert */ |
333 | NOTSUPPORTED, /* SetCallDivert */ | 334 | NOTSUPPORTED, /* SetCallDivert */ |
334 | NOTSUPPORTED, /* CancelAllDiverts*/ | 335 | NOTSUPPORTED, /* CancelAllDiverts*/ |
335 | NOTIMPLEMENTED, /* SetIncomingCall */ | 336 | NOTIMPLEMENTED, /* SetIncomingCall */ |
336 | NOTIMPLEMENTED, /* SetIncomingUSSD */ | 337 | NOTIMPLEMENTED, /* SetIncomingUSSD */ |
337 | NOTSUPPORTED, /* SendDTMF */ | 338 | NOTSUPPORTED, /* SendDTMF */ |
338 | NOTSUPPORTED, /* GetRingtone */ | 339 | NOTSUPPORTED, /* GetRingtone */ |
339 | NOTSUPPORTED, /* SetRingtone */ | 340 | NOTSUPPORTED, /* SetRingtone */ |
340 | NOTSUPPORTED, /* GetRingtonesInfo*/ | 341 | NOTSUPPORTED, /* GetRingtonesInfo*/ |
341 | NOTIMPLEMENTED, /* DeleteUserRingtones*/ | 342 | NOTIMPLEMENTED, /* DeleteUserRingtones*/ |
@@ -348,45 +349,45 @@ GSM_Phone_Functions N3650Phone = { | |||
348 | NOTSUPPORTED, /* GetMMSSettings */ | 349 | NOTSUPPORTED, /* GetMMSSettings */ |
349 | NOTSUPPORTED, /* SetMMSSettings */ | 350 | NOTSUPPORTED, /* SetMMSSettings */ |
350 | NOTSUPPORTED, /* GetSyncMLSettings*/ | 351 | NOTSUPPORTED, /* GetSyncMLSettings*/ |
351 | NOTSUPPORTED, /* SetSyncMLSettings*/ | 352 | NOTSUPPORTED, /* SetSyncMLSettings*/ |
352 | NOTSUPPORTED, /* GetChatSettings */ | 353 | NOTSUPPORTED, /* GetChatSettings */ |
353 | NOTSUPPORTED, /* SetChatSettings */ | 354 | NOTSUPPORTED, /* SetChatSettings */ |
354 | NOTSUPPORTED, /* GetBitmap */ | 355 | NOTSUPPORTED, /* GetBitmap */ |
355 | NOTSUPPORTED, /* SetBitmap */ | 356 | NOTSUPPORTED, /* SetBitmap */ |
356 | NOTSUPPORTED, /* GetToDoStatus */ | 357 | NOTSUPPORTED, /* GetToDoStatus */ |
357 | NOTSUPPORTED, /* GetToDo */ | 358 | NOTSUPPORTED, /* GetToDo */ |
358 | NOTSUPPORTED, /* GetNextToDo */ | 359 | NOTSUPPORTED, /* GetNextToDo */ |
359 | NOTSUPPORTED, /* SetToDo */ | 360 | NOTSUPPORTED, /* SetToDo */ |
360 | NOTSUPPORTED, /* AddToDo */ | 361 | NOTSUPPORTED, /* AddToDo */ |
361 | NOTSUPPORTED, /* DeleteToDo */ | 362 | NOTSUPPORTED, /* DeleteToDo */ |
362 | NOTSUPPORTED, /* DeleteAllToDo */ | 363 | NOTSUPPORTED, /* DeleteAllToDo */ |
363 | NOTIMPLEMENTED, /* GetCalendarStatus*/ | 364 | NOTIMPLEMENTED, /* GetCalendarStatus*/ |
364 | NOTIMPLEMENTED, /* GetCalendar */ | 365 | NOTIMPLEMENTED, /* GetCalendar */ |
365 | NOTSUPPORTED, /* GetNextCalendar */ | 366 | NOTSUPPORTED, /* GetNextCalendar */ |
366 | NOTIMPLEMENTED, /* SetCalendar */ | 367 | NOTIMPLEMENTED, /* SetCalendar */ |
367 | NOTSUPPORTED, /* AddCalendar */ | 368 | NOTSUPPORTED, /* AddCalendar */ |
368 | NOTSUPPORTED, /* DeleteCalendar */ | 369 | NOTSUPPORTED, /* DeleteCalendar */ |
369 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ | 370 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ |
370 | NOTSUPPORTED, /* GetCalendarSettings*/ | 371 | NOTSUPPORTED, /* GetCalendarSettings*/ |
371 | NOTSUPPORTED, /* SetCalendarSettings*/ | 372 | NOTSUPPORTED, /* SetCalendarSettings*/ |
372 | NOTSUPPORTED, /* GetNote */ | 373 | NOTSUPPORTED, /* GetNextNote */ |
373 | NOTSUPPORTED, /* GetProfile */ | 374 | NOTSUPPORTED, /* GetProfile */ |
374 | NOTSUPPORTED, /* SetProfile */ | 375 | NOTSUPPORTED, /* SetProfile */ |
375 | NOTSUPPORTED, /* GetFMStation */ | 376 | NOTSUPPORTED, /* GetFMStation */ |
376 | NOTSUPPORTED, /* SetFMStation */ | 377 | NOTSUPPORTED, /* SetFMStation */ |
377 | NOTSUPPORTED, /* ClearFMStations */ | 378 | NOTSUPPORTED, /* ClearFMStations */ |
378 | N3650_GetNextFileFolder, | 379 | N3650_GetNextFileFolder, |
379 | N3650_GetFilePart, | 380 | N3650_GetFilePart, |
380 | NOTIMPLEMENTED, /* AddFilePart */ | 381 | NOTIMPLEMENTED, /* AddFilePart */ |
381 | NOTSUPPORTED, /* GetFileSystemStatus*/ | 382 | NOTSUPPORTED, /* GetFileSystemStatus*/ |
382 | NOTIMPLEMENTED, /* DeleteFile */ | 383 | NOTIMPLEMENTED, /* DeleteFile */ |
383 | NOTIMPLEMENTED, /* AddFolder */ | 384 | NOTIMPLEMENTED, /* AddFolder */ |
384 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ | 385 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ |
385 | NOTSUPPORTED /* SetGPRSAccessPoint*/ | 386 | NOTSUPPORTED /* SetGPRSAccessPoint*/ |
386 | }; | 387 | }; |
387 | 388 | ||
388 | #endif | 389 | #endif |
389 | 390 | ||
390 | /* How should editor hadle tabs in this file? Add editor commands here. | 391 | /* How should editor hadle tabs in this file? Add editor commands here. |
391 | * vim: noexpandtab sw=8 ts=8 sts=8: | 392 | * vim: noexpandtab sw=8 ts=8 sts=8: |
392 | */ | 393 | */ |
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,26 +1,29 @@ | |||
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 */ |
4 | 7 | ||
5 | #include "../../../gsmstate.h" | 8 | #include "../../../gsmstate.h" |
6 | 9 | ||
7 | #ifdef GSM_ENABLE_NOKIA6510 | 10 | #ifdef GSM_ENABLE_NOKIA6510 |
8 | 11 | ||
9 | #include <string.h> | 12 | #include <string.h> |
10 | #include <time.h> | 13 | #include <time.h> |
11 | 14 | ||
12 | #include "../../../misc/coding/coding.h" | 15 | #include "../../../misc/coding/coding.h" |
13 | #include "../../../gsmcomon.h" | 16 | #include "../../../gsmcomon.h" |
14 | #include "../../../service/gsmlogo.h" | 17 | #include "../../../service/gsmlogo.h" |
15 | #include "../nfunc.h" | 18 | #include "../nfunc.h" |
16 | #include "../nfuncold.h" | 19 | #include "../nfuncold.h" |
17 | #include "../../pfunc.h" | 20 | #include "../../pfunc.h" |
18 | #include "dct4func.h" | 21 | #include "dct4func.h" |
19 | #include "n6510.h" | 22 | #include "n6510.h" |
20 | 23 | ||
21 | static GSM_Error N6510_Initialise (GSM_StateMachine *s) | 24 | static GSM_Error N6510_Initialise (GSM_StateMachine *s) |
22 | { | 25 | { |
23 | s->Phone.Data.Priv.N6510.CalendarIconsNum = 0; | 26 | s->Phone.Data.Priv.N6510.CalendarIconsNum = 0; |
24 | 27 | ||
25 | /* Enables various things like incoming SMS, call info, etc. */ | 28 | /* Enables various things like incoming SMS, call info, etc. */ |
26 | return N71_65_EnableFunctions (s, "\x01\x02\x06\x0A\x14\x17\x39", 7); | 29 | return N71_65_EnableFunctions (s, "\x01\x02\x06\x0A\x14\x17\x39", 7); |
@@ -98,48 +101,50 @@ static GSM_Error N6510_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine * | |||
98 | GSM_Phone_Data *Data = &s->Phone.Data; | 101 | GSM_Phone_Data *Data = &s->Phone.Data; |
99 | 102 | ||
100 | switch (msg.Buffer[4]) { | 103 | switch (msg.Buffer[4]) { |
101 | case 0x00: | 104 | case 0x00: |
102 | smprintf(s, "SMSC received\n"); | 105 | smprintf(s, "SMSC received\n"); |
103 | break; | 106 | break; |
104 | case 0x02: | 107 | case 0x02: |
105 | smprintf(s, "SMSC empty\n"); | 108 | smprintf(s, "SMSC empty\n"); |
106 | return ERR_INVALIDLOCATION; | 109 | return ERR_INVALIDLOCATION; |
107 | default: | 110 | default: |
108 | smprintf(s, "Unknown SMSC state: %02x\n",msg.Buffer[4]); | 111 | smprintf(s, "Unknown SMSC state: %02x\n",msg.Buffer[4]); |
109 | return ERR_UNKNOWNRESPONSE; | 112 | return ERR_UNKNOWNRESPONSE; |
110 | } | 113 | } |
111 | memset(Data->SMSC,0,sizeof(GSM_SMSC)); | 114 | memset(Data->SMSC,0,sizeof(GSM_SMSC)); |
112 | Data->SMSC->Location = msg.Buffer[8]; | 115 | Data->SMSC->Location = msg.Buffer[8]; |
113 | Data->SMSC->Format = SMS_FORMAT_Text; | 116 | Data->SMSC->Format = SMS_FORMAT_Text; |
114 | switch (msg.Buffer[10]) { | 117 | switch (msg.Buffer[10]) { |
115 | case 0x00: Data->SMSC->Format = SMS_FORMAT_Text; break; | 118 | case 0x00: Data->SMSC->Format = SMS_FORMAT_Text; break; |
116 | case 0x22: Data->SMSC->Format = SMS_FORMAT_Fax; break; | 119 | case 0x22: Data->SMSC->Format = SMS_FORMAT_Fax; break; |
117 | case 0x26: Data->SMSC->Format = SMS_FORMAT_Pager;break; | 120 | case 0x26: Data->SMSC->Format = SMS_FORMAT_Pager;break; |
118 | case 0x32: Data->SMSC->Format = SMS_FORMAT_Email;break; | 121 | case 0x32: Data->SMSC->Format = SMS_FORMAT_Email;break; |
119 | } | 122 | } |
120 | Data->SMSC->Validity.Format= SMS_Validity_RelativeFormat; | 123 | Data->SMSC->Validity.Format= SMS_Validity_RelativeFormat; |
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; |
123 | for (i=0;i<msg.Buffer[13];i++) { | 128 | for (i=0;i<msg.Buffer[13];i++) { |
124 | switch (msg.Buffer[current]) { | 129 | switch (msg.Buffer[current]) { |
125 | case 0x81: | 130 | case 0x81: |
126 | j=current+4; | 131 | j=current+4; |
127 | while (msg.Buffer[j]!=0) {j++;} | 132 | while (msg.Buffer[j]!=0) {j++;} |
128 | j=j-33; | 133 | j=j-33; |
129 | if (j>GSM_MAX_SMSC_NAME_LENGTH) { | 134 | if (j>GSM_MAX_SMSC_NAME_LENGTH) { |
130 | smprintf(s, "Too long name\n"); | 135 | smprintf(s, "Too long name\n"); |
131 | return ERR_UNKNOWNRESPONSE; | 136 | return ERR_UNKNOWNRESPONSE; |
132 | } | 137 | } |
133 | CopyUnicodeString(Data->SMSC->Name,msg.Buffer+current+4); | 138 | CopyUnicodeString(Data->SMSC->Name,msg.Buffer+current+4); |
134 | smprintf(s, " Name \"%s\"\n", DecodeUnicodeString(Data->SMSC->Name)); | 139 | smprintf(s, " Name \"%s\"\n", DecodeUnicodeString(Data->SMSC->Name)); |
135 | break; | 140 | break; |
136 | case 0x82: | 141 | case 0x82: |
137 | switch (msg.Buffer[current+2]) { | 142 | switch (msg.Buffer[current+2]) { |
138 | case 0x01: | 143 | case 0x01: |
139 | GSM_UnpackSemiOctetNumber(Data->SMSC->DefaultNumber,msg.Buffer+current+4,true); | 144 | GSM_UnpackSemiOctetNumber(Data->SMSC->DefaultNumber,msg.Buffer+current+4,true); |
140 | smprintf(s, " Default number \"%s\"\n", DecodeUnicodeString(Data->SMSC->DefaultNumber)); | 145 | smprintf(s, " Default number \"%s\"\n", DecodeUnicodeString(Data->SMSC->DefaultNumber)); |
141 | break; | 146 | break; |
142 | case 0x02: | 147 | case 0x02: |
143 | GSM_UnpackSemiOctetNumber(Data->SMSC->Number,msg.Buffer+current+4,false); | 148 | GSM_UnpackSemiOctetNumber(Data->SMSC->Number,msg.Buffer+current+4,false); |
144 | smprintf(s, " Number \"%s\"\n", DecodeUnicodeString(Data->SMSC->Number)); | 149 | smprintf(s, " Number \"%s\"\n", DecodeUnicodeString(Data->SMSC->Number)); |
145 | break; | 150 | break; |
@@ -244,49 +249,49 @@ static GSM_Error N6510_SetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc) | |||
244 | /* -------------- SMSC name ------------------- */ | 249 | /* -------------- SMSC name ------------------- */ |
245 | req[count++] = 0x81; | 250 | req[count++] = 0x81; |
246 | req[count++] = UnicodeLength(smsc->Name)*2 + 2 + 4; | 251 | req[count++] = UnicodeLength(smsc->Name)*2 + 2 + 4; |
247 | req[count++] = UnicodeLength(smsc->Name)*2 + 2; | 252 | req[count++] = UnicodeLength(smsc->Name)*2 + 2; |
248 | req[count++] = 0x00; | 253 | req[count++] = 0x00; |
249 | /* Can't make CopyUnicodeString(req+count,sms->Name) !!!! | 254 | /* Can't make CopyUnicodeString(req+count,sms->Name) !!!! |
250 | * with MSVC6 count is changed then | 255 | * with MSVC6 count is changed then |
251 | */ | 256 | */ |
252 | i = count; | 257 | i = count; |
253 | CopyUnicodeString(req+i,smsc->Name); | 258 | CopyUnicodeString(req+i,smsc->Name); |
254 | count += UnicodeLength(smsc->Name)*2 + 2; | 259 | count += UnicodeLength(smsc->Name)*2 + 2; |
255 | 260 | ||
256 | smprintf(s, "Setting SMSC\n"); | 261 | smprintf(s, "Setting SMSC\n"); |
257 | return GSM_WaitFor (s, req, count, 0x02, 4, ID_SetSMSC); | 262 | return GSM_WaitFor (s, req, count, 0x02, 4, ID_SetSMSC); |
258 | } | 263 | } |
259 | 264 | ||
260 | static GSM_Error N6510_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 265 | static GSM_Error N6510_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
261 | { | 266 | { |
262 | int current = msg.Buffer[7]+7, tmp; | 267 | int current = msg.Buffer[7]+7, tmp; |
263 | GSM_Phone_Data*Data = &s->Phone.Data; | 268 | GSM_Phone_Data*Data = &s->Phone.Data; |
264 | #ifdef DEBUG | 269 | #ifdef DEBUG |
265 | char name[100]; | 270 | char name[100]; |
266 | GSM_NetworkInfo NetInfo; | 271 | GSM_NetworkInfo NetInfo; |
267 | 272 | ||
268 | smprintf(s, "Network status: "); | 273 | smprintf(s, "Network status : "); |
269 | switch (msg.Buffer[8]) { | 274 | switch (msg.Buffer[8]) { |
270 | case 0x00 : smprintf(s, "home network\n"); break; | 275 | case 0x00 : smprintf(s, "home network\n"); break; |
271 | case 0x01 : smprintf(s, "roaming network\n"); break; | 276 | case 0x01 : smprintf(s, "roaming network\n"); break; |
272 | case 0x04 : smprintf(s, "not logged"); break; | 277 | case 0x04 : smprintf(s, "not logged"); break; |
273 | case 0x06 : smprintf(s, "SIM card rejected\n"); break; | 278 | case 0x06 : smprintf(s, "SIM card rejected\n"); break; |
274 | case 0x09 : smprintf(s, "not logged"); break; | 279 | case 0x09 : smprintf(s, "not logged"); break; |
275 | default : smprintf(s, "unknown %i!\n",msg.Buffer[8]); break; | 280 | default : smprintf(s, "unknown %i!\n",msg.Buffer[8]); break; |
276 | } | 281 | } |
277 | if (msg.Buffer[8]==0x00 || msg.Buffer[8] == 0x01) { | 282 | if (msg.Buffer[8]==0x00 || msg.Buffer[8] == 0x01) { |
278 | NOKIA_DecodeNetworkCode(msg.Buffer + (current + 7),NetInfo.NetworkCode); | 283 | NOKIA_DecodeNetworkCode(msg.Buffer + (current + 7),NetInfo.NetworkCode); |
279 | smprintf(s, "Network code : %s\n", NetInfo.NetworkCode); | 284 | smprintf(s, "Network code : %s\n", NetInfo.NetworkCode); |
280 | smprintf(s, "Network name for Gammu : %s ", | 285 | smprintf(s, "Network name for Gammu : %s ", |
281 | DecodeUnicodeString(GSM_GetNetworkName(NetInfo.NetworkCode))); | 286 | DecodeUnicodeString(GSM_GetNetworkName(NetInfo.NetworkCode))); |
282 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(NetInfo.NetworkCode))); | 287 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(NetInfo.NetworkCode))); |
283 | 288 | ||
284 | sprintf(NetInfo.LAC,"%02x%02x", msg.Buffer[current+1], msg.Buffer[current+2]); | 289 | sprintf(NetInfo.LAC,"%02x%02x", msg.Buffer[current+1], msg.Buffer[current+2]); |
285 | smprintf(s, "LAC : %s\n", NetInfo.LAC); | 290 | smprintf(s, "LAC : %s\n", NetInfo.LAC); |
286 | 291 | ||
287 | sprintf(NetInfo.CID, "%02x%02x", msg.Buffer[current+5], msg.Buffer[current+6]); | 292 | sprintf(NetInfo.CID, "%02x%02x", msg.Buffer[current+5], msg.Buffer[current+6]); |
288 | smprintf(s, "CID : %s\n", NetInfo.CID); | 293 | smprintf(s, "CID : %s\n", NetInfo.CID); |
289 | 294 | ||
290 | tmp = 10; | 295 | tmp = 10; |
291 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,name,true); | 296 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,name,true); |
292 | smprintf(s, "Network name for phone : %s\n",DecodeUnicodeString(name)); | 297 | smprintf(s, "Network name for phone : %s\n",DecodeUnicodeString(name)); |
@@ -964,53 +969,53 @@ static GSM_Error N6510_ReplyGetBatteryCharge(GSM_Protocol_Message msg, GSM_State | |||
964 | Data->BatteryCharge->BatteryPercent = ((int)(msg.Buffer[9]*100/7)); | 969 | Data->BatteryCharge->BatteryPercent = ((int)(msg.Buffer[9]*100/7)); |
965 | Data->BatteryCharge->ChargeState = 0; | 970 | Data->BatteryCharge->ChargeState = 0; |
966 | return ERR_NONE; | 971 | return ERR_NONE; |
967 | } | 972 | } |
968 | 973 | ||
969 | static GSM_Error N6510_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *bat) | 974 | static GSM_Error N6510_GetBatteryCharge(GSM_StateMachine *s, GSM_BatteryCharge *bat) |
970 | { | 975 | { |
971 | unsigned char req[] = {N6110_FRAME_HEADER, 0x0A, 0x02, 0x00}; | 976 | unsigned char req[] = {N6110_FRAME_HEADER, 0x0A, 0x02, 0x00}; |
972 | 977 | ||
973 | s->Phone.Data.BatteryCharge = bat; | 978 | s->Phone.Data.BatteryCharge = bat; |
974 | smprintf(s, "Getting battery level\n"); | 979 | smprintf(s, "Getting battery level\n"); |
975 | return GSM_WaitFor (s, req, 6, 0x17, 4, ID_GetBatteryCharge); | 980 | return GSM_WaitFor (s, req, 6, 0x17, 4, ID_GetBatteryCharge); |
976 | } | 981 | } |
977 | 982 | ||
978 | static GSM_Error N6510_ReplyGetWAPBookmark(GSM_Protocol_Message msg, GSM_StateMachine *s) | 983 | static GSM_Error N6510_ReplyGetWAPBookmark(GSM_Protocol_Message msg, GSM_StateMachine *s) |
979 | { | 984 | { |
980 | return DCT3DCT4_ReplyGetWAPBookmark (msg, s, true); | 985 | return DCT3DCT4_ReplyGetWAPBookmark (msg, s, true); |
981 | } | 986 | } |
982 | 987 | ||
983 | static GSM_Error N6510_ReplyGetOperatorLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 988 | static GSM_Error N6510_ReplyGetOperatorLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
984 | { | 989 | { |
985 | GSM_Phone_Data *Data = &s->Phone.Data; | 990 | GSM_Phone_Data *Data = &s->Phone.Data; |
986 | 991 | ||
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); |
989 | smprintf(s, "Network code %s\n",Data->Bitmap->NetworkCode); | 995 | smprintf(s, "Network code %s\n",Data->Bitmap->NetworkCode); |
990 | Data->Bitmap->BitmapWidth= msg.Buffer[20]; | 996 | Data->Bitmap->BitmapWidth= msg.Buffer[20]; |
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); |
994 | return ERR_NONE; | 999 | return ERR_NONE; |
995 | } | 1000 | } |
996 | 1001 | ||
997 | GSM_Error N6510_ReplyDeleteMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1002 | GSM_Error N6510_ReplyDeleteMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) |
998 | { | 1003 | { |
999 | smprintf(s, "Phonebook entry deleted\n"); | 1004 | smprintf(s, "Phonebook entry deleted\n"); |
1000 | return ERR_NONE; | 1005 | return ERR_NONE; |
1001 | } | 1006 | } |
1002 | 1007 | ||
1003 | GSM_Error N6510_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry) | 1008 | GSM_Error N6510_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry) |
1004 | { | 1009 | { |
1005 | unsigned char req[] = {N7110_FRAME_HEADER, 0x0f, 0x55, 0x01, | 1010 | unsigned char req[] = {N7110_FRAME_HEADER, 0x0f, 0x55, 0x01, |
1006 | 0x04, 0x55, 0x00, 0x10, 0xFF, 0x02, | 1011 | 0x04, 0x55, 0x00, 0x10, 0xFF, 0x02, |
1007 | 0x00, 0x01, /* location*/ | 1012 | 0x00, 0x01, /* location*/ |
1008 | 0x00, 0x00, 0x00, 0x00, | 1013 | 0x00, 0x00, 0x00, 0x00, |
1009 | 0x05, /* memory type*/ | 1014 | 0x05, /* memory type*/ |
1010 | 0x55, 0x55, 0x55}; | 1015 | 0x55, 0x55, 0x55}; |
1011 | 1016 | ||
1012 | req[12] = entry->Location / 256; | 1017 | req[12] = entry->Location / 256; |
1013 | req[13] = entry->Location % 256; | 1018 | req[13] = entry->Location % 256; |
1014 | 1019 | ||
1015 | req[18] = NOKIA_GetMemoryType(s, entry->MemoryType,N71_65_MEMORY_TYPES); | 1020 | req[18] = NOKIA_GetMemoryType(s, entry->MemoryType,N71_65_MEMORY_TYPES); |
1016 | if (req[18]==0xff) return ERR_NOTSUPPORTED; | 1021 | if (req[18]==0xff) return ERR_NOTSUPPORTED; |
@@ -1744,49 +1749,50 @@ static GSM_Error N6510_ReplyGetSyncMLName(GSM_Protocol_Message msg, GSM_StateMac | |||
1744 | } | 1749 | } |
1745 | 1750 | ||
1746 | static GSM_Error N6510_GetSyncMLSettings(GSM_StateMachine *s, GSM_SyncMLSettings *settings) | 1751 | static GSM_Error N6510_GetSyncMLSettings(GSM_StateMachine *s, GSM_SyncMLSettings *settings) |
1747 | { | 1752 | { |
1748 | GSM_Error error; | 1753 | GSM_Error error; |
1749 | // unsigned char NameReq[] = {N6110_FRAME_HEADER, 0x05, | 1754 | // unsigned char NameReq[] = {N6110_FRAME_HEADER, 0x05, |
1750 | // 0x00, 0x00, 0x00, 0x31, 0x00, | 1755 | // 0x00, 0x00, 0x00, 0x31, 0x00, |
1751 | // 0x06, 0x00, 0x00, 0x00, 0xDE, 0x00, 0x00}; | 1756 | // 0x06, 0x00, 0x00, 0x00, 0xDE, 0x00, 0x00}; |
1752 | // unsigned char GetActive[] = {N6110_FRAME_HEADER, 0x05, | 1757 | // unsigned char GetActive[] = {N6110_FRAME_HEADER, 0x05, |
1753 | // 0x00, 0x00, 0x00, 0x31, 0x00, | 1758 | // 0x00, 0x00, 0x00, 0x31, 0x00, |
1754 | // 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; | 1759 | // 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00}; |
1755 | unsigned char req[] = {N6110_FRAME_HEADER, 0x05, | 1760 | unsigned char req[] = {N6110_FRAME_HEADER, 0x05, |
1756 | 0x00, 0x00, 0x00, 0x31, 0x00, | 1761 | 0x00, 0x00, 0x00, 0x31, 0x00, |
1757 | 0x01, //location | 1762 | 0x01, //location |
1758 | 0x00, 0x00, 0x02, 0x46, 0x00, 0x00}; | 1763 | 0x00, 0x00, 0x02, 0x46, 0x00, 0x00}; |
1759 | 1764 | ||
1760 | settings->Connection.Location = settings->Location; | 1765 | settings->Connection.Location = settings->Location; |
1761 | error = N6510_GetConnectionSettings(s, &settings->Connection, N6510_SYNCML_SETTINGS); | 1766 | error = N6510_GetConnectionSettings(s, &settings->Connection, N6510_SYNCML_SETTINGS); |
1762 | if (error != ERR_NONE) return error; | 1767 | if (error != ERR_NONE) return error; |
1763 | 1768 | ||
1764 | settings->Active = settings->Connection.Active; | 1769 | settings->Active = settings->Connection.Active; |
1765 | 1770 | ||
1766 | settings->Name[0] = 0; | 1771 | settings->Name[0] = 0; |
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"); |
1770 | //error = GSM_WaitFor (s, NameReq, 16, 0x43, 4, ID_GetSyncMLName); | 1776 | //error = GSM_WaitFor (s, NameReq, 16, 0x43, 4, ID_GetSyncMLName); |
1771 | //if (error != ERR_NONE) return error; | 1777 | //if (error != ERR_NONE) return error; |
1772 | 1778 | ||
1773 | req[9] = settings->Location - 1; | 1779 | req[9] = settings->Location - 1; |
1774 | smprintf(s, "Getting additional SyncML settings\n"); | 1780 | smprintf(s, "Getting additional SyncML settings\n"); |
1775 | return GSM_WaitFor (s, req, 16, 0x43, 4, ID_GetSyncMLSettings); | 1781 | return GSM_WaitFor (s, req, 16, 0x43, 4, ID_GetSyncMLSettings); |
1776 | } | 1782 | } |
1777 | 1783 | ||
1778 | static GSM_Error N6510_ReplyGetChatSettings(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1784 | static GSM_Error N6510_ReplyGetChatSettings(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1779 | { | 1785 | { |
1780 | GSM_ChatSettings *Sett = s->Phone.Data.ChatSettings; | 1786 | GSM_ChatSettings *Sett = s->Phone.Data.ChatSettings; |
1781 | int i; | 1787 | int i; |
1782 | 1788 | ||
1783 | Sett->Name[0] = 0; | 1789 | Sett->Name[0] = 0; |
1784 | Sett->Name[1] = 0; | 1790 | Sett->Name[1] = 0; |
1785 | Sett->HomePage[0] = 0; | 1791 | Sett->HomePage[0] = 0; |
1786 | Sett->HomePage[1] = 0; | 1792 | Sett->HomePage[1] = 0; |
1787 | Sett->User[0] = 0; | 1793 | Sett->User[0] = 0; |
1788 | Sett->User[1] = 0; | 1794 | Sett->User[1] = 0; |
1789 | Sett->Password[0] = 0; | 1795 | Sett->Password[0] = 0; |
1790 | Sett->Password[1] = 0; | 1796 | Sett->Password[1] = 0; |
1791 | 1797 | ||
1792 | switch(msg.Buffer[3]) { | 1798 | switch(msg.Buffer[3]) { |
@@ -2262,49 +2268,49 @@ static GSM_Error N6510_DeleteSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms | |||
2262 | unsigned char req[] = {N6110_FRAME_HEADER, 0x04, | 2268 | unsigned char req[] = {N6110_FRAME_HEADER, 0x04, |
2263 | 0x01, /* 0x01=SM, 0x02=ME */ | 2269 | 0x01, /* 0x01=SM, 0x02=ME */ |
2264 | 0x00, /* FolderID */ | 2270 | 0x00, /* FolderID */ |
2265 | 0x00, 0x02, /* Location */ | 2271 | 0x00, 0x02, /* Location */ |
2266 | 0x0F, 0x55}; | 2272 | 0x0F, 0x55}; |
2267 | 2273 | ||
2268 | N6510_GetSMSLocation(s, sms, &folderid, &location); | 2274 | N6510_GetSMSLocation(s, sms, &folderid, &location); |
2269 | 2275 | ||
2270 | switch (folderid) { | 2276 | switch (folderid) { |
2271 | case 0x01: req[5] = 0x02; break; /* INBOX SIM */ | 2277 | case 0x01: req[5] = 0x02; break; /* INBOX SIM */ |
2272 | case 0x02: req[5] = 0x03; break; /* OUTBOX SIM */ | 2278 | case 0x02: req[5] = 0x03; break; /* OUTBOX SIM */ |
2273 | default : req[5] = folderid - 1; req[4] = 0x02; break; /* ME folders*/ | 2279 | default : req[5] = folderid - 1; req[4] = 0x02; break; /* ME folders*/ |
2274 | } | 2280 | } |
2275 | req[6]=location / 256; | 2281 | req[6]=location / 256; |
2276 | req[7]=location; | 2282 | req[7]=location; |
2277 | 2283 | ||
2278 | smprintf(s, "Deleting sms\n"); | 2284 | smprintf(s, "Deleting sms\n"); |
2279 | return GSM_WaitFor (s, req, 10, 0x14, 4, ID_DeleteSMSMessage); | 2285 | return GSM_WaitFor (s, req, 10, 0x14, 4, ID_DeleteSMSMessage); |
2280 | } | 2286 | } |
2281 | 2287 | ||
2282 | static GSM_Error N6510_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s) | 2288 | static GSM_Error N6510_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s) |
2283 | { | 2289 | { |
2284 | switch (msg.Buffer[8]) { | 2290 | switch (msg.Buffer[8]) { |
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]); |
2288 | return ERR_NONE; | 2294 | return ERR_NONE; |
2289 | default: | 2295 | default: |
2290 | smprintf(s, "SMS not sent OK, error code probably %i\n",msg.Buffer[8]); | 2296 | smprintf(s, "SMS not sent OK, error code probably %i\n",msg.Buffer[8]); |
2291 | if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,msg.Buffer[8],msg.Buffer[10]); | 2297 | if (s->User.SendSMSStatus!=NULL) s->User.SendSMSStatus(s->CurrentConfig->Device,msg.Buffer[8],msg.Buffer[10]); |
2292 | return ERR_NONE; | 2298 | return ERR_NONE; |
2293 | } | 2299 | } |
2294 | } | 2300 | } |
2295 | 2301 | ||
2296 | static GSM_Error N6510_SendSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms) | 2302 | static GSM_Error N6510_SendSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms) |
2297 | { | 2303 | { |
2298 | int length = 11; | 2304 | int length = 11; |
2299 | GSM_Error error; | 2305 | GSM_Error error; |
2300 | GSM_SMSMessageLayout Layout; | 2306 | GSM_SMSMessageLayout Layout; |
2301 | unsigned char req [300] = { | 2307 | unsigned char req [300] = { |
2302 | N6110_FRAME_HEADER, 0x02, 0x00, 0x00, 0x00, 0x55, 0x55}; | 2308 | N6110_FRAME_HEADER, 0x02, 0x00, 0x00, 0x00, 0x55, 0x55}; |
2303 | 2309 | ||
2304 | if (sms->PDU == SMS_Deliver) sms->PDU = SMS_Submit; | 2310 | if (sms->PDU == SMS_Deliver) sms->PDU = SMS_Submit; |
2305 | memset(req+9,0x00,sizeof(req) - 9); | 2311 | memset(req+9,0x00,sizeof(req) - 9); |
2306 | error=N6510_EncodeSMSFrame(s, sms, req + 9, &Layout, &length); | 2312 | error=N6510_EncodeSMSFrame(s, sms, req + 9, &Layout, &length); |
2307 | if (error != ERR_NONE) return error; | 2313 | if (error != ERR_NONE) return error; |
2308 | 2314 | ||
2309 | smprintf(s, "Sending sms\n"); | 2315 | smprintf(s, "Sending sms\n"); |
2310 | return s->Protocol.Functions->WriteMessage(s, req, length + 9, 0x02); | 2316 | return s->Protocol.Functions->WriteMessage(s, req, length + 9, 0x02); |
@@ -2749,48 +2755,49 @@ static GSM_Error N6510_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi | |||
2749 | static GSM_Error N6510_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) | 2755 | static GSM_Error N6510_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) |
2750 | { | 2756 | { |
2751 | GSM_AllRingtonesInfo Info; | 2757 | GSM_AllRingtonesInfo Info; |
2752 | GSM_Error error; | 2758 | GSM_Error error; |
2753 | unsigned char req2[6] = {N7110_FRAME_HEADER, 0x12, | 2759 | unsigned char req2[6] = {N7110_FRAME_HEADER, 0x12, |
2754 | 0x00, 0xe7}; /* Location */ | 2760 | 0x00, 0xe7}; /* Location */ |
2755 | 2761 | ||
2756 | if (Ringtone->Format == 0x00) Ringtone->Format = RING_NOKIABINARY; | 2762 | if (Ringtone->Format == 0x00) Ringtone->Format = RING_NOKIABINARY; |
2757 | 2763 | ||
2758 | switch (Ringtone->Format) { | 2764 | switch (Ringtone->Format) { |
2759 | case RING_NOTETONE: | 2765 | case RING_NOTETONE: |
2760 | /* In the future get binary and convert */ | 2766 | /* In the future get binary and convert */ |
2761 | return ERR_NOTSUPPORTED; | 2767 | return ERR_NOTSUPPORTED; |
2762 | case RING_NOKIABINARY: | 2768 | case RING_NOKIABINARY: |
2763 | s->Phone.Data.Ringtone= Ringtone; | 2769 | s->Phone.Data.Ringtone= Ringtone; |
2764 | Info.Number = 0; | 2770 | Info.Number = 0; |
2765 | error=N6510_PrivGetRingtonesInfo(s, &Info, PhoneRingtone); | 2771 | error=N6510_PrivGetRingtonesInfo(s, &Info, PhoneRingtone); |
2766 | if (error != ERR_NONE) return error; | 2772 | if (error != ERR_NONE) return error; |
2767 | if (Ringtone->Location > Info.Number) return ERR_INVALIDLOCATION; | 2773 | if (Ringtone->Location > Info.Number) return ERR_INVALIDLOCATION; |
2768 | req2[4] = Info.Ringtone[Ringtone->Location-1].ID / 256; | 2774 | req2[4] = Info.Ringtone[Ringtone->Location-1].ID / 256; |
2769 | req2[5] = Info.Ringtone[Ringtone->Location-1].ID % 256; | 2775 | req2[5] = Info.Ringtone[Ringtone->Location-1].ID % 256; |
2770 | smprintf(s, "Getting binary ringtone\n"); | 2776 | smprintf(s, "Getting binary ringtone\n"); |
2771 | return GSM_WaitFor (s, req2, 6, 0x1f, 4, ID_GetRingtone); | 2777 | return GSM_WaitFor (s, req2, 6, 0x1f, 4, ID_GetRingtone); |
2772 | case RING_MIDI: | 2778 | case RING_MIDI: |
2779 | case RING_MMF: | ||
2773 | return ERR_NOTSUPPORTED; | 2780 | return ERR_NOTSUPPORTED; |
2774 | } | 2781 | } |
2775 | return ERR_NOTSUPPORTED; | 2782 | return ERR_NOTSUPPORTED; |
2776 | } | 2783 | } |
2777 | 2784 | ||
2778 | static GSM_Error N6510_PlayTone(GSM_StateMachine *s, int Herz, unsigned char Volume, bool start) | 2785 | static GSM_Error N6510_PlayTone(GSM_StateMachine *s, int Herz, unsigned char Volume, bool start) |
2779 | { | 2786 | { |
2780 | GSM_Error error; | 2787 | GSM_Error error; |
2781 | unsigned char reqStart[] = { | 2788 | unsigned char reqStart[] = { |
2782 | 0x00,0x06,0x01,0x00,0x07,0x00 }; | 2789 | 0x00,0x06,0x01,0x00,0x07,0x00 }; |
2783 | unsigned char reqPlay[] = { | 2790 | unsigned char reqPlay[] = { |
2784 | 0x00,0x06,0x01,0x14,0x05,0x04, | 2791 | 0x00,0x06,0x01,0x14,0x05,0x04, |
2785 | 0x00,0x00,0x00,0x03,0x03,0x08, | 2792 | 0x00,0x00,0x00,0x03,0x03,0x08, |
2786 | 0x00,0x00,0x00,0x01,0x00,0x00, | 2793 | 0x00,0x00,0x00,0x01,0x00,0x00, |
2787 | 0x03,0x08,0x01,0x00, | 2794 | 0x03,0x08,0x01,0x00, |
2788 | 0x07,0xd0,/*Frequency */ | 2795 | 0x07,0xd0,/*Frequency */ |
2789 | 0x00,0x00,0x03,0x08,0x02,0x00,0x00, | 2796 | 0x00,0x00,0x03,0x08,0x02,0x00,0x00, |
2790 | 0x05, /*Volume */ | 2797 | 0x05, /*Volume */ |
2791 | 0x00,0x00}; | 2798 | 0x00,0x00}; |
2792 | unsigned char reqOff[] = { | 2799 | unsigned char reqOff[] = { |
2793 | 0x00,0x06,0x01,0x14,0x05,0x05, | 2800 | 0x00,0x06,0x01,0x14,0x05,0x05, |
2794 | 0x00,0x00,0x00,0x01,0x03,0x08, | 2801 | 0x00,0x00,0x00,0x01,0x03,0x08, |
2795 | 0x05,0x00,0x00,0x08,0x00,0x00}; | 2802 | 0x05,0x00,0x00,0x08,0x00,0x00}; |
2796 | // unsigned char reqOff2[] = { | 2803 | // unsigned char reqOff2[] = { |
@@ -2965,48 +2972,51 @@ static GSM_Error N6510_ReplyGetProfile(GSM_Protocol_Message msg, GSM_StateMachin | |||
2965 | } | 2972 | } |
2966 | return ERR_NONE; | 2973 | return ERR_NONE; |
2967 | case 0x06: | 2974 | case 0x06: |
2968 | Data->Profile->Active = false; | 2975 | Data->Profile->Active = false; |
2969 | if (Data->Profile->Location == msg.Buffer[5]) Data->Profile->Active = true; | 2976 | if (Data->Profile->Location == msg.Buffer[5]) Data->Profile->Active = true; |
2970 | return ERR_NONE; | 2977 | return ERR_NONE; |
2971 | } | 2978 | } |
2972 | return ERR_UNKNOWNRESPONSE; | 2979 | return ERR_UNKNOWNRESPONSE; |
2973 | } | 2980 | } |
2974 | 2981 | ||
2975 | static GSM_Error N6510_GetProfile(GSM_StateMachine *s, GSM_Profile *Profile) | 2982 | static GSM_Error N6510_GetProfile(GSM_StateMachine *s, GSM_Profile *Profile) |
2976 | { | 2983 | { |
2977 | unsigned char req[150] = {N6110_FRAME_HEADER, 0x01, 0x01, 0x0C, 0x01}; | 2984 | unsigned char req[150] = {N6110_FRAME_HEADER, 0x01, 0x01, 0x0C, 0x01}; |
2978 | unsigned charreqActive[] = {N6110_FRAME_HEADER, 0x05}; | 2985 | unsigned charreqActive[] = {N6110_FRAME_HEADER, 0x05}; |
2979 | int i, length = 7; | 2986 | int i, length = 7; |
2980 | GSM_Errorerror; | 2987 | GSM_Errorerror; |
2981 | 2988 | ||
2982 | /* For now !!! */ | 2989 | /* For now !!! */ |
2983 | if (!strcmp(s->Phone.Data.ModelInfo->model,"3510")) { | 2990 | if (!strcmp(s->Phone.Data.ModelInfo->model,"3510")) { |
2984 | if (s->Phone.Data.VerNum>3.37) return ERR_NOTSUPPORTED; | 2991 | if (s->Phone.Data.VerNum>3.37) return ERR_NOTSUPPORTED; |
2985 | } | 2992 | } |
2986 | if (!strcmp(s->Phone.Data.ModelInfo->model,"6230")) { | 2993 | if (!strcmp(s->Phone.Data.ModelInfo->model,"6230")) { |
2987 | return ERR_NOTSUPPORTED; | 2994 | return ERR_NOTSUPPORTED; |
2988 | } | 2995 | } |
2996 | if (!strcmp(s->Phone.Data.ModelInfo->model,"5140")) { | ||
2997 | return ERR_NOTSUPPORTED; | ||
2998 | } | ||
2989 | 2999 | ||
2990 | if (Profile->Location>5) return ERR_INVALIDLOCATION; | 3000 | if (Profile->Location>5) return ERR_INVALIDLOCATION; |
2991 | 3001 | ||
2992 | for (i = 0; i < 0x0a; i++) { | 3002 | for (i = 0; i < 0x0a; i++) { |
2993 | req[length++] = 0x04; | 3003 | req[length++] = 0x04; |
2994 | req[length++] = Profile->Location; | 3004 | req[length++] = Profile->Location; |
2995 | req[length++] = i; | 3005 | req[length++] = i; |
2996 | req[length++] = 0x01; | 3006 | req[length++] = 0x01; |
2997 | } | 3007 | } |
2998 | 3008 | ||
2999 | req[length++] = 0x04; | 3009 | req[length++] = 0x04; |
3000 | req[length++] = Profile->Location; | 3010 | req[length++] = Profile->Location; |
3001 | req[length++] = 0x0c; | 3011 | req[length++] = 0x0c; |
3002 | req[length++] = 0x01; | 3012 | req[length++] = 0x01; |
3003 | 3013 | ||
3004 | req[length++] = 0x04; | 3014 | req[length++] = 0x04; |
3005 | 3015 | ||
3006 | Profile->CarKitProfile= false; | 3016 | Profile->CarKitProfile= false; |
3007 | Profile->HeadSetProfile= false; | 3017 | Profile->HeadSetProfile= false; |
3008 | 3018 | ||
3009 | Profile->FeaturesNumber = 0; | 3019 | Profile->FeaturesNumber = 0; |
3010 | 3020 | ||
3011 | s->Phone.Data.Profile=Profile; | 3021 | s->Phone.Data.Profile=Profile; |
3012 | smprintf(s, "Getting profile\n"); | 3022 | smprintf(s, "Getting profile\n"); |
@@ -3094,146 +3104,176 @@ static GSM_Error N6510_SetProfile(GSM_StateMachine *s, GSM_Profile *Profile) | |||
3094 | } | 3104 | } |
3095 | 3105 | ||
3096 | static GSM_Error N6510_ReplyIncomingSMS(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3106 | static GSM_Error N6510_ReplyIncomingSMS(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3097 | { | 3107 | { |
3098 | GSM_SMSMessage sms; | 3108 | GSM_SMSMessage sms; |
3099 | 3109 | ||
3100 | #ifdef DEBUG | 3110 | #ifdef DEBUG |
3101 | smprintf(s, "SMS message received\n"); | 3111 | smprintf(s, "SMS message received\n"); |
3102 | N6510_DecodeSMSFrame(s, &sms, msg.Buffer+10); | 3112 | N6510_DecodeSMSFrame(s, &sms, msg.Buffer+10); |
3103 | #endif | 3113 | #endif |
3104 | 3114 | ||
3105 | if (s->Phone.Data.EnableIncomingSMS && s->User.IncomingSMS!=NULL) { | 3115 | if (s->Phone.Data.EnableIncomingSMS && s->User.IncomingSMS!=NULL) { |
3106 | sms.State = SMS_UnRead; | 3116 | sms.State = SMS_UnRead; |
3107 | sms.InboxFolder = true; | 3117 | sms.InboxFolder = true; |
3108 | 3118 | ||
3109 | N6510_DecodeSMSFrame(s, &sms, msg.Buffer+10); | 3119 | N6510_DecodeSMSFrame(s, &sms, msg.Buffer+10); |
3110 | 3120 | ||
3111 | s->User.IncomingSMS(s->CurrentConfig->Device,sms); | 3121 | s->User.IncomingSMS(s->CurrentConfig->Device,sms); |
3112 | } | 3122 | } |
3113 | return ERR_NONE; | 3123 | return ERR_NONE; |
3114 | } | 3124 | } |
3115 | 3125 | ||
3116 | static GSM_Error N6510_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber) | 3126 | static GSM_Error N6510_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber) |
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 | ||
3122 | req[pos++] = strlen(number); | 3144 | req[pos++] = strlen(number); |
3123 | EncodeUnicode(req+pos,number,strlen(number)); | 3145 | EncodeUnicode(req+pos,number,strlen(number)); |
3124 | pos += strlen(number)*2; | 3146 | pos += strlen(number)*2; |
3125 | req[pos++] = 0x05; /* call type: voice - 0x05, data - 0x01 */ | 3147 | req[pos++] = 0x05; /* call type: voice - 0x05, data - 0x01 */ |
3126 | req[pos++] = 0x01; | 3148 | req[pos++] = 0x01; |
3127 | req[pos++] = 0x05; | 3149 | req[pos++] = 0x05; |
3128 | req[pos++] = 0x00; | 3150 | req[pos++] = 0x00; |
3129 | req[pos++] = 0x02; | 3151 | req[pos++] = 0x02; |
3130 | req[pos++] = 0x00; | 3152 | req[pos++] = 0x00; |
3131 | req[pos++] = 0x00; | 3153 | req[pos++] = 0x00; |
3132 | switch (ShowNumber) { | 3154 | switch (ShowNumber) { |
3133 | case GSM_CALL_HideNumber: | 3155 | case GSM_CALL_HideNumber: |
3134 | req[pos++] = 0x02; | 3156 | req[pos++] = 0x02; |
3135 | break; | 3157 | break; |
3136 | case GSM_CALL_ShowNumber: | 3158 | case GSM_CALL_ShowNumber: |
3137 | req[pos++] = 0x03; | 3159 | req[pos++] = 0x03; |
3138 | break; | 3160 | break; |
3139 | case GSM_CALL_DefaultNumberPresence: | 3161 | case GSM_CALL_DefaultNumberPresence: |
3140 | req[pos++] = 0x01; | 3162 | req[pos++] = 0x01; |
3141 | break; | 3163 | break; |
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 | } |
3147 | 3181 | ||
3148 | /* method 3 */ | 3182 | /* method 3 */ |
3149 | static GSM_Error N6510_ReplyGetCalendarInfo3(GSM_Protocol_Message msg, GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last) | 3183 | static GSM_Error N6510_ReplyGetCalendarInfo3(GSM_Protocol_Message msg, GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last) |
3150 | { | 3184 | { |
3151 | int i=0,j=0; | 3185 | int i=0,j=0; |
3152 | 3186 | ||
3153 | while (Last->Location[j] != 0x00) j++; | 3187 | while (Last->Location[j] != 0x00) j++; |
3154 | if (j >= GSM_MAXCALENDARTODONOTES) { | 3188 | if (j >= GSM_MAXCALENDARTODONOTES) { |
3155 | smprintf(s, "Increase GSM_MAXCALENDARTODONOTES\n"); | 3189 | smprintf(s, "Increase GSM_MAXCALENDARTODONOTES\n"); |
3156 | return ERR_UNKNOWN; | 3190 | return ERR_UNKNOWN; |
3157 | } | 3191 | } |
3158 | if (j == 0) { | 3192 | if (j == 0) { |
3159 | Last->Number=msg.Buffer[8]*256+msg.Buffer[9]; | 3193 | Last->Number=msg.Buffer[8]*256+msg.Buffer[9]; |
3160 | smprintf(s, "Number of Entries: %i\n",Last->Number); | 3194 | smprintf(s, "Number of Entries: %i\n",Last->Number); |
3161 | } | 3195 | } |
3162 | smprintf(s, "Locations: "); | 3196 | smprintf(s, "Locations: "); |
3163 | while (14+(i*4) <= msg.Length) { | 3197 | while (14+(i*4) <= msg.Length) { |
3164 | Last->Location[j++]=msg.Buffer[12+i*4]*256+msg.Buffer[13+i*4]; | 3198 | Last->Location[j++]=msg.Buffer[12+i*4]*256+msg.Buffer[13+i*4]; |
3165 | smprintf(s, "%i ",Last->Location[j-1]); | 3199 | smprintf(s, "%i ",Last->Location[j-1]); |
3166 | i++; | 3200 | i++; |
3167 | } | 3201 | } |
3168 | smprintf(s, "\nNumber of Entries in frame: %i\n",i); | 3202 | smprintf(s, "\nNumber of Entries in frame: %i\n",i); |
3169 | Last->Location[j] = 0; | 3203 | Last->Location[j] = 0; |
3170 | smprintf(s, "\n"); | 3204 | smprintf(s, "\n"); |
3171 | if (i == 1 && msg.Buffer[12+0*4]*256+msg.Buffer[13+0*4] == 0) return ERR_EMPTY; | 3205 | if (i == 1 && msg.Buffer[12+0*4]*256+msg.Buffer[13+0*4] == 0) return ERR_EMPTY; |
3172 | if (i == 0) return ERR_EMPTY; | 3206 | if (i == 0) return ERR_EMPTY; |
3173 | return ERR_NONE; | 3207 | return ERR_NONE; |
3174 | } | 3208 | } |
3175 | 3209 | ||
3176 | /* method 3 */ | 3210 | /* method 3 */ |
3177 | static GSM_Error N6510_GetCalendarInfo3(GSM_StateMachine *s, GSM_NOKIACalToDoLocations *Last, bool Calendar) | 3211 | static 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; |
3181 | unsigned char req[] = {N6110_FRAME_HEADER, 0x9E, 0xFF, 0xFF, 0x00, 0x00, | 3215 | unsigned char req[] = {N6110_FRAME_HEADER, 0x9E, 0xFF, 0xFF, 0x00, 0x00, |
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 | ||
3185 | Last->Location[0] = 0x00; | 3219 | Last->Location[0] = 0x00; |
3186 | Last->Number = 0; | 3220 | Last->Number = 0; |
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 | } |
3196 | if (error != ERR_NONE && error != ERR_EMPTY) return error; | 3233 | if (error != ERR_NONE && error != ERR_EMPTY) return error; |
3197 | 3234 | ||
3198 | while (1) { | 3235 | while (1) { |
3199 | i=0; | 3236 | i=0; |
3200 | while (Last->Location[i] != 0x00) i++; | 3237 | while (Last->Location[i] != 0x00) i++; |
3201 | smprintf(s, "i = %i %i\n",i,Last->Number); | 3238 | smprintf(s, "i = %i %i\n",i,Last->Number); |
3202 | if (i == Last->Number) break; | 3239 | if (i == Last->Number) break; |
3203 | if (i != Last->Number && error == ERR_EMPTY) { | 3240 | if (i != Last->Number && error == ERR_EMPTY) { |
3204 | smprintf(s, "Phone doesn't support some notes with this method. Workaround\n"); | 3241 | smprintf(s, "Phone doesn't support some notes with this method. Workaround\n"); |
3205 | Last->Number = i; | 3242 | Last->Number = i; |
3206 | break; | 3243 | break; |
3207 | } | 3244 | } |
3208 | req[8] = Last->Location[i-1] / 256; | 3245 | req[8] = Last->Location[i-1] / 256; |
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 | } |
3217 | if (error != ERR_NONE && error != ERR_EMPTY) return error; | 3257 | if (error != ERR_NONE && error != ERR_EMPTY) return error; |
3218 | } | 3258 | } |
3219 | return ERR_NONE; | 3259 | return ERR_NONE; |
3220 | } | 3260 | } |
3221 | 3261 | ||
3222 | /* method 3 */ | 3262 | /* method 3 */ |
3223 | GSM_Error N6510_ReplyGetCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3263 | GSM_Error N6510_ReplyGetCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3224 | { | 3264 | { |
3225 | GSM_CalendarEntry *entry = s->Phone.Data.Cal; | 3265 | GSM_CalendarEntry *entry = s->Phone.Data.Cal; |
3226 | GSM_DateTime Date; | 3266 | GSM_DateTime Date; |
3227 | unsigned long diff; | 3267 | unsigned long diff; |
3228 | int i; | 3268 | int i; |
3229 | bool found = false; | 3269 | bool found = false; |
3230 | GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; | 3270 | GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; |
3231 | 3271 | ||
3232 | smprintf(s, "Calendar note received method 3\n"); | 3272 | smprintf(s, "Calendar note received method 3\n"); |
3233 | 3273 | ||
3234 | smprintf(s,"Note type %02i: ",msg.Buffer[27]); | 3274 | smprintf(s,"Note type %02i: ",msg.Buffer[27]); |
3235 | switch(msg.Buffer[27]) { | 3275 | switch(msg.Buffer[27]) { |
3236 | case 0x00: smprintf(s,"Reminder\n"); entry->Type = GSM_CAL_REMINDER; break; | 3276 | case 0x00: smprintf(s,"Reminder\n"); entry->Type = GSM_CAL_REMINDER; break; |
3237 | case 0x01: smprintf(s,"Meeting\n"); entry->Type = GSM_CAL_MEETING; break; | 3277 | case 0x01: smprintf(s,"Meeting\n"); entry->Type = GSM_CAL_MEETING; break; |
3238 | case 0x02: smprintf(s,"Call\n"); entry->Type = GSM_CAL_CALL; break; | 3278 | case 0x02: smprintf(s,"Call\n"); entry->Type = GSM_CAL_CALL; break; |
3239 | case 0x04: smprintf(s,"Birthday\n"); entry->Type = GSM_CAL_BIRTHDAY; break; | 3279 | case 0x04: smprintf(s,"Birthday\n"); entry->Type = GSM_CAL_BIRTHDAY; break; |
@@ -3329,93 +3369,99 @@ GSM_Error N6510_ReplyGetCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s) | |||
3329 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[51]*2] = 0; | 3369 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[51]*2] = 0; |
3330 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[51]*2+1] = 0; | 3370 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[51]*2+1] = 0; |
3331 | entry->Entries[entry->EntriesNum].EntryType = CAL_TEXT; | 3371 | entry->Entries[entry->EntriesNum].EntryType = CAL_TEXT; |
3332 | entry->EntriesNum++; | 3372 | entry->EntriesNum++; |
3333 | smprintf(s, "Note text: \"%s\"\n",DecodeUnicodeString(entry->Entries[entry->EntriesNum-1].Text)); | 3373 | smprintf(s, "Note text: \"%s\"\n",DecodeUnicodeString(entry->Entries[entry->EntriesNum-1].Text)); |
3334 | 3374 | ||
3335 | if (entry->Type == GSM_CAL_CALL) { | 3375 | if (entry->Type == GSM_CAL_CALL) { |
3336 | memcpy(entry->Entries[entry->EntriesNum].Text, msg.Buffer+(54+msg.Buffer[51]*2), msg.Buffer[52]*2); | 3376 | memcpy(entry->Entries[entry->EntriesNum].Text, msg.Buffer+(54+msg.Buffer[51]*2), msg.Buffer[52]*2); |
3337 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2] = 0; | 3377 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2] = 0; |
3338 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2+1] = 0; | 3378 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2+1] = 0; |
3339 | entry->Entries[entry->EntriesNum].EntryType = CAL_PHONE; | 3379 | entry->Entries[entry->EntriesNum].EntryType = CAL_PHONE; |
3340 | entry->EntriesNum++; | 3380 | entry->EntriesNum++; |
3341 | } | 3381 | } |
3342 | if (entry->Type == GSM_CAL_MEETING) { | 3382 | if (entry->Type == GSM_CAL_MEETING) { |
3343 | memcpy(entry->Entries[entry->EntriesNum].Text, msg.Buffer+(54+msg.Buffer[51]*2), msg.Buffer[52]*2); | 3383 | memcpy(entry->Entries[entry->EntriesNum].Text, msg.Buffer+(54+msg.Buffer[51]*2), msg.Buffer[52]*2); |
3344 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2] = 0; | 3384 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2] = 0; |
3345 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2+1] = 0; | 3385 | entry->Entries[entry->EntriesNum].Text[msg.Buffer[52]*2+1] = 0; |
3346 | entry->Entries[entry->EntriesNum].EntryType = CAL_LOCATION; | 3386 | entry->Entries[entry->EntriesNum].EntryType = CAL_LOCATION; |
3347 | entry->EntriesNum++; | 3387 | entry->EntriesNum++; |
3348 | } | 3388 | } |
3349 | 3389 | ||
3350 | return ERR_NONE; | 3390 | return ERR_NONE; |
3351 | } | 3391 | } |
3352 | 3392 | ||
3393 | static 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 | |||
3353 | static GSM_Error N6510_PrivGetCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, int *LastCalendarYear) | 3405 | static GSM_Error N6510_PrivGetCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, int *LastCalendarYear) |
3354 | { | 3406 | { |
3355 | GSM_Error error; | 3407 | GSM_Error error; |
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 | ||
3361 | if (start) { | 3410 | if (start) { |
3362 | /* We have to get current year. It's NOT written in frame for | 3411 | /* We have to get current year. It's NOT written in frame for |
3363 | * Birthday | 3412 | * Birthday |
3364 | */ | 3413 | */ |
3365 | error=s->Phone.Functions->GetDateTime(s,&date_time); | 3414 | error=s->Phone.Functions->GetDateTime(s,&date_time); |
3366 | switch (error) { | 3415 | switch (error) { |
3367 | case ERR_EMPTY: | 3416 | case ERR_EMPTY: |
3368 | case ERR_NOTIMPLEMENTED: | 3417 | case ERR_NOTIMPLEMENTED: |
3369 | GSM_GetCurrentDateTime(&date_time); | 3418 | GSM_GetCurrentDateTime(&date_time); |
3370 | break; | 3419 | break; |
3371 | case ERR_NONE: | 3420 | case ERR_NONE: |
3372 | break; | 3421 | break; |
3373 | default: | 3422 | default: |
3374 | return error; | 3423 | return error; |
3375 | } | 3424 | } |
3376 | *LastCalendarYear = date_time.Year; | 3425 | *LastCalendarYear = date_time.Year; |
3377 | } | 3426 | } |
3378 | 3427 | ||
3379 | Note->EntriesNum = 0; | 3428 | Note->EntriesNum = 0; |
3380 | Note->Entries[0].Date.Year = *LastCalendarYear; | 3429 | Note->Entries[0].Date.Year = *LastCalendarYear; |
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 | } |
3389 | 3435 | ||
3390 | /* method 3 */ | 3436 | /* method 3 */ |
3391 | GSM_Error N6510_GetNextCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, GSM_NOKIACalToDoLocations *LastCalendar, int *LastCalendarYear, int *LastCalendarPos) | 3437 | GSM_Error N6510_GetNextCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start, GSM_NOKIACalToDoLocations *LastCalendar, int *LastCalendarYear, int *LastCalendarPos) |
3392 | { | 3438 | { |
3393 | GSM_Error error; | 3439 | GSM_Error error; |
3394 | bool start2; | 3440 | bool start2; |
3395 | 3441 | ||
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; |
3399 | if (LastCalendar->Number == 0) return ERR_EMPTY; | 3445 | if (LastCalendar->Number == 0) return ERR_EMPTY; |
3400 | 3446 | ||
3401 | *LastCalendarPos = 0; | 3447 | *LastCalendarPos = 0; |
3402 | } else { | 3448 | } else { |
3403 | (*LastCalendarPos)++; | 3449 | (*LastCalendarPos)++; |
3404 | } | 3450 | } |
3405 | 3451 | ||
3406 | error = ERR_EMPTY; | 3452 | error = ERR_EMPTY; |
3407 | start2 = start; | 3453 | start2 = start; |
3408 | while (error == ERR_EMPTY) { | 3454 | while (error == ERR_EMPTY) { |
3409 | if (*LastCalendarPos >= LastCalendar->Number) return ERR_EMPTY; | 3455 | if (*LastCalendarPos >= LastCalendar->Number) return ERR_EMPTY; |
3410 | 3456 | ||
3411 | Note->Location = LastCalendar->Location[*LastCalendarPos]; | 3457 | Note->Location = LastCalendar->Location[*LastCalendarPos]; |
3412 | error=N6510_PrivGetCalendar3(s, Note, start2, LastCalendarYear); | 3458 | error=N6510_PrivGetCalendar3(s, Note, start2, LastCalendarYear); |
3413 | if (error == ERR_EMPTY) (*LastCalendarPos)++; | 3459 | if (error == ERR_EMPTY) (*LastCalendarPos)++; |
3414 | 3460 | ||
3415 | start2 = false; | 3461 | start2 = false; |
3416 | } | 3462 | } |
3417 | return error; | 3463 | return error; |
3418 | } | 3464 | } |
3419 | 3465 | ||
3420 | static GSM_Error N6510_ReplyGetCalendarInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3466 | static GSM_Error N6510_ReplyGetCalendarInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3421 | { | 3467 | { |
@@ -3456,66 +3502,66 @@ static GSM_Error N6510_ReplyGetCalendarNotePos(GSM_Protocol_Message msg, GSM_Sta | |||
3456 | case 0x96: | 3502 | case 0x96: |
3457 | return N6510_ReplyGetCalendarNotePos3(msg, s,&s->Phone.Data.Priv.N6510.FirstCalendarPos); | 3503 | return N6510_ReplyGetCalendarNotePos3(msg, s,&s->Phone.Data.Priv.N6510.FirstCalendarPos); |
3458 | } | 3504 | } |
3459 | return ERR_UNKNOWNRESPONSE; | 3505 | return ERR_UNKNOWNRESPONSE; |
3460 | } | 3506 | } |
3461 | 3507 | ||
3462 | static GSM_Error N6510_FindCalendarIconID3(GSM_StateMachine *s, GSM_CalendarEntry *Entry, unsigned char *ID) | 3508 | static GSM_Error N6510_FindCalendarIconID3(GSM_StateMachine *s, GSM_CalendarEntry *Entry, unsigned char *ID) |
3463 | { | 3509 | { |
3464 | int i,j,LastCalendarYear; | 3510 | int i,j,LastCalendarYear; |
3465 | GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; | 3511 | GSM_Phone_N6510Data *Priv = &s->Phone.Data.Priv.N6510; |
3466 | GSM_CalendarEntry Note; | 3512 | GSM_CalendarEntry Note; |
3467 | GSM_NOKIACalToDoLocationsLastCalendar1,LastCalendar2; | 3513 | GSM_NOKIACalToDoLocationsLastCalendar1,LastCalendar2; |
3468 | GSM_Error error; | 3514 | GSM_Error error; |
3469 | bool found; | 3515 | bool found; |
3470 | 3516 | ||
3471 | for(i=0;i<Priv->CalendarIconsNum;i++) { | 3517 | for(i=0;i<Priv->CalendarIconsNum;i++) { |
3472 | if (Priv->CalendarIconsTypes[i] == Entry->Type) { | 3518 | if (Priv->CalendarIconsTypes[i] == Entry->Type) { |
3473 | *ID = Priv->CalendarIcons[i]; | 3519 | *ID = Priv->CalendarIcons[i]; |
3474 | return ERR_NONE; | 3520 | return ERR_NONE; |
3475 | } | 3521 | } |
3476 | } | 3522 | } |
3477 | 3523 | ||
3478 | smprintf(s, "Starting finding note ID\n"); | 3524 | smprintf(s, "Starting finding note ID\n"); |
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)); |
3482 | if (error != ERR_NONE) return error; | 3528 | if (error != ERR_NONE) return error; |
3483 | 3529 | ||
3484 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL35) || | 3530 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL35) || |
3485 | IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL65) || | 3531 | IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL65) || |
3486 | IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { | 3532 | IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { |
3487 | error=N71_65_AddCalendar2(s,Entry); | 3533 | error=N71_65_AddCalendar2(s,Entry); |
3488 | } else { | 3534 | } else { |
3489 | if (Entry->Type == GSM_CAL_MEETING) { | 3535 | if (Entry->Type == GSM_CAL_MEETING) { |
3490 | error=N71_65_AddCalendar1(s, Entry, &s->Phone.Data.Priv.N6510.FirstCalendarPos); | 3536 | error=N71_65_AddCalendar1(s, Entry, &s->Phone.Data.Priv.N6510.FirstCalendarPos); |
3491 | } else { | 3537 | } else { |
3492 | error=N71_65_AddCalendar2(s,Entry); | 3538 | error=N71_65_AddCalendar2(s,Entry); |
3493 | } | 3539 | } |
3494 | } | 3540 | } |
3495 | if (error != ERR_NONE) return error; | 3541 | if (error != ERR_NONE) return error; |
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)); |
3499 | if (error != ERR_NONE) return error; | 3545 | if (error != ERR_NONE) return error; |
3500 | 3546 | ||
3501 | smprintf(s,"Number of entries: %i %i\n",LastCalendar1.Number,LastCalendar2.Number); | 3547 | smprintf(s,"Number of entries: %i %i\n",LastCalendar1.Number,LastCalendar2.Number); |
3502 | 3548 | ||
3503 | for(i=0;i<LastCalendar2.Number;i++) { | 3549 | for(i=0;i<LastCalendar2.Number;i++) { |
3504 | found = true; | 3550 | found = true; |
3505 | for(j=0;j<LastCalendar1.Number;j++) { | 3551 | for(j=0;j<LastCalendar1.Number;j++) { |
3506 | if (LastCalendar1.Location[j] == LastCalendar2.Location[i]) { | 3552 | if (LastCalendar1.Location[j] == LastCalendar2.Location[i]) { |
3507 | found = false; | 3553 | found = false; |
3508 | break; | 3554 | break; |
3509 | } | 3555 | } |
3510 | } | 3556 | } |
3511 | if (found) { | 3557 | if (found) { |
3512 | Note.Location = LastCalendar2.Location[i]; | 3558 | Note.Location = LastCalendar2.Location[i]; |
3513 | error=N6510_PrivGetCalendar3(s, &Note, true, &LastCalendarYear); | 3559 | error=N6510_PrivGetCalendar3(s, &Note, true, &LastCalendarYear); |
3514 | if (error != ERR_NONE) return error; | 3560 | if (error != ERR_NONE) return error; |
3515 | 3561 | ||
3516 | error=N71_65_DelCalendar(s, &Note); | 3562 | error=N71_65_DelCalendar(s, &Note); |
3517 | if (error != ERR_NONE) return error; | 3563 | if (error != ERR_NONE) return error; |
3518 | 3564 | ||
3519 | smprintf(s, "Ending finding note ID\n"); | 3565 | smprintf(s, "Ending finding note ID\n"); |
3520 | 3566 | ||
3521 | for(j=0;j<Priv->CalendarIconsNum;j++) { | 3567 | for(j=0;j<Priv->CalendarIconsNum;j++) { |
@@ -3716,49 +3762,49 @@ static GSM_Error N6510_GetNextCalendar(GSM_StateMachine *s, GSM_CalendarEntry * | |||
3716 | 3762 | ||
3717 | static GSM_Error N6510_GetCalendarStatus(GSM_StateMachine *s, GSM_CalendarStatus *Status) | 3763 | static GSM_Error N6510_GetCalendarStatus(GSM_StateMachine *s, GSM_CalendarStatus *Status) |
3718 | { | 3764 | { |
3719 | GSM_Error error; | 3765 | GSM_Error error; |
3720 | 3766 | ||
3721 | #ifdef GSM_FORCE_DCT4_CALENDAR_6210 | 3767 | #ifdef GSM_FORCE_DCT4_CALENDAR_6210 |
3722 | /* Method 1 */ | 3768 | /* Method 1 */ |
3723 | error=N71_65_GetCalendarInfo1(s, &s->Phone.Data.Priv.N6510.LastCalendar); | 3769 | error=N71_65_GetCalendarInfo1(s, &s->Phone.Data.Priv.N6510.LastCalendar); |
3724 | if (error!=ERR_NONE) return error; | 3770 | if (error!=ERR_NONE) return error; |
3725 | Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number; | 3771 | Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number; |
3726 | return ERR_NONE; | 3772 | return ERR_NONE; |
3727 | #endif | 3773 | #endif |
3728 | 3774 | ||
3729 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { | 3775 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { |
3730 | /* Method 1 */ | 3776 | /* Method 1 */ |
3731 | error=N71_65_GetCalendarInfo1(s, &s->Phone.Data.Priv.N6510.LastCalendar); | 3777 | error=N71_65_GetCalendarInfo1(s, &s->Phone.Data.Priv.N6510.LastCalendar); |
3732 | if (error!=ERR_NONE) return error; | 3778 | if (error!=ERR_NONE) return error; |
3733 | Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number; | 3779 | Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number; |
3734 | return ERR_NONE; | 3780 | return ERR_NONE; |
3735 | 3781 | ||
3736 | /* Method 2 */ | 3782 | /* Method 2 */ |
3737 | // return ERR_NOTSUPPORTED; | 3783 | // return ERR_NOTSUPPORTED; |
3738 | } else { | 3784 | } else { |
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; |
3742 | Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number; | 3788 | Status->Used = s->Phone.Data.Priv.N6510.LastCalendar.Number; |
3743 | return ERR_NONE; | 3789 | return ERR_NONE; |
3744 | } | 3790 | } |
3745 | } | 3791 | } |
3746 | 3792 | ||
3747 | static GSM_Error N6510_AddCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Note) | 3793 | static GSM_Error N6510_AddCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Note) |
3748 | { | 3794 | { |
3749 | #ifdef GSM_FORCE_DCT4_CALENDAR_6210 | 3795 | #ifdef GSM_FORCE_DCT4_CALENDAR_6210 |
3750 | return N71_65_AddCalendar2(s,Note); | 3796 | return N71_65_AddCalendar2(s,Note); |
3751 | #endif | 3797 | #endif |
3752 | 3798 | ||
3753 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { | 3799 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { |
3754 | return N71_65_AddCalendar2(s,Note); | 3800 | return N71_65_AddCalendar2(s,Note); |
3755 | // return N71_65_AddCalendar1(s, Note, &s->Phone.Data.Priv.N6510.FirstCalendarPos); | 3801 | // return N71_65_AddCalendar1(s, Note, &s->Phone.Data.Priv.N6510.FirstCalendarPos); |
3756 | } else { | 3802 | } else { |
3757 | /* Method 3. All DCT4 features supported. Not supported by 8910 */ | 3803 | /* Method 3. All DCT4 features supported. Not supported by 8910 */ |
3758 | return N6510_AddCalendar3(s, Note, &s->Phone.Data.Priv.N6510.FirstCalendarPos); | 3804 | return N6510_AddCalendar3(s, Note, &s->Phone.Data.Priv.N6510.FirstCalendarPos); |
3759 | } | 3805 | } |
3760 | } | 3806 | } |
3761 | 3807 | ||
3762 | static GSM_Error N6510_ReplyLogIntoNetwork(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3808 | static GSM_Error N6510_ReplyLogIntoNetwork(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3763 | { | 3809 | { |
3764 | smprintf(s, "Probably phone says: I log into network\n"); | 3810 | smprintf(s, "Probably phone says: I log into network\n"); |
@@ -3951,48 +3997,84 @@ GSM_Error N6510_SetLight(GSM_StateMachine *s, N6510_PHONE_LIGHTS light, bool ena | |||
3951 | 3997 | ||
3952 | static GSM_Error N6510_ShowStartInfo(GSM_StateMachine *s, bool enable) | 3998 | static GSM_Error N6510_ShowStartInfo(GSM_StateMachine *s, bool enable) |
3953 | { | 3999 | { |
3954 | GSM_Error error; | 4000 | GSM_Error error; |
3955 | 4001 | ||
3956 | if (enable) { | 4002 | if (enable) { |
3957 | error=N6510_SetLight(s,N6510_LIGHT_DISPLAY,true); | 4003 | error=N6510_SetLight(s,N6510_LIGHT_DISPLAY,true); |
3958 | if (error != ERR_NONE) return error; | 4004 | if (error != ERR_NONE) return error; |
3959 | 4005 | ||
3960 | error=N6510_SetLight(s,N6510_LIGHT_TORCH,true); | 4006 | error=N6510_SetLight(s,N6510_LIGHT_TORCH,true); |
3961 | if (error != ERR_NONE) return error; | 4007 | if (error != ERR_NONE) return error; |
3962 | 4008 | ||
3963 | return N6510_SetLight(s,N6510_LIGHT_KEYPAD,true); | 4009 | return N6510_SetLight(s,N6510_LIGHT_KEYPAD,true); |
3964 | } else { | 4010 | } else { |
3965 | error=N6510_SetLight(s,N6510_LIGHT_DISPLAY,false); | 4011 | error=N6510_SetLight(s,N6510_LIGHT_DISPLAY,false); |
3966 | if (error != ERR_NONE) return error; | 4012 | if (error != ERR_NONE) return error; |
3967 | 4013 | ||
3968 | error=N6510_SetLight(s,N6510_LIGHT_TORCH,false); | 4014 | error=N6510_SetLight(s,N6510_LIGHT_TORCH,false); |
3969 | if (error != ERR_NONE) return error; | 4015 | if (error != ERR_NONE) return error; |
3970 | 4016 | ||
3971 | return N6510_SetLight(s,N6510_LIGHT_KEYPAD,false); | 4017 | return N6510_SetLight(s,N6510_LIGHT_KEYPAD,false); |
3972 | } | 4018 | } |
3973 | } | 4019 | } |
3974 | 4020 | ||
4021 | static 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 | |||
4026 | static 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 | |||
4035 | GSM_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 | |||
3975 | static int N6510_FindFileCheckSum(unsigned char *ptr, int len) | 4057 | static int N6510_FindFileCheckSum(unsigned char *ptr, int len) |
3976 | { | 4058 | { |
3977 | int acc, i, accx; | 4059 | int acc, i, accx; |
3978 | 4060 | ||
3979 | accx = 0; | 4061 | accx = 0; |
3980 | acc = 0xffff; | 4062 | acc = 0xffff; |
3981 | while (len--) { | 4063 | while (len--) { |
3982 | accx = (accx & 0xffff00ff) | (acc & 0xff00); | 4064 | accx = (accx & 0xffff00ff) | (acc & 0xff00); |
3983 | acc = (acc & 0xffff00ff) | *ptr++ << 8; | 4065 | acc = (acc & 0xffff00ff) | *ptr++ << 8; |
3984 | for (i = 0; i < 8; i++) { | 4066 | for (i = 0; i < 8; i++) { |
3985 | acc <<= 1; | 4067 | acc <<= 1; |
3986 | if (acc & 0x10000) acc ^= 0x1021; | 4068 | if (acc & 0x10000) acc ^= 0x1021; |
3987 | if (accx & 0x80000000) acc ^= 0x1021; | 4069 | if (accx & 0x80000000) acc ^= 0x1021; |
3988 | accx <<= 1; | 4070 | accx <<= 1; |
3989 | } | 4071 | } |
3990 | } | 4072 | } |
3991 | dbgprintf("Checksum from Gammu is %04X\n",(acc & 0xffff)); | 4073 | dbgprintf("Checksum from Gammu is %04X\n",(acc & 0xffff)); |
3992 | return (acc & 0xffff); | 4074 | return (acc & 0xffff); |
3993 | } | 4075 | } |
3994 | 4076 | ||
3995 | static GSM_Error N6510_ReplyGetFileFolderInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 4077 | static GSM_Error N6510_ReplyGetFileFolderInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3996 | { | 4078 | { |
3997 | GSM_File *File = s->Phone.Data.FileInfo; | 4079 | GSM_File *File = s->Phone.Data.FileInfo; |
3998 | GSM_Phone_N6510Data*Priv = &s->Phone.Data.Priv.N6510; | 4080 | GSM_Phone_N6510Data*Priv = &s->Phone.Data.Priv.N6510; |
@@ -4034,49 +4116,49 @@ static GSM_Error N6510_ReplyGetFileFolderInfo(GSM_Protocol_Message msg, GSM_Stat | |||
4034 | 4116 | ||
4035 | File->Type = GSM_File_Other; | 4117 | File->Type = GSM_File_Other; |
4036 | if (msg.Length > 240){ | 4118 | if (msg.Length > 240){ |
4037 | i = 227; | 4119 | i = 227; |
4038 | if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x01) | 4120 | if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x01) |
4039 | File->Type = GSM_File_Image_JPG; | 4121 | File->Type = GSM_File_Image_JPG; |
4040 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x02) | 4122 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x02) |
4041 | File->Type = GSM_File_Image_BMP; | 4123 | File->Type = GSM_File_Image_BMP; |
4042 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x07) | 4124 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x07) |
4043 | File->Type = GSM_File_Image_BMP; | 4125 | File->Type = GSM_File_Image_BMP; |
4044 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x03) | 4126 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x03) |
4045 | File->Type = GSM_File_Image_PNG; | 4127 | File->Type = GSM_File_Image_PNG; |
4046 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x05) | 4128 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x05) |
4047 | File->Type = GSM_File_Image_GIF; | 4129 | File->Type = GSM_File_Image_GIF; |
4048 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x09) | 4130 | else if (msg.Buffer[i]==0x02 && msg.Buffer[i+2]==0x09) |
4049 | File->Type = GSM_File_Image_WBMP; | 4131 | File->Type = GSM_File_Image_WBMP; |
4050 | else if (msg.Buffer[i]==0x04 && msg.Buffer[i+2]==0x01) | 4132 | else if (msg.Buffer[i]==0x04 && msg.Buffer[i+2]==0x01) |
4051 | File->Type = GSM_File_Sound_AMR; | 4133 | File->Type = GSM_File_Sound_AMR; |
4052 | else if (msg.Buffer[i]==0x04 && msg.Buffer[i+2]==0x02) | 4134 | else if (msg.Buffer[i]==0x04 && msg.Buffer[i+2]==0x02) |
4053 | File->Type = GSM_File_Sound_MIDI; | 4135 | File->Type = GSM_File_Sound_MIDI; |
4054 | else if (msg.Buffer[i]==0x08 && msg.Buffer[i+2]==0x05) | 4136 | else if (msg.Buffer[i]==0x08 && msg.Buffer[i+2]==0x05) |
4055 | File->Type = GSM_File_Video_3GP; | 4137 | File->Type = GSM_File_Video_3GP; |
4056 | else if (msg.Buffer[i]==0x10 && msg.Buffer[i+2]==0x01) | 4138 | else if (msg.Buffer[i]==0x10 && msg.Buffer[i+2]==0x01) |
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) |
4060 | File->Type = GSM_File_MMS; | 4142 | File->Type = GSM_File_MMS; |
4061 | #endif | 4143 | #endif |
4062 | } | 4144 | } |
4063 | return ERR_NONE; | 4145 | return ERR_NONE; |
4064 | case 0x2F: | 4146 | case 0x2F: |
4065 | smprintf(s,"File or folder used bytes received\n"); | 4147 | smprintf(s,"File or folder used bytes received\n"); |
4066 | File->Used = msg.Buffer[6]*256*256*256+ | 4148 | File->Used = msg.Buffer[6]*256*256*256+ |
4067 | msg.Buffer[7]*256*256+ | 4149 | msg.Buffer[7]*256*256+ |
4068 | msg.Buffer[8]*256+ | 4150 | msg.Buffer[8]*256+ |
4069 | msg.Buffer[9]; | 4151 | msg.Buffer[9]; |
4070 | return ERR_NONE; | 4152 | return ERR_NONE; |
4071 | case 0x33: | 4153 | case 0x33: |
4072 | if (s->Phone.Data.RequestID == ID_GetFileInfo) { | 4154 | if (s->Phone.Data.RequestID == ID_GetFileInfo) { |
4073 | i = Priv->FilesLocationsUsed-1; | 4155 | i = Priv->FilesLocationsUsed-1; |
4074 | while (1) { | 4156 | while (1) { |
4075 | if (i==Priv->FilesLocationsCurrent-1) break; | 4157 | if (i==Priv->FilesLocationsCurrent-1) break; |
4076 | dbgprintf("Copying %i to %i, max %i, current %i\n", | 4158 | dbgprintf("Copying %i to %i, max %i, current %i\n", |
4077 | i,i+msg.Buffer[9], | 4159 | i,i+msg.Buffer[9], |
4078 | Priv->FilesLocationsUsed,Priv->FilesLocationsCurrent); | 4160 | Priv->FilesLocationsUsed,Priv->FilesLocationsCurrent); |
4079 | Priv->FilesLocations[i+msg.Buffer[9]] = Priv->FilesLocations[i]; | 4161 | Priv->FilesLocations[i+msg.Buffer[9]] = Priv->FilesLocations[i]; |
4080 | Priv->FilesLevels[i+msg.Buffer[9]]= Priv->FilesLevels[i]; | 4162 | Priv->FilesLevels[i+msg.Buffer[9]]= Priv->FilesLevels[i]; |
4081 | i--; | 4163 | i--; |
4082 | } | 4164 | } |
@@ -4377,49 +4459,49 @@ static GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, int *Pos | |||
4377 | GSM_Phone_N6510Data*Priv = &s->Phone.Data.Priv.N6510; | 4459 | GSM_Phone_N6510Data*Priv = &s->Phone.Data.Priv.N6510; |
4378 | GSM_File File2; | 4460 | GSM_File File2; |
4379 | GSM_Error error; | 4461 | GSM_Error error; |
4380 | int j; | 4462 | int j; |
4381 | unsigned char Header[400] = { | 4463 | unsigned char Header[400] = { |
4382 | N7110_FRAME_HEADER, 0x02, 0x00, 0x00, 0x00, 0x01, | 4464 | N7110_FRAME_HEADER, 0x02, 0x00, 0x00, 0x00, 0x01, |
4383 | 0x00, 0x0C, /* parent folder ID */ | 4465 | 0x00, 0x0C, /* parent folder ID */ |
4384 | 0x00, 0x00, 0x00, 0xE8}; | 4466 | 0x00, 0x00, 0x00, 0xE8}; |
4385 | unsigned char Add[15000] = { | 4467 | unsigned char Add[15000] = { |
4386 | N7110_FRAME_HEADER, 0x40, 0x00, 0x00, 0x00, 0x01, | 4468 | N7110_FRAME_HEADER, 0x40, 0x00, 0x00, 0x00, 0x01, |
4387 | 0x00, 0x04, /* file ID */ | 4469 | 0x00, 0x04, /* file ID */ |
4388 | 0x00, 0x00, | 4470 | 0x00, 0x00, |
4389 | 0x01, 0x28}; /* length */ | 4471 | 0x01, 0x28}; /* length */ |
4390 | unsigned char end[30] = { | 4472 | unsigned char end[30] = { |
4391 | N7110_FRAME_HEADER, 0x40, 0x00, 0x00, 0x00, 0x01, | 4473 | N7110_FRAME_HEADER, 0x40, 0x00, 0x00, 0x00, 0x01, |
4392 | 0x00, 0x04, /* file ID */ | 4474 | 0x00, 0x04, /* file ID */ |
4393 | 0x00, 0x00, 0x00, 0x00}; | 4475 | 0x00, 0x00, 0x00, 0x00}; |
4394 | 4476 | ||
4395 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOFILESYSTEM)) return ERR_NOTSUPPORTED; | 4477 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOFILESYSTEM)) return ERR_NOTSUPPORTED; |
4396 | 4478 | ||
4397 | s->Phone.Data.File = File; | 4479 | s->Phone.Data.File = File; |
4398 | 4480 | ||
4399 | if (*Pos == 0) { | 4481 | if (*Pos == 0) { |
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; |
4403 | 4485 | ||
4404 | Header[8] = atoi(File->ID_FullName) / 256; | 4486 | Header[8] = atoi(File->ID_FullName) / 256; |
4405 | Header[9] = atoi(File->ID_FullName) % 256; | 4487 | Header[9] = atoi(File->ID_FullName) % 256; |
4406 | memset(Header+14, 0x00, 300); | 4488 | memset(Header+14, 0x00, 300); |
4407 | CopyUnicodeString(Header+14,File->Name); | 4489 | CopyUnicodeString(Header+14,File->Name); |
4408 | Header[222] = File->Used / (256*256*256); | 4490 | Header[222] = File->Used / (256*256*256); |
4409 | Header[223] = File->Used / (256*256); | 4491 | Header[223] = File->Used / (256*256); |
4410 | Header[224] = File->Used / 256; | 4492 | Header[224] = File->Used / 256; |
4411 | Header[225] = File->Used % 256; | 4493 | Header[225] = File->Used % 256; |
4412 | switch(File->Type) { | 4494 | switch(File->Type) { |
4413 | case GSM_File_Image_JPG : Header[231]=0x02; Header[233]=0x01; break; | 4495 | case GSM_File_Image_JPG : Header[231]=0x02; Header[233]=0x01; break; |
4414 | case GSM_File_Image_BMP : Header[231]=0x02; Header[233]=0x02; break; | 4496 | case GSM_File_Image_BMP : Header[231]=0x02; Header[233]=0x02; break; |
4415 | case GSM_File_Image_PNG : Header[231]=0x02; Header[233]=0x03; break; | 4497 | case GSM_File_Image_PNG : Header[231]=0x02; Header[233]=0x03; break; |
4416 | case GSM_File_Image_GIF : Header[231]=0x02; Header[233]=0x05; break; | 4498 | case GSM_File_Image_GIF : Header[231]=0x02; Header[233]=0x05; break; |
4417 | case GSM_File_Image_WBMP : Header[231]=0x02; Header[233]=0x09; break; | 4499 | case GSM_File_Image_WBMP : Header[231]=0x02; Header[233]=0x09; break; |
4418 | case GSM_File_Sound_AMR : Header[231]=0x04; Header[233]=0x01; break; | 4500 | case GSM_File_Sound_AMR : Header[231]=0x04; Header[233]=0x01; break; |
4419 | case GSM_File_Sound_MIDI : Header[231]=0x04; Header[233]=0x05; break; //Header[238]=0x01; | 4501 | case GSM_File_Sound_MIDI : Header[231]=0x04; Header[233]=0x05; break; //Header[238]=0x01; |
4420 | case GSM_File_Sound_NRT : Header[231]=0x04; Header[233]=0x06; break; | 4502 | case GSM_File_Sound_NRT : Header[231]=0x04; Header[233]=0x06; break; |
4421 | case GSM_File_Video_3GP : Header[231]=0x08; Header[233]=0x05; break; | 4503 | case GSM_File_Video_3GP : Header[231]=0x08; Header[233]=0x05; break; |
4422 | case GSM_File_Java_JAR : Header[231]=0x10; Header[233]=0x01; break; | 4504 | case GSM_File_Java_JAR : Header[231]=0x10; Header[233]=0x01; break; |
4423 | #ifdef DEVELOP | 4505 | #ifdef DEVELOP |
4424 | case GSM_File_MMS: | 4506 | case GSM_File_MMS: |
4425 | Header[214]=0x07; | 4507 | Header[214]=0x07; |
@@ -4793,49 +4875,49 @@ static GSM_Error N6510_ReplyGetToDoStatus1(GSM_Protocol_Message msg, GSM_StateMa | |||
4793 | 4875 | ||
4794 | /* ToDo support - 6310 style */ | 4876 | /* ToDo support - 6310 style */ |
4795 | static GSM_Error N6510_GetToDoStatus1(GSM_StateMachine *s, GSM_ToDoStatus *status) | 4877 | static GSM_Error N6510_GetToDoStatus1(GSM_StateMachine *s, GSM_ToDoStatus *status) |
4796 | { | 4878 | { |
4797 | GSM_Error error; | 4879 | GSM_Error error; |
4798 | GSM_NOKIACalToDoLocations*LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; | 4880 | GSM_NOKIACalToDoLocations*LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; |
4799 | unsigned char reqLoc[] = { | 4881 | unsigned char reqLoc[] = { |
4800 | N6110_FRAME_HEADER, | 4882 | N6110_FRAME_HEADER, |
4801 | 0x15, 0x01, 0x00, 0x00, | 4883 | 0x15, 0x01, 0x00, 0x00, |
4802 | 0x00, 0x00, 0x00}; | 4884 | 0x00, 0x00, 0x00}; |
4803 | 4885 | ||
4804 | smprintf(s, "Getting ToDo locations\n"); | 4886 | smprintf(s, "Getting ToDo locations\n"); |
4805 | error = GSM_WaitFor (s, reqLoc, 10, 0x55, 4, ID_GetToDo); | 4887 | error = GSM_WaitFor (s, reqLoc, 10, 0x55, 4, ID_GetToDo); |
4806 | if (error != ERR_NONE) return error; | 4888 | if (error != ERR_NONE) return error; |
4807 | 4889 | ||
4808 | status->Used = LastToDo->Number; | 4890 | status->Used = LastToDo->Number; |
4809 | return ERR_NONE; | 4891 | return ERR_NONE; |
4810 | } | 4892 | } |
4811 | 4893 | ||
4812 | static GSM_Error N6510_GetToDoStatus2(GSM_StateMachine *s, GSM_ToDoStatus *status) | 4894 | static GSM_Error N6510_GetToDoStatus2(GSM_StateMachine *s, GSM_ToDoStatus *status) |
4813 | { | 4895 | { |
4814 | GSM_NOKIACalToDoLocations*LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; | 4896 | GSM_NOKIACalToDoLocations*LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; |
4815 | GSM_Error error; | 4897 | GSM_Error error; |
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; |
4819 | 4901 | ||
4820 | status->Used = LastToDo->Number; | 4902 | status->Used = LastToDo->Number; |
4821 | return ERR_NONE; | 4903 | return ERR_NONE; |
4822 | } | 4904 | } |
4823 | 4905 | ||
4824 | static GSM_Error N6510_GetToDoStatus(GSM_StateMachine *s, GSM_ToDoStatus *status) | 4906 | static GSM_Error N6510_GetToDoStatus(GSM_StateMachine *s, GSM_ToDoStatus *status) |
4825 | { | 4907 | { |
4826 | status->Used = 0; | 4908 | status->Used = 0; |
4827 | 4909 | ||
4828 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) { | 4910 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) { |
4829 | return N6510_GetToDoStatus1(s, status); | 4911 | return N6510_GetToDoStatus1(s, status); |
4830 | } else if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) { | 4912 | } else if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) { |
4831 | return N6510_GetToDoStatus2(s, status); | 4913 | return N6510_GetToDoStatus2(s, status); |
4832 | } else { | 4914 | } else { |
4833 | return ERR_NOTSUPPORTED; | 4915 | return ERR_NOTSUPPORTED; |
4834 | } | 4916 | } |
4835 | } | 4917 | } |
4836 | 4918 | ||
4837 | /* ToDo support - 6310 style */ | 4919 | /* ToDo support - 6310 style */ |
4838 | static GSM_Error N6510_ReplyGetToDo1(GSM_Protocol_Message msg, GSM_StateMachine *s) | 4920 | static GSM_Error N6510_ReplyGetToDo1(GSM_Protocol_Message msg, GSM_StateMachine *s) |
4839 | { | 4921 | { |
4840 | GSM_ToDoEntry *Last = s->Phone.Data.ToDo; | 4922 | GSM_ToDoEntry *Last = s->Phone.Data.ToDo; |
4841 | 4923 | ||
@@ -4923,148 +5005,139 @@ static GSM_Error N6510_ReplyGetToDo2(GSM_Protocol_Message msg, GSM_StateMachine | |||
4923 | Date.Second= 0; | 5005 | Date.Second= 0; |
4924 | Last->Entries[1].EntryType = TODO_END_DATETIME; | 5006 | Last->Entries[1].EntryType = TODO_END_DATETIME; |
4925 | memcpy(&Last->Entries[1].Date,&Date,sizeof(GSM_DateTime)); | 5007 | memcpy(&Last->Entries[1].Date,&Date,sizeof(GSM_DateTime)); |
4926 | 5008 | ||
4927 | smprintf(s,"StartTime: %04i-%02i-%02i %02i:%02i\n", | 5009 | smprintf(s,"StartTime: %04i-%02i-%02i %02i:%02i\n", |
4928 | msg.Buffer[28]*256+msg.Buffer[29], | 5010 | msg.Buffer[28]*256+msg.Buffer[29], |
4929 | msg.Buffer[30],msg.Buffer[31],msg.Buffer[32], | 5011 | msg.Buffer[30],msg.Buffer[31],msg.Buffer[32], |
4930 | msg.Buffer[33]); | 5012 | msg.Buffer[33]); |
4931 | Date.Year = msg.Buffer[28]*256+msg.Buffer[29]; | 5013 | Date.Year = msg.Buffer[28]*256+msg.Buffer[29]; |
4932 | Date.Month = msg.Buffer[30]; | 5014 | Date.Month = msg.Buffer[30]; |
4933 | Date.Day = msg.Buffer[31]; | 5015 | Date.Day = msg.Buffer[31]; |
4934 | Date.Hour = msg.Buffer[32]; | 5016 | Date.Hour = msg.Buffer[32]; |
4935 | Date.Minute = msg.Buffer[33]; | 5017 | Date.Minute = msg.Buffer[33]; |
4936 | Date.Second= 0; | 5018 | Date.Second= 0; |
4937 | 5019 | ||
4938 | Last->EntriesNum = 2; | 5020 | Last->EntriesNum = 2; |
4939 | 5021 | ||
4940 | if (msg.Buffer[45] == 0x01) { | 5022 | if (msg.Buffer[45] == 0x01) { |
4941 | Last->Entries[2].Number = msg.Buffer[45]; | 5023 | Last->Entries[2].Number = msg.Buffer[45]; |
4942 | Last->Entries[2].EntryType = TODO_COMPLETED; | 5024 | Last->Entries[2].EntryType = TODO_COMPLETED; |
4943 | Last->EntriesNum++; | 5025 | Last->EntriesNum++; |
4944 | smprintf(s,"Completed\n"); | 5026 | smprintf(s,"Completed\n"); |
4945 | } | 5027 | } |
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"); |
4950 | } else { | 5031 | } else { |
4951 | diff = ((unsigned int)msg.Buffer[14]) << 24; | 5032 | diff = ((unsigned int)msg.Buffer[14]) << 24; |
4952 | diff += ((unsigned int)msg.Buffer[15]) << 16; | 5033 | diff += ((unsigned int)msg.Buffer[15]) << 16; |
4953 | diff += ((unsigned int)msg.Buffer[16]) << 8; | 5034 | diff += ((unsigned int)msg.Buffer[16]) << 8; |
4954 | diff += msg.Buffer[17]; | 5035 | diff += msg.Buffer[17]; |
4955 | 5036 | ||
4956 | memcpy(&Last->Entries[Last->EntriesNum].Date,&Date,sizeof(GSM_DateTime)); | 5037 | memcpy(&Last->Entries[Last->EntriesNum].Date,&Date,sizeof(GSM_DateTime)); |
4957 | GetTimeDifference(diff, &Last->Entries[Last->EntriesNum].Date, false, 60); | 5038 | GetTimeDifference(diff, &Last->Entries[Last->EntriesNum].Date, false, 60); |
4958 | smprintf(s, "Alarm date : %02i-%02i-%04i %02i:%02i:%02i\n", | 5039 | smprintf(s, "Alarm date : %02i-%02i-%04i %02i:%02i:%02i\n", |
4959 | Last->Entries[Last->EntriesNum].Date.Day, Last->Entries[Last->EntriesNum].Date.Month, | 5040 | Last->Entries[Last->EntriesNum].Date.Day, Last->Entries[Last->EntriesNum].Date.Month, |
4960 | Last->Entries[Last->EntriesNum].Date.Year, Last->Entries[Last->EntriesNum].Date.Hour, | 5041 | Last->Entries[Last->EntriesNum].Date.Year, Last->Entries[Last->EntriesNum].Date.Hour, |
4961 | Last->Entries[Last->EntriesNum].Date.Minute,Last->Entries[Last->EntriesNum].Date.Second); | 5042 | Last->Entries[Last->EntriesNum].Date.Minute,Last->Entries[Last->EntriesNum].Date.Second); |
4962 | 5043 | ||
4963 | Last->Entries[Last->EntriesNum].EntryType = TODO_ALARM_DATETIME; | 5044 | Last->Entries[Last->EntriesNum].EntryType = TODO_ALARM_DATETIME; |
4964 | if (msg.Buffer[22]==0x00 && msg.Buffer[23]==0x00 && | 5045 | if (msg.Buffer[22]==0x00 && msg.Buffer[23]==0x00 && |
4965 | msg.Buffer[24]==0x00 && msg.Buffer[25]==0x00) | 5046 | msg.Buffer[24]==0x00 && msg.Buffer[25]==0x00) |
4966 | { | 5047 | { |
4967 | Last->Entries[Last->EntriesNum].EntryType = TODO_SILENT_ALARM_DATETIME; | 5048 | Last->Entries[Last->EntriesNum].EntryType = TODO_SILENT_ALARM_DATETIME; |
4968 | smprintf(s, "Alarm type : Silent\n"); | 5049 | smprintf(s, "Alarm type : Silent\n"); |
4969 | } | 5050 | } |
4970 | Last->EntriesNum++; | 5051 | Last->EntriesNum++; |
4971 | } | 5052 | } |
4972 | 5053 | ||
4973 | return ERR_NONE; | 5054 | return ERR_NONE; |
4974 | } | 5055 | } |
4975 | 5056 | ||
4976 | /* ToDo support - 6610 style */ | 5057 | /* ToDo support - 6610 style */ |
4977 | static GSM_Error N6510_GetNextToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh) | 5058 | static GSM_Error N6510_GetNextToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh) |
4978 | { | 5059 | { |
4979 | GSM_Error error; | 5060 | GSM_Error error; |
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; |
4990 | ToDo->Location = 1; | 5066 | ToDo->Location = 1; |
4991 | } else { | 5067 | } else { |
4992 | ToDo->Location++; | 5068 | ToDo->Location++; |
4993 | } | 5069 | } |
4994 | 5070 | ||
4995 | if (ToDo->Location > LastToDo->Number) return ERR_EMPTY; | 5071 | if (ToDo->Location > LastToDo->Number) return ERR_EMPTY; |
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 | } |
5004 | 5077 | ||
5005 | static GSM_Error N6510_GetNextToDo(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh) | 5078 | static GSM_Error N6510_GetNextToDo(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh) |
5006 | { | 5079 | { |
5007 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) { | 5080 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) { |
5008 | return N6510_GetNextToDo1(s, ToDo, refresh); | 5081 | return N6510_GetNextToDo1(s, ToDo, refresh); |
5009 | } else if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) { | 5082 | } else if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) { |
5010 | return N6510_GetNextToDo2(s, ToDo, refresh); | 5083 | return N6510_GetNextToDo2(s, ToDo, refresh); |
5011 | } else { | 5084 | } else { |
5012 | return ERR_NOTSUPPORTED; | 5085 | return ERR_NOTSUPPORTED; |
5013 | } | 5086 | } |
5014 | } | 5087 | } |
5015 | 5088 | ||
5016 | /* ToDo support - 6310 style */ | 5089 | /* ToDo support - 6310 style */ |
5017 | static GSM_Error N6510_ReplyDeleteAllToDo1(GSM_Protocol_Message msg, GSM_StateMachine *s) | 5090 | static GSM_Error N6510_ReplyDeleteAllToDo1(GSM_Protocol_Message msg, GSM_StateMachine *s) |
5018 | { | 5091 | { |
5019 | smprintf(s, "All TODO deleted\n"); | 5092 | smprintf(s, "All TODO deleted\n"); |
5020 | return ERR_NONE; | 5093 | return ERR_NONE; |
5021 | } | 5094 | } |
5022 | 5095 | ||
5023 | /* ToDo support - 6310 style */ | 5096 | /* ToDo support - 6310 style */ |
5024 | static GSM_Error N6510_DeleteAllToDo1(GSM_StateMachine *s) | 5097 | static GSM_Error N6510_DeleteAllToDo1(GSM_StateMachine *s) |
5025 | { | 5098 | { |
5026 | unsigned char req[] = {N6110_FRAME_HEADER, 0x11}; | 5099 | unsigned char req[] = {N6110_FRAME_HEADER, 0x11}; |
5027 | 5100 | ||
5028 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) { | 5101 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO63)) { |
5029 | return ERR_NOTSUPPORTED; | 5102 | return ERR_NOTSUPPORTED; |
5030 | } | 5103 | } |
5031 | 5104 | ||
5032 | smprintf(s, "Deleting all ToDo method 1\n"); | 5105 | smprintf(s, "Deleting all ToDo method 1\n"); |
5033 | return GSM_WaitFor (s, req, 4, 0x55, 4, ID_DeleteAllToDo); | 5106 | return GSM_WaitFor (s, req, 4, 0x55, 4, ID_DeleteAllToDo); |
5034 | } | 5107 | } |
5035 | 5108 | ||
5036 | static GSM_Error N6510_DeleteToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo) | 5109 | static GSM_Error N6510_DeleteToDo2(GSM_StateMachine *s, GSM_ToDoEntry *ToDo) |
5037 | { | 5110 | { |
5038 | GSM_Error error; | 5111 | GSM_Error error; |
5039 | GSM_NOKIACalToDoLocations *LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; | 5112 | GSM_NOKIACalToDoLocations *LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; |
5040 | GSM_CalendarEntry Note; | 5113 | GSM_CalendarEntry Note; |
5041 | 5114 | ||
5042 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) { | 5115 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_TODO66)) { |
5043 | return ERR_NOTSUPPORTED; | 5116 | return ERR_NOTSUPPORTED; |
5044 | } | 5117 | } |
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; |
5048 | 5121 | ||
5049 | smprintf(s, "Deleting ToDo method 2\n"); | 5122 | smprintf(s, "Deleting ToDo method 2\n"); |
5050 | 5123 | ||
5051 | if (ToDo->Location > LastToDo->Number || ToDo->Location == 0) return ERR_INVALIDLOCATION; | 5124 | if (ToDo->Location > LastToDo->Number || ToDo->Location == 0) return ERR_INVALIDLOCATION; |
5052 | 5125 | ||
5053 | Note.Location = LastToDo->Location[ToDo->Location-1]; | 5126 | Note.Location = LastToDo->Location[ToDo->Location-1]; |
5054 | return N71_65_DelCalendar(s,&Note); | 5127 | return N71_65_DelCalendar(s,&Note); |
5055 | } | 5128 | } |
5056 | 5129 | ||
5057 | /* ToDo support - 6310 style */ | 5130 | /* ToDo support - 6310 style */ |
5058 | static GSM_Error N6510_ReplyGetToDoFirstLoc1(GSM_Protocol_Message msg, GSM_StateMachine *s) | 5131 | static GSM_Error N6510_ReplyGetToDoFirstLoc1(GSM_Protocol_Message msg, GSM_StateMachine *s) |
5059 | { | 5132 | { |
5060 | smprintf(s, "TODO first location received method 1: %02x\n",msg.Buffer[9]); | 5133 | smprintf(s, "TODO first location received method 1: %02x\n",msg.Buffer[9]); |
5061 | s->Phone.Data.ToDo->Location = msg.Buffer[9]; | 5134 | s->Phone.Data.ToDo->Location = msg.Buffer[9]; |
5062 | return ERR_NONE; | 5135 | return ERR_NONE; |
5063 | } | 5136 | } |
5064 | 5137 | ||
5065 | /* ToDo support - 6310 style */ | 5138 | /* ToDo support - 6310 style */ |
5066 | static GSM_Error N6510_ReplyAddToDo1(GSM_Protocol_Message msg, GSM_StateMachine *s) | 5139 | static GSM_Error N6510_ReplyAddToDo1(GSM_Protocol_Message msg, GSM_StateMachine *s) |
5067 | { | 5140 | { |
5068 | smprintf(s, "TODO set OK\n"); | 5141 | smprintf(s, "TODO set OK\n"); |
5069 | return ERR_NONE; | 5142 | return ERR_NONE; |
5070 | } | 5143 | } |
@@ -5430,55 +5503,61 @@ GSM_Error N6510_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark | |||
5430 | GSM_Error N6510_GetWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) | 5503 | GSM_Error N6510_GetWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) |
5431 | { | 5504 | { |
5432 | GSM_Error error; | 5505 | GSM_Error error; |
5433 | 5506 | ||
5434 | /* We have to enable WAP frames in phone */ | 5507 | /* We have to enable WAP frames in phone */ |
5435 | error=N6510_EnableConnectionFunctions(s,N6510_WAP_SETTINGS); | 5508 | error=N6510_EnableConnectionFunctions(s,N6510_WAP_SETTINGS); |
5436 | if (error!=ERR_NONE) return error; | 5509 | if (error!=ERR_NONE) return error; |
5437 | 5510 | ||
5438 | return DCT3DCT4_GetWAPBookmarkPart(s,bookmark); | 5511 | return DCT3DCT4_GetWAPBookmarkPart(s,bookmark); |
5439 | } | 5512 | } |
5440 | 5513 | ||
5441 | static GSM_Reply_Function N6510ReplyFunctions[] = { | 5514 | static GSM_Reply_Function N6510ReplyFunctions[] = { |
5442 | {N71_65_ReplyCallInfo, "\x01",0x03,0x02,ID_IncomingFrame }, | 5515 | {N71_65_ReplyCallInfo, "\x01",0x03,0x02,ID_IncomingFrame }, |
5443 | {N71_65_ReplyCallInfo, "\x01",0x03,0x03,ID_IncomingFrame }, | 5516 | {N71_65_ReplyCallInfo, "\x01",0x03,0x03,ID_IncomingFrame }, |
5444 | {N71_65_ReplyCallInfo, "\x01",0x03,0x04,ID_IncomingFrame }, | 5517 | {N71_65_ReplyCallInfo, "\x01",0x03,0x04,ID_IncomingFrame }, |
5445 | {N71_65_ReplyCallInfo, "\x01",0x03,0x05,ID_IncomingFrame }, | 5518 | {N71_65_ReplyCallInfo, "\x01",0x03,0x05,ID_IncomingFrame }, |
5446 | {N71_65_ReplyCallInfo, "\x01",0x03,0x07,ID_AnswerCall }, | 5519 | {N71_65_ReplyCallInfo, "\x01",0x03,0x07,ID_AnswerCall }, |
5447 | {N71_65_ReplyCallInfo, "\x01",0x03,0x07,ID_IncomingFrame }, | 5520 | {N71_65_ReplyCallInfo, "\x01",0x03,0x07,ID_IncomingFrame }, |
5448 | {N71_65_ReplyCallInfo, "\x01",0x03,0x09,ID_CancelCall }, | 5521 | {N71_65_ReplyCallInfo, "\x01",0x03,0x09,ID_CancelCall }, |
5449 | {N71_65_ReplyCallInfo, "\x01",0x03,0x09,ID_IncomingFrame }, | 5522 | {N71_65_ReplyCallInfo, "\x01",0x03,0x09,ID_IncomingFrame }, |
5450 | {N71_65_ReplyCallInfo, "\x01",0x03,0x0A,ID_IncomingFrame }, | 5523 | {N71_65_ReplyCallInfo, "\x01",0x03,0x0A,ID_IncomingFrame }, |
5451 | {N71_65_ReplyCallInfo, "\x01",0x03,0x0B,ID_IncomingFrame }, | 5524 | {N71_65_ReplyCallInfo, "\x01",0x03,0x0B,ID_IncomingFrame }, |
5452 | {N71_65_ReplyCallInfo, "\x01",0x03,0x0C,ID_DialVoice }, | 5525 | {N71_65_ReplyCallInfo, "\x01",0x03,0x0C,ID_DialVoice }, |
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 }, |
5455 | {N71_65_ReplyCallInfo, "\x01",0x03,0x25,ID_IncomingFrame }, | 5531 | {N71_65_ReplyCallInfo, "\x01",0x03,0x25,ID_IncomingFrame }, |
5456 | {N71_65_ReplyCallInfo, "\x01",0x03,0x27,ID_IncomingFrame }, | 5532 | {N71_65_ReplyCallInfo, "\x01",0x03,0x27,ID_IncomingFrame }, |
5457 | {N71_65_ReplySendDTMF, "\x01",0x03,0x51,ID_SendDTMF }, | 5533 | {N71_65_ReplySendDTMF, "\x01",0x03,0x51,ID_SendDTMF }, |
5458 | {N71_65_ReplyCallInfo, "\x01",0x03,0x53,ID_IncomingFrame }, | 5534 | {N71_65_ReplyCallInfo, "\x01",0x03,0x53,ID_IncomingFrame }, |
5459 | {N71_65_ReplySendDTMF, "\x01",0x03,0x59,ID_SendDTMF }, | 5535 | {N71_65_ReplySendDTMF, "\x01",0x03,0x59,ID_SendDTMF }, |
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 | ||
5462 | {N6510_ReplySendSMSMessage, "\x02",0x03,0x03,ID_IncomingFrame }, | 5541 | {N6510_ReplySendSMSMessage, "\x02",0x03,0x03,ID_IncomingFrame }, |
5463 | {N6510_ReplyIncomingSMS, "\x02",0x03,0x04,ID_IncomingFrame }, | 5542 | {N6510_ReplyIncomingSMS, "\x02",0x03,0x04,ID_IncomingFrame }, |
5464 | {N6510_ReplySetSMSC, "\x02",0x03,0x13,ID_SetSMSC }, | 5543 | {N6510_ReplySetSMSC, "\x02",0x03,0x13,ID_SetSMSC }, |
5465 | {N6510_ReplyGetSMSC, "\x02",0x03,0x15,ID_GetSMSC }, | 5544 | {N6510_ReplyGetSMSC, "\x02",0x03,0x15,ID_GetSMSC }, |
5466 | 5545 | ||
5467 | {N6510_ReplyGetMemoryStatus, "\x03",0x03,0x04,ID_GetMemoryStatus }, | 5546 | {N6510_ReplyGetMemoryStatus, "\x03",0x03,0x04,ID_GetMemoryStatus }, |
5468 | {N6510_ReplyGetMemory, "\x03",0x03,0x08,ID_GetMemory }, | 5547 | {N6510_ReplyGetMemory, "\x03",0x03,0x08,ID_GetMemory }, |
5469 | {N6510_ReplyDeleteMemory, "\x03",0x03,0x10,ID_SetMemory }, | 5548 | {N6510_ReplyDeleteMemory, "\x03",0x03,0x10,ID_SetMemory }, |
5470 | {N71_65_ReplyWritePhonebook, "\x03",0x03,0x0C,ID_SetBitmap }, | 5549 | {N71_65_ReplyWritePhonebook, "\x03",0x03,0x0C,ID_SetBitmap }, |
5471 | {N71_65_ReplyWritePhonebook, "\x03",0x03,0x0C,ID_SetMemory }, | 5550 | {N71_65_ReplyWritePhonebook, "\x03",0x03,0x0C,ID_SetMemory }, |
5472 | 5551 | ||
5473 | {DCT3DCT4_ReplyCallDivert, "\x06",0x03,0x02,ID_Divert }, | 5552 | {DCT3DCT4_ReplyCallDivert, "\x06",0x03,0x02,ID_Divert }, |
5474 | {N71_65_ReplyUSSDInfo, "\x06",0x03,0x03,ID_IncomingFrame }, | 5553 | {N71_65_ReplyUSSDInfo, "\x06",0x03,0x03,ID_IncomingFrame }, |
5475 | {NoneReply, "\x06",0x03,0x06,ID_IncomingFrame }, | 5554 | {NoneReply, "\x06",0x03,0x06,ID_IncomingFrame }, |
5476 | {NoneReply, "\x06",0x03,0x09,ID_IncomingFrame }, | 5555 | {NoneReply, "\x06",0x03,0x09,ID_IncomingFrame }, |
5477 | 5556 | ||
5478 | {N6510_ReplyEnterSecurityCode, "\x08",0x03,0x08,ID_EnterSecurityCode }, | 5557 | {N6510_ReplyEnterSecurityCode, "\x08",0x03,0x08,ID_EnterSecurityCode }, |
5479 | {N6510_ReplyEnterSecurityCode, "\x08",0x03,0x09,ID_EnterSecurityCode }, | 5558 | {N6510_ReplyEnterSecurityCode, "\x08",0x03,0x09,ID_EnterSecurityCode }, |
5480 | {N6510_ReplyGetSecurityStatus, "\x08",0x03,0x12,ID_GetSecurityStatus }, | 5559 | {N6510_ReplyGetSecurityStatus, "\x08",0x03,0x12,ID_GetSecurityStatus }, |
5481 | 5560 | ||
5482 | {N6510_ReplyGetNetworkInfo, "\x0A",0x03,0x01,ID_GetNetworkInfo }, | 5561 | {N6510_ReplyGetNetworkInfo, "\x0A",0x03,0x01,ID_GetNetworkInfo }, |
5483 | {N6510_ReplyGetNetworkInfo, "\x0A",0x03,0x01,ID_IncomingFrame }, | 5562 | {N6510_ReplyGetNetworkInfo, "\x0A",0x03,0x01,ID_IncomingFrame }, |
5484 | {N6510_ReplyLogIntoNetwork, "\x0A",0x03,0x02,ID_IncomingFrame }, | 5563 | {N6510_ReplyLogIntoNetwork, "\x0A",0x03,0x02,ID_IncomingFrame }, |
@@ -5487,55 +5566,57 @@ static GSM_Reply_Function N6510ReplyFunctions[] = { | |||
5487 | {NoneReply, "\x0A",0x03,0x20,ID_IncomingFrame }, | 5566 | {NoneReply, "\x0A",0x03,0x20,ID_IncomingFrame }, |
5488 | {N6510_ReplyGetOperatorLogo, "\x0A",0x03,0x24,ID_GetBitmap }, | 5567 | {N6510_ReplyGetOperatorLogo, "\x0A",0x03,0x24,ID_GetBitmap }, |
5489 | {N6510_ReplySetOperatorLogo, "\x0A",0x03,0x26,ID_SetBitmap }, | 5568 | {N6510_ReplySetOperatorLogo, "\x0A",0x03,0x26,ID_SetBitmap }, |
5490 | 5569 | ||
5491 | {NoneReply, "\x0B",0x03,0x01,ID_PlayTone }, | 5570 | {NoneReply, "\x0B",0x03,0x01,ID_PlayTone }, |
5492 | {NoneReply, "\x0B",0x03,0x15,ID_PlayTone }, | 5571 | {NoneReply, "\x0B",0x03,0x15,ID_PlayTone }, |
5493 | {NoneReply, "\x0B",0x03,0x16,ID_PlayTone }, | 5572 | {NoneReply, "\x0B",0x03,0x16,ID_PlayTone }, |
5494 | 5573 | ||
5495 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x02,ID_SetCalendarNote }, | 5574 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x02,ID_SetCalendarNote }, |
5496 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x04,ID_SetCalendarNote }, | 5575 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x04,ID_SetCalendarNote }, |
5497 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x06,ID_SetCalendarNote }, | 5576 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x06,ID_SetCalendarNote }, |
5498 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x08,ID_SetCalendarNote }, | 5577 | {N71_65_ReplyAddCalendar1, "\x13",0x03,0x08,ID_SetCalendarNote }, |
5499 | {N71_65_ReplyDelCalendar, "\x13",0x03,0x0C,ID_DeleteCalendarNote }, | 5578 | {N71_65_ReplyDelCalendar, "\x13",0x03,0x0C,ID_DeleteCalendarNote }, |
5500 | {N71_65_ReplyGetNextCalendar1, "\x13",0x03,0x1A,ID_GetCalendarNote },/*method 1*/ | 5579 | {N71_65_ReplyGetNextCalendar1, "\x13",0x03,0x1A,ID_GetCalendarNote },/*method 1*/ |
5501 | {N6510_ReplyGetCalendarNotePos, "\x13",0x03,0x32,ID_GetCalendarNotePos },/*method 1*/ | 5580 | {N6510_ReplyGetCalendarNotePos, "\x13",0x03,0x32,ID_GetCalendarNotePos },/*method 1*/ |
5502 | {N6510_ReplyGetCalendarInfo, "\x13",0x03,0x3B,ID_GetCalendarNotesInfo},/*method 1*/ | 5581 | {N6510_ReplyGetCalendarInfo, "\x13",0x03,0x3B,ID_GetCalendarNotesInfo},/*method 1*/ |
5503 | #ifdef DEBUG | 5582 | #ifdef DEBUG |
5504 | {N71_65_ReplyGetNextCalendar2, "\x13",0x03,0x3F,ID_GetCalendarNote }, | 5583 | {N71_65_ReplyGetNextCalendar2, "\x13",0x03,0x3F,ID_GetCalendarNote }, |
5505 | #endif | 5584 | #endif |
5506 | {N71_65_ReplyAddCalendar2, "\x13",0x03,0x41,ID_SetCalendarNote },/*method 2*/ | 5585 | {N71_65_ReplyAddCalendar2, "\x13",0x03,0x41,ID_SetCalendarNote },/*method 2*/ |
5507 | {N6510_ReplyAddCalendar3, "\x13",0x03,0x66,ID_SetCalendarNote },/*method 3*/ | 5586 | {N6510_ReplyAddCalendar3, "\x13",0x03,0x66,ID_SetCalendarNote },/*method 3*/ |
5508 | {N6510_ReplyAddToDo2, "\x13",0x03,0x66,ID_SetToDo }, | 5587 | {N6510_ReplyAddToDo2, "\x13",0x03,0x66,ID_SetToDo }, |
5509 | {N6510_ReplyGetCalendar3, "\x13",0x03,0x7E,ID_GetCalendarNote },/*method 3*/ | 5588 | {N6510_ReplyGetCalendar3, "\x13",0x03,0x7E,ID_GetCalendarNote },/*method 3*/ |
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 }, |
5512 | {N6510_ReplyGetLocale, "\x13",0x03,0x8A,ID_GetLocale }, | 5592 | {N6510_ReplyGetLocale, "\x13",0x03,0x8A,ID_GetLocale }, |
5513 | {N6510_ReplyGetCalendarSettings, "\x13",0x03,0x8E,ID_GetCalendarSettings }, | 5593 | {N6510_ReplyGetCalendarSettings, "\x13",0x03,0x8E,ID_GetCalendarSettings }, |
5514 | {N6510_ReplyGetCalendarNotePos, "\x13",0x03,0x96,ID_GetCalendarNotePos },/*method 3*/ | 5594 | {N6510_ReplyGetCalendarNotePos, "\x13",0x03,0x96,ID_GetCalendarNotePos },/*method 3*/ |
5515 | {N6510_ReplyGetToDoFirstLoc2, "\x13",0x03,0x96,ID_SetToDo }, | 5595 | {N6510_ReplyGetToDoFirstLoc2, "\x13",0x03,0x96,ID_SetToDo }, |
5516 | {N6510_ReplyGetCalendarInfo, "\x13",0x03,0x9F,ID_GetCalendarNotesInfo},/*method 3*/ | 5596 | {N6510_ReplyGetCalendarInfo, "\x13",0x03,0x9F,ID_GetCalendarNotesInfo},/*method 3*/ |
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 | ||
5519 | {N6510_ReplySaveSMSMessage, "\x14",0x03,0x01,ID_SaveSMSMessage }, | 5600 | {N6510_ReplySaveSMSMessage, "\x14",0x03,0x01,ID_SaveSMSMessage }, |
5520 | {N6510_ReplySetPicture, "\x14",0x03,0x01,ID_SetBitmap }, | 5601 | {N6510_ReplySetPicture, "\x14",0x03,0x01,ID_SetBitmap }, |
5521 | {N6510_ReplyGetSMSMessage, "\x14",0x03,0x03,ID_GetSMSMessage }, | 5602 | {N6510_ReplyGetSMSMessage, "\x14",0x03,0x03,ID_GetSMSMessage }, |
5522 | {N6510_ReplyDeleteSMSMessage, "\x14",0x03,0x05,ID_DeleteSMSMessage }, | 5603 | {N6510_ReplyDeleteSMSMessage, "\x14",0x03,0x05,ID_DeleteSMSMessage }, |
5523 | {N6510_ReplyDeleteSMSMessage, "\x14",0x03,0x06,ID_DeleteSMSMessage }, | 5604 | {N6510_ReplyDeleteSMSMessage, "\x14",0x03,0x06,ID_DeleteSMSMessage }, |
5524 | {N6510_ReplyGetSMSStatus, "\x14",0x03,0x09,ID_GetSMSStatus }, | 5605 | {N6510_ReplyGetSMSStatus, "\x14",0x03,0x09,ID_GetSMSStatus }, |
5525 | {N6510_ReplyGetSMSFolderStatus, "\x14",0x03,0x0d,ID_GetSMSFolderStatus }, | 5606 | {N6510_ReplyGetSMSFolderStatus, "\x14",0x03,0x0d,ID_GetSMSFolderStatus }, |
5526 | {N6510_ReplyGetSMSMessage, "\x14",0x03,0x0f,ID_GetSMSMessage }, | 5607 | {N6510_ReplyGetSMSMessage, "\x14",0x03,0x0f,ID_GetSMSMessage }, |
5527 | {N6510_ReplyAddSMSFolder, "\x14",0x03,0x11,ID_AddSMSFolder }, | 5608 | {N6510_ReplyAddSMSFolder, "\x14",0x03,0x11,ID_AddSMSFolder }, |
5528 | {N6510_ReplyGetSMSFolders, "\x14",0x03,0x13,ID_GetSMSFolders }, | 5609 | {N6510_ReplyGetSMSFolders, "\x14",0x03,0x13,ID_GetSMSFolders }, |
5529 | {N6510_ReplySaveSMSMessage, "\x14",0x03,0x17,ID_SaveSMSMessage }, | 5610 | {N6510_ReplySaveSMSMessage, "\x14",0x03,0x17,ID_SaveSMSMessage }, |
5530 | {N6510_ReplyGetSMSStatus, "\x14",0x03,0x1a,ID_GetSMSStatus }, | 5611 | {N6510_ReplyGetSMSStatus, "\x14",0x03,0x1a,ID_GetSMSStatus }, |
5531 | 5612 | ||
5532 | {DCT4_ReplySetPhoneMode, "\x15",0x03,0x64,ID_Reset }, | 5613 | {DCT4_ReplySetPhoneMode, "\x15",0x03,0x64,ID_Reset }, |
5533 | {DCT4_ReplyGetPhoneMode, "\x15",0x03,0x65,ID_Reset }, | 5614 | {DCT4_ReplyGetPhoneMode, "\x15",0x03,0x65,ID_Reset }, |
5534 | {NoneReply, "\x15",0x03,0x68,ID_Reset }, | 5615 | {NoneReply, "\x15",0x03,0x68,ID_Reset }, |
5535 | 5616 | ||
5536 | {N6510_ReplyGetBatteryCharge, "\x17",0x03,0x0B,ID_GetBatteryCharge }, | 5617 | {N6510_ReplyGetBatteryCharge, "\x17",0x03,0x0B,ID_GetBatteryCharge }, |
5537 | 5618 | ||
5538 | {N6510_ReplySetDateTime, "\x19",0x03,0x02,ID_SetDateTime }, | 5619 | {N6510_ReplySetDateTime, "\x19",0x03,0x02,ID_SetDateTime }, |
5539 | {N6510_ReplyGetDateTime, "\x19",0x03,0x0B,ID_GetDateTime }, | 5620 | {N6510_ReplyGetDateTime, "\x19",0x03,0x0B,ID_GetDateTime }, |
5540 | {N6510_ReplySetAlarm, "\x19",0x03,0x12,ID_SetAlarm }, | 5621 | {N6510_ReplySetAlarm, "\x19",0x03,0x12,ID_SetAlarm }, |
5541 | {N6510_ReplyGetAlarm, "\x19",0x03,0x1A,ID_GetAlarm }, | 5622 | {N6510_ReplyGetAlarm, "\x19",0x03,0x1A,ID_GetAlarm }, |
@@ -5630,49 +5711,49 @@ static GSM_Reply_Function N6510ReplyFunctions[] = { | |||
5630 | {N6510_ReplyAddFilePart, "\x6D",0x03,0x41,ID_AddFile }, | 5711 | {N6510_ReplyAddFilePart, "\x6D",0x03,0x41,ID_AddFile }, |
5631 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x43,ID_AddFile }, | 5712 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x43,ID_AddFile }, |
5632 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x43,ID_GetFile }, | 5713 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x43,ID_GetFile }, |
5633 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x43,ID_GetFileInfo }, | 5714 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x43,ID_GetFileInfo }, |
5634 | 5715 | ||
5635 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x01,ID_GetBitmap }, | 5716 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x01,ID_GetBitmap }, |
5636 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x01,ID_SetBitmap }, | 5717 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x01,ID_SetBitmap }, |
5637 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x0F,ID_GetBitmap }, | 5718 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x0F,ID_GetBitmap }, |
5638 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x0F,ID_SetBitmap }, | 5719 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x0F,ID_SetBitmap }, |
5639 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x10,ID_GetBitmap }, | 5720 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x10,ID_GetBitmap }, |
5640 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x10,ID_SetBitmap }, | 5721 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x10,ID_SetBitmap }, |
5641 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x25,ID_SetBitmap }, | 5722 | {N6510_ReplyStartupNoteLogo, "\x7A",0x04,0x25,ID_SetBitmap }, |
5642 | 5723 | ||
5643 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetModel }, | 5724 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetModel }, |
5644 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetFirmware }, | 5725 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetFirmware }, |
5645 | 5726 | ||
5646 | /* 0xD7 - Bluetooth */ | 5727 | /* 0xD7 - Bluetooth */ |
5647 | 5728 | ||
5648 | {N6510_ReplyGetRingtoneID, "\xDB",0x03,0x02,ID_SetRingtone }, | 5729 | {N6510_ReplyGetRingtoneID, "\xDB",0x03,0x02,ID_SetRingtone }, |
5649 | 5730 | ||
5650 | {NULL, "\x00",0x00,0x00,ID_None } | 5731 | {NULL, "\x00",0x00,0x00,ID_None } |
5651 | }; | 5732 | }; |
5652 | 5733 | ||
5653 | GSM_Phone_Functions N6510Phone = { | 5734 | GSM_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, |
5656 | N6510_Initialise, | 5737 | N6510_Initialise, |
5657 | NONEFUNCTION, /* Terminate */ | 5738 | NONEFUNCTION, /* Terminate */ |
5658 | GSM_DispatchMessage, | 5739 | GSM_DispatchMessage, |
5659 | N6510_ShowStartInfo, | 5740 | N6510_ShowStartInfo, |
5660 | NOKIA_GetManufacturer, | 5741 | NOKIA_GetManufacturer, |
5661 | DCT3DCT4_GetModel, | 5742 | DCT3DCT4_GetModel, |
5662 | DCT3DCT4_GetFirmware, | 5743 | DCT3DCT4_GetFirmware, |
5663 | DCT4_GetIMEI, | 5744 | DCT4_GetIMEI, |
5664 | N6510_GetOriginalIMEI, | 5745 | N6510_GetOriginalIMEI, |
5665 | N6510_GetManufactureMonth, | 5746 | N6510_GetManufactureMonth, |
5666 | DCT4_GetProductCode, | 5747 | DCT4_GetProductCode, |
5667 | DCT4_GetHardware, | 5748 | DCT4_GetHardware, |
5668 | N6510_GetPPM, | 5749 | N6510_GetPPM, |
5669 | NOTSUPPORTED, /* GetSIMIMSI */ | 5750 | NOTSUPPORTED, /* GetSIMIMSI */ |
5670 | N6510_GetDateTime, | 5751 | N6510_GetDateTime, |
5671 | N6510_SetDateTime, | 5752 | N6510_SetDateTime, |
5672 | N6510_GetAlarm, | 5753 | N6510_GetAlarm, |
5673 | N6510_SetAlarm, | 5754 | N6510_SetAlarm, |
5674 | N6510_GetLocale, | 5755 | N6510_GetLocale, |
5675 | NOTSUPPORTED, /* SetLocale */ | 5756 | NOTSUPPORTED, /* SetLocale */ |
5676 | N6510_PressKey, | 5757 | N6510_PressKey, |
5677 | DCT4_Reset, | 5758 | DCT4_Reset, |
5678 | NOTIMPLEMENTED, /* ResetPhoneSettings*/ | 5759 | NOTIMPLEMENTED, /* ResetPhoneSettings*/ |
@@ -5684,48 +5765,49 @@ GSM_Phone_Functions N6510Phone = { | |||
5684 | N6510_GetSignalQuality, | 5765 | N6510_GetSignalQuality, |
5685 | N6510_GetNetworkInfo, | 5766 | N6510_GetNetworkInfo, |
5686 | NOTSUPPORTED, /* GetCategory */ | 5767 | NOTSUPPORTED, /* GetCategory */ |
5687 | NOTSUPPORTED, /* AddCategory */ | 5768 | NOTSUPPORTED, /* AddCategory */ |
5688 | NOTSUPPORTED, /* GetCategoryStatus */ | 5769 | NOTSUPPORTED, /* GetCategoryStatus */ |
5689 | N6510_GetMemoryStatus, | 5770 | N6510_GetMemoryStatus, |
5690 | N6510_GetMemory, | 5771 | N6510_GetMemory, |
5691 | NOTIMPLEMENTED, /* GetNextMemory */ | 5772 | NOTIMPLEMENTED, /* GetNextMemory */ |
5692 | N6510_SetMemory, | 5773 | N6510_SetMemory, |
5693 | NOTIMPLEMENTED, /* AddMemory */ | 5774 | NOTIMPLEMENTED, /* AddMemory */ |
5694 | N6510_DeleteMemory, | 5775 | N6510_DeleteMemory, |
5695 | NOTIMPLEMENTED, /* DeleteAllMemory */ | 5776 | NOTIMPLEMENTED, /* DeleteAllMemory */ |
5696 | N6510_GetSpeedDial, | 5777 | N6510_GetSpeedDial, |
5697 | NOTIMPLEMENTED, /* SetSpeedDial */ | 5778 | NOTIMPLEMENTED, /* SetSpeedDial */ |
5698 | N6510_GetSMSC, | 5779 | N6510_GetSMSC, |
5699 | N6510_SetSMSC, | 5780 | N6510_SetSMSC, |
5700 | N6510_GetSMSStatus, | 5781 | N6510_GetSMSStatus, |
5701 | N6510_GetSMSMessage, | 5782 | N6510_GetSMSMessage, |
5702 | N6510_GetNextSMSMessage, | 5783 | N6510_GetNextSMSMessage, |
5703 | N6510_SetSMS, | 5784 | N6510_SetSMS, |
5704 | N6510_AddSMS, | 5785 | N6510_AddSMS, |
5705 | N6510_DeleteSMSMessage, | 5786 | N6510_DeleteSMSMessage, |
5706 | N6510_SendSMSMessage, | 5787 | N6510_SendSMSMessage, |
5707 | NOTSUPPORTED, /* SendSavedSMS */ | 5788 | NOTSUPPORTED, /* SendSavedSMS */ |
5789 | NOTSUPPORTED, /* SetFastSMSSending*/ | ||
5708 | NOKIA_SetIncomingSMS, | 5790 | NOKIA_SetIncomingSMS, |
5709 | NOTIMPLEMENTED, /* SetIncomingCB */ | 5791 | NOTIMPLEMENTED, /* SetIncomingCB */ |
5710 | N6510_GetSMSFolders, | 5792 | N6510_GetSMSFolders, |
5711 | N6510_AddSMSFolder, | 5793 | N6510_AddSMSFolder, |
5712 | NOTIMPLEMENTED, /* DeleteSMSFolder */ | 5794 | NOTIMPLEMENTED, /* DeleteSMSFolder */ |
5713 | N6510_DialVoice, | 5795 | N6510_DialVoice, |
5714 | N6510_AnswerCall, | 5796 | N6510_AnswerCall, |
5715 | N6510_CancelCall, | 5797 | N6510_CancelCall, |
5716 | NOTIMPLEMENTED, /* HoldCall */ | 5798 | NOTIMPLEMENTED, /* HoldCall */ |
5717 | NOTIMPLEMENTED, /* UnholdCall */ | 5799 | NOTIMPLEMENTED, /* UnholdCall */ |
5718 | NOTIMPLEMENTED, /* ConferenceCall */ | 5800 | NOTIMPLEMENTED, /* ConferenceCall */ |
5719 | NOTIMPLEMENTED, /* SplitCall */ | 5801 | NOTIMPLEMENTED, /* SplitCall */ |
5720 | NOTIMPLEMENTED, /* TransferCall */ | 5802 | NOTIMPLEMENTED, /* TransferCall */ |
5721 | NOTIMPLEMENTED, /* SwitchCall */ | 5803 | NOTIMPLEMENTED, /* SwitchCall */ |
5722 | DCT3DCT4_GetCallDivert, | 5804 | DCT3DCT4_GetCallDivert, |
5723 | DCT3DCT4_SetCallDivert, | 5805 | DCT3DCT4_SetCallDivert, |
5724 | DCT3DCT4_CancelAllDiverts, | 5806 | DCT3DCT4_CancelAllDiverts, |
5725 | NOKIA_SetIncomingCall, | 5807 | NOKIA_SetIncomingCall, |
5726 | NOKIA_SetIncomingUSSD, | 5808 | NOKIA_SetIncomingUSSD, |
5727 | DCT3DCT4_SendDTMF, | 5809 | DCT3DCT4_SendDTMF, |
5728 | N6510_GetRingtone, | 5810 | N6510_GetRingtone, |
5729 | N6510_SetRingtone, | 5811 | N6510_SetRingtone, |
5730 | N6510_GetRingtonesInfo, | 5812 | N6510_GetRingtonesInfo, |
5731 | N6510_DeleteUserRingtones, | 5813 | N6510_DeleteUserRingtones, |
@@ -5738,45 +5820,45 @@ GSM_Phone_Functions N6510Phone = { | |||
5738 | N6510_GetMMSSettings, | 5820 | N6510_GetMMSSettings, |
5739 | N6510_SetMMSSettings, | 5821 | N6510_SetMMSSettings, |
5740 | N6510_GetSyncMLSettings, | 5822 | N6510_GetSyncMLSettings, |
5741 | NOTSUPPORTED, /* SetSyncMLSettings*/ | 5823 | NOTSUPPORTED, /* SetSyncMLSettings*/ |
5742 | N6510_GetChatSettings, | 5824 | N6510_GetChatSettings, |
5743 | NOTSUPPORTED, /* SetChatSettings */ | 5825 | NOTSUPPORTED, /* SetChatSettings */ |
5744 | N6510_GetBitmap, | 5826 | N6510_GetBitmap, |
5745 | N6510_SetBitmap, | 5827 | N6510_SetBitmap, |
5746 | N6510_GetToDoStatus, | 5828 | N6510_GetToDoStatus, |
5747 | NOTIMPLEMENTED, /* GetToDo */ | 5829 | NOTIMPLEMENTED, /* GetToDo */ |
5748 | N6510_GetNextToDo, | 5830 | N6510_GetNextToDo, |
5749 | NOTIMPLEMENTED, /* SetToDo */ | 5831 | NOTIMPLEMENTED, /* SetToDo */ |
5750 | N6510_AddToDo, | 5832 | N6510_AddToDo, |
5751 | N6510_DeleteToDo2, | 5833 | N6510_DeleteToDo2, |
5752 | N6510_DeleteAllToDo1, | 5834 | N6510_DeleteAllToDo1, |
5753 | N6510_GetCalendarStatus, | 5835 | N6510_GetCalendarStatus, |
5754 | NOTIMPLEMENTED, /* GetCalendar */ | 5836 | NOTIMPLEMENTED, /* GetCalendar */ |
5755 | N6510_GetNextCalendar, | 5837 | N6510_GetNextCalendar, |
5756 | NOTIMPLEMENTED, /* SetCalendar */ | 5838 | NOTIMPLEMENTED, /* SetCalendar */ |
5757 | N6510_AddCalendar, | 5839 | N6510_AddCalendar, |
5758 | N71_65_DelCalendar, | 5840 | N71_65_DelCalendar, |
5759 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ | 5841 | NOTIMPLEMENTED, /* DeleteAllCalendar*/ |
5760 | N6510_GetCalendarSettings, | 5842 | N6510_GetCalendarSettings, |
5761 | NOTSUPPORTED, /* SetCalendarSettings*/ | 5843 | NOTSUPPORTED, /* SetCalendarSettings*/ |
5762 | NOTIMPLEMENTED, /* GetNote */ | 5844 | N6510_GetNextNote, |
5763 | N6510_GetProfile, | 5845 | N6510_GetProfile, |
5764 | N6510_SetProfile, | 5846 | N6510_SetProfile, |
5765 | N6510_GetFMStation, | 5847 | N6510_GetFMStation, |
5766 | N6510_SetFMStation, | 5848 | N6510_SetFMStation, |
5767 | N6510_ClearFMStations, | 5849 | N6510_ClearFMStations, |
5768 | N6510_GetNextFileFolder, | 5850 | N6510_GetNextFileFolder, |
5769 | N6510_GetFilePart, | 5851 | N6510_GetFilePart, |
5770 | N6510_AddFilePart, | 5852 | N6510_AddFilePart, |
5771 | N6510_GetFileSystemStatus, | 5853 | N6510_GetFileSystemStatus, |
5772 | N6510_DeleteFile, | 5854 | N6510_DeleteFile, |
5773 | N6510_AddFolder, | 5855 | N6510_AddFolder, |
5774 | N6510_GetGPRSAccessPoint, | 5856 | N6510_GetGPRSAccessPoint, |
5775 | N6510_SetGPRSAccessPoint | 5857 | N6510_SetGPRSAccessPoint |
5776 | }; | 5858 | }; |
5777 | 5859 | ||
5778 | #endif | 5860 | #endif |
5779 | 5861 | ||
5780 | /* How should editor hadle tabs in this file? Add editor commands here. | 5862 | /* How should editor hadle tabs in this file? Add editor commands here. |
5781 | * vim: noexpandtab sw=8 ts=8 sts=8: | 5863 | * vim: noexpandtab sw=8 ts=8 sts=8: |
5782 | */ | 5864 | */ |
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 | |||
@@ -13,48 +13,50 @@ typedef enum { | |||
13 | N6510_WAP_SETTINGS, | 13 | N6510_WAP_SETTINGS, |
14 | N6510_SYNCML_SETTINGS | 14 | N6510_SYNCML_SETTINGS |
15 | } N6510_Connection_Settings; | 15 | } N6510_Connection_Settings; |
16 | 16 | ||
17 | typedef enum { | 17 | typedef enum { |
18 | N6510_LIGHT_DISPLAY = 0x01, | 18 | N6510_LIGHT_DISPLAY = 0x01, |
19 | N6510_LIGHT_KEYPAD = 0x03, | 19 | N6510_LIGHT_KEYPAD = 0x03, |
20 | N6510_LIGHT_TORCH = 0x10 | 20 | N6510_LIGHT_TORCH = 0x10 |
21 | } N6510_PHONE_LIGHTS; | 21 | } N6510_PHONE_LIGHTS; |
22 | 22 | ||
23 | typedef struct { | 23 | typedef struct { |
24 | int LastCalendarYear; | 24 | int LastCalendarYear; |
25 | int LastCalendarPos; | 25 | int LastCalendarPos; |
26 | GSM_NOKIACalToDoLocationsLastCalendar; | 26 | GSM_NOKIACalToDoLocationsLastCalendar; |
27 | int FirstCalendarPos; | 27 | int FirstCalendarPos; |
28 | unsigned char CalendarIcons[10]; | 28 | unsigned char CalendarIcons[10]; |
29 | GSM_CalendarNoteType CalendarIconsTypes[10]; | 29 | GSM_CalendarNoteType CalendarIconsTypes[10]; |
30 | int CalendarIconsNum; | 30 | int CalendarIconsNum; |
31 | 31 | ||
32 | GSM_NOKIASMSFolder LastSMSFolder; | 32 | GSM_NOKIASMSFolder LastSMSFolder; |
33 | GSM_SMSFolders LastSMSFolders; | 33 | GSM_SMSFolders LastSMSFolders; |
34 | 34 | ||
35 | GSM_NOKIACalToDoLocationsLastToDo; | 35 | GSM_NOKIACalToDoLocationsLastToDo; |
36 | 36 | ||
37 | GSM_NOKIACalToDoLocationsLastNote; | ||
38 | |||
37 | unsigned char RingtoneID;/* When set with preview */ | 39 | unsigned char RingtoneID;/* When set with preview */ |
38 | 40 | ||
39 | int FilesLocations[1000]; | 41 | int FilesLocations[1000]; |
40 | int FilesLevels[1000]; | 42 | int FilesLevels[1000]; |
41 | int FilesLocationsUsed; | 43 | int FilesLocationsUsed; |
42 | int FilesLocationsCurrent; | 44 | int FilesLocationsCurrent; |
43 | int FileToken; | 45 | int FileToken; |
44 | int ParentID; | 46 | int ParentID; |
45 | int FileCheckSum; | 47 | int FileCheckSum; |
46 | 48 | ||
47 | unsigned char FMStatus[4000]; | 49 | unsigned char FMStatus[4000]; |
48 | int FMStatusLength; | 50 | int FMStatusLength; |
49 | 51 | ||
50 | unsigned char GPRSPoints[4000]; | 52 | unsigned char GPRSPoints[4000]; |
51 | int GPRSPointsLength; | 53 | int GPRSPointsLength; |
52 | 54 | ||
53 | int BearerNumber; | 55 | int BearerNumber; |
54 | 56 | ||
55 | unsigned char PhoneMode; | 57 | unsigned char PhoneMode; |
56 | } GSM_Phone_N6510Data; | 58 | } GSM_Phone_N6510Data; |
57 | 59 | ||
58 | void N6510_EncodeFMFrequency(double freq, unsigned char *buff); | 60 | void N6510_EncodeFMFrequency(double freq, unsigned char *buff); |
59 | void N6510_DecodeFMFrequency(double *freq, unsigned char *buff); | 61 | void N6510_DecodeFMFrequency(double *freq, unsigned char *buff); |
60 | 62 | ||
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 | |||
@@ -100,45 +100,45 @@ GSM_Phone_Functions NAUTOPhone = { | |||
100 | NOTSUPPORTED, /* SetWAPBookmark */ | 100 | NOTSUPPORTED, /* SetWAPBookmark */ |
101 | NOTSUPPORTED, /* DeleteWAPBookmark */ | 101 | NOTSUPPORTED, /* DeleteWAPBookmark */ |
102 | NOTSUPPORTED, /* GetWAPSettings */ | 102 | NOTSUPPORTED, /* GetWAPSettings */ |
103 | NOTSUPPORTED, /* SetWAPSettings */ | 103 | NOTSUPPORTED, /* SetWAPSettings */ |
104 | NOTSUPPORTED, /* GetMMSSettings */ | 104 | NOTSUPPORTED, /* GetMMSSettings */ |
105 | NOTSUPPORTED, /* SetMMSSettings */ | 105 | NOTSUPPORTED, /* SetMMSSettings */ |
106 | NOTSUPPORTED, /* GetBitmap */ | 106 | NOTSUPPORTED, /* GetBitmap */ |
107 | NOTSUPPORTED, /* SetBitmap */ | 107 | NOTSUPPORTED, /* SetBitmap */ |
108 | NOTSUPPORTED, /* GetToDoStatus */ | 108 | NOTSUPPORTED, /* GetToDoStatus */ |
109 | NOTSUPPORTED, /* GetToDo */ | 109 | NOTSUPPORTED, /* GetToDo */ |
110 | NOTSUPPORTED, /* GetNextToDo */ | 110 | NOTSUPPORTED, /* GetNextToDo */ |
111 | NOTSUPPORTED, /* SetToDo */ | 111 | NOTSUPPORTED, /* SetToDo */ |
112 | NOTSUPPORTED, /* AddToDo */ | 112 | NOTSUPPORTED, /* AddToDo */ |
113 | NOTSUPPORTED, /* DeleteToDo */ | 113 | NOTSUPPORTED, /* DeleteToDo */ |
114 | NOTSUPPORTED, /* DeleteAllToDo */ | 114 | NOTSUPPORTED, /* DeleteAllToDo */ |
115 | NOTSUPPORTED, /* GetCalendarStatus*/ | 115 | NOTSUPPORTED, /* GetCalendarStatus*/ |
116 | NOTSUPPORTED, /* GetCalendar */ | 116 | NOTSUPPORTED, /* GetCalendar */ |
117 | NOTSUPPORTED, /* GetNextCalendar */ | 117 | NOTSUPPORTED, /* GetNextCalendar */ |
118 | NOTSUPPORTED, /* SetCalendar */ | 118 | NOTSUPPORTED, /* SetCalendar */ |
119 | NOTSUPPORTED, /* AddCalendar */ | 119 | NOTSUPPORTED, /* AddCalendar */ |
120 | NOTSUPPORTED, /* DeleteCalendar */ | 120 | NOTSUPPORTED, /* DeleteCalendar */ |
121 | NOTSUPPORTED, /* DeleteAllCalendar*/ | 121 | NOTSUPPORTED, /* DeleteAllCalendar*/ |
122 | NOTSUPPORTED, /* GetCalendarSettings*/ | 122 | NOTSUPPORTED, /* GetCalendarSettings*/ |
123 | NOTSUPPORTED, /* SetCalendarSettings*/ | 123 | NOTSUPPORTED, /* SetCalendarSettings*/ |
124 | NOTSUPPORTED, /* GetNote */ | 124 | NOTSUPPORTED, /* GetNextNote */ |
125 | NOTSUPPORTED, /* GetProfile */ | 125 | NOTSUPPORTED, /* GetProfile */ |
126 | NOTSUPPORTED, /* SetProfile */ | 126 | NOTSUPPORTED, /* SetProfile */ |
127 | NOTSUPPORTED, /* GetFMStation */ | 127 | NOTSUPPORTED, /* GetFMStation */ |
128 | NOTSUPPORTED, /* SetFMStation */ | 128 | NOTSUPPORTED, /* SetFMStation */ |
129 | NOTSUPPORTED, /* ClearFMStations */ | 129 | NOTSUPPORTED, /* ClearFMStations */ |
130 | NOTSUPPORTED, /* GetNextFileFolder*/ | 130 | NOTSUPPORTED, /* GetNextFileFolder*/ |
131 | NOTSUPPORTED, /* GetFilePart */ | 131 | NOTSUPPORTED, /* GetFilePart */ |
132 | NOTSUPPORTED, /* AddFilePart */ | 132 | NOTSUPPORTED, /* AddFilePart */ |
133 | NOTSUPPORTED, /* GetFileSystemStatus*/ | 133 | NOTSUPPORTED, /* GetFileSystemStatus*/ |
134 | NOTSUPPORTED, /* DeleteFile */ | 134 | NOTSUPPORTED, /* DeleteFile */ |
135 | NOTSUPPORTED, /* AddFolder */ | 135 | NOTSUPPORTED, /* AddFolder */ |
136 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ | 136 | NOTSUPPORTED, /* GetGPRSAccessPoint*/ |
137 | NOTSUPPORTED /* SetGPRSAccessPoint*/ | 137 | NOTSUPPORTED /* SetGPRSAccessPoint*/ |
138 | }; | 138 | }; |
139 | 139 | ||
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | /* How should editor hadle tabs in this file? Add editor commands here. | 142 | /* How should editor hadle tabs in this file? Add editor commands here. |
143 | * vim: noexpandtab sw=8 ts=8 sts=8: | 143 | * vim: noexpandtab sw=8 ts=8 sts=8: |
144 | */ | 144 | */ |
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 | |||
@@ -1372,77 +1372,91 @@ GSM_Error N71_65_ReplyCallInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | |||
1372 | call.Status = GSM_CALL_IncomingCall; | 1372 | call.Status = GSM_CALL_IncomingCall; |
1373 | tmp = 6; | 1373 | tmp = 6; |
1374 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false); | 1374 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false); |
1375 | break; | 1375 | break; |
1376 | case 0x07: | 1376 | case 0x07: |
1377 | smprintf(s, "Call answer initiated\n"); | 1377 | smprintf(s, "Call answer initiated\n"); |
1378 | break; | 1378 | break; |
1379 | case 0x09: | 1379 | case 0x09: |
1380 | smprintf(s, "Call released\n"); | 1380 | smprintf(s, "Call released\n"); |
1381 | call.Status = GSM_CALL_CallLocalEnd; | 1381 | call.Status = GSM_CALL_CallLocalEnd; |
1382 | break; | 1382 | break; |
1383 | case 0x0a: | 1383 | case 0x0a: |
1384 | smprintf(s, "Call is being released\n"); | 1384 | smprintf(s, "Call is being released\n"); |
1385 | break; | 1385 | break; |
1386 | case 0x0b: | 1386 | case 0x0b: |
1387 | smprintf(s, "Meaning not known\n"); | 1387 | smprintf(s, "Meaning not known\n"); |
1388 | call.CallIDAvailable = false; | 1388 | call.CallIDAvailable = false; |
1389 | break; | 1389 | break; |
1390 | case 0x0c: | 1390 | case 0x0c: |
1391 | smprintf(s, "Audio status\n"); | 1391 | smprintf(s, "Audio status\n"); |
1392 | if (msg.Buffer[4] == 0x01) smprintf(s, "Audio enabled\n"); | 1392 | if (msg.Buffer[4] == 0x01) smprintf(s, "Audio enabled\n"); |
1393 | else smprintf(s, "Audio disabled\n"); | 1393 | else smprintf(s, "Audio disabled\n"); |
1394 | call.CallIDAvailable = false; | 1394 | call.CallIDAvailable = false; |
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: |
1397 | smprintf(s, "Call held\n"); | 1402 | smprintf(s, "Call held\n"); |
1398 | call.Status = GSM_CALL_CallHeld; | 1403 | call.Status = GSM_CALL_CallHeld; |
1399 | break; | 1404 | break; |
1400 | case 0x25: | 1405 | case 0x25: |
1401 | smprintf(s, "Call resumed\n"); | 1406 | smprintf(s, "Call resumed\n"); |
1402 | call.Status = GSM_CALL_CallResumed; | 1407 | call.Status = GSM_CALL_CallResumed; |
1403 | break; | 1408 | break; |
1404 | case 0x27: | 1409 | case 0x27: |
1405 | smprintf(s, "Call switched\n"); | 1410 | smprintf(s, "Call switched\n"); |
1406 | call.Status = GSM_CALL_CallSwitched; | 1411 | call.Status = GSM_CALL_CallSwitched; |
1407 | break; | 1412 | break; |
1408 | case 0x53: | 1413 | case 0x53: |
1409 | smprintf(s, "Outgoing call\n"); | 1414 | smprintf(s, "Outgoing call\n"); |
1410 | smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii | 1415 | smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii |
1411 | tmp = 6; | 1416 | tmp = 6; |
1412 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); | 1417 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); |
1413 | smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); | 1418 | smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); |
1414 | /* FIXME: read name from frame */ | 1419 | /* FIXME: read name from frame */ |
1415 | call.Status = GSM_CALL_OutgoingCall; | 1420 | call.Status = GSM_CALL_OutgoingCall; |
1416 | tmp = 6; | 1421 | tmp = 6; |
1417 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false); | 1422 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,call.PhoneNumber,false); |
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 | } |
1420 | if (call.CallIDAvailable) smprintf(s, "Call ID : %d\n",msg.Buffer[4]); | 1431 | if (call.CallIDAvailable) smprintf(s, "Call ID : %d\n",msg.Buffer[4]); |
1421 | if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall!=NULL && call.Status != 0) { | 1432 | if (s->Phone.Data.EnableIncomingCall && s->User.IncomingCall!=NULL && call.Status != 0) { |
1422 | if (call.CallIDAvailable) call.CallID = msg.Buffer[4]; | 1433 | if (call.CallIDAvailable) call.CallID = msg.Buffer[4]; |
1423 | s->User.IncomingCall(s->CurrentConfig->Device, call); | 1434 | s->User.IncomingCall(s->CurrentConfig->Device, call); |
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) { |
1426 | if (msg.Buffer[3] == 0x09) { | 1440 | if (msg.Buffer[3] == 0x09) { |
1427 | if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE; | 1441 | if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE; |
1428 | /* when we canceled call and see frame about other | 1442 | /* when we canceled call and see frame about other |
1429 | * call releasing, we don't give ERR_NONE for "our" | 1443 | * call releasing, we don't give ERR_NONE for "our" |
1430 | * call release command | 1444 | * call release command |
1431 | */ | 1445 | */ |
1432 | return ERR_NEEDANOTHERANSWER; | 1446 | return ERR_NEEDANOTHERANSWER; |
1433 | } | 1447 | } |
1434 | } | 1448 | } |
1435 | if (s->Phone.Data.RequestID == ID_AnswerCall) { | 1449 | if (s->Phone.Data.RequestID == ID_AnswerCall) { |
1436 | if (msg.Buffer[3] == 0x07) { | 1450 | if (msg.Buffer[3] == 0x07) { |
1437 | if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE; | 1451 | if (s->Phone.Data.CallID == msg.Buffer[4]) return ERR_NONE; |
1438 | return ERR_NEEDANOTHERANSWER; | 1452 | return ERR_NEEDANOTHERANSWER; |
1439 | } | 1453 | } |
1440 | } | 1454 | } |
1441 | return ERR_NONE; | 1455 | return ERR_NONE; |
1442 | } | 1456 | } |
1443 | 1457 | ||
1444 | void N71_65_GetCalendarRecurrance(GSM_StateMachine *s, unsigned char *buffer, GSM_CalendarEntry *entry) | 1458 | void N71_65_GetCalendarRecurrance(GSM_StateMachine *s, unsigned char *buffer, GSM_CalendarEntry *entry) |
1445 | { | 1459 | { |
1446 | int Recurrance; | 1460 | int Recurrance; |
1447 | 1461 | ||
1448 | Recurrance = buffer[0]*256 + buffer[1]; | 1462 | Recurrance = buffer[0]*256 + buffer[1]; |