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,51 +1,54 @@ | |||
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 | } |
28 | 31 | ||
29 | GSM_Error DCT3_GetWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) | 32 | GSM_Error DCT3_GetWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) |
30 | { | 33 | { |
31 | GSM_Error error; | 34 | GSM_Error error; |
32 | 35 | ||
33 | /* We have to enable WAP frames in phone */ | 36 | /* We have to enable WAP frames in phone */ |
34 | error=DCT3DCT4_EnableWAPFunctions(s); | 37 | error=DCT3DCT4_EnableWAPFunctions(s); |
35 | if (error!=ERR_NONE) return error; | 38 | if (error!=ERR_NONE) return error; |
36 | 39 | ||
37 | return DCT3DCT4_GetWAPBookmarkPart(s,bookmark); | 40 | return DCT3DCT4_GetWAPBookmarkPart(s,bookmark); |
38 | } | 41 | } |
39 | 42 | ||
40 | GSM_Error DCT3_ReplyPressKey(GSM_Protocol_Message msg, GSM_StateMachine *s) | 43 | GSM_Error DCT3_ReplyPressKey(GSM_Protocol_Message msg, GSM_StateMachine *s) |
41 | { | 44 | { |
42 | GSM_Phone_Data *Data = &s->Phone.Data; | 45 | GSM_Phone_Data *Data = &s->Phone.Data; |
43 | 46 | ||
44 | switch (msg.Buffer[2]) { | 47 | switch (msg.Buffer[2]) { |
45 | case 0x46: | 48 | case 0x46: |
46 | smprintf(s, "Pressing key OK\n"); | 49 | smprintf(s, "Pressing key OK\n"); |
47 | if (Data->PressKey) return ERR_NONE; | 50 | if (Data->PressKey) return ERR_NONE; |
48 | break; | 51 | break; |
49 | case 0x47: | 52 | case 0x47: |
50 | smprintf(s, "Releasing key OK\n"); | 53 | smprintf(s, "Releasing key OK\n"); |
51 | if (!Data->PressKey) return ERR_NONE; | 54 | if (!Data->PressKey) return ERR_NONE; |
@@ -349,163 +352,164 @@ GSM_Error DCT3_SetDateTime(GSM_StateMachine *s, GSM_DateTime *date_time, unsigne | |||
349 | return GSM_WaitFor (s, req, 14, msgtype, 4, ID_SetDateTime); | 352 | return GSM_WaitFor (s, req, 14, msgtype, 4, ID_SetDateTime); |
350 | } | 353 | } |
351 | 354 | ||
352 | GSM_Error DCT3_ReplySetAlarm(GSM_Protocol_Message msg, GSM_StateMachine *s) | 355 | GSM_Error DCT3_ReplySetAlarm(GSM_Protocol_Message msg, GSM_StateMachine *s) |
353 | { | 356 | { |
354 | smprintf(s, "Alarm: "); | 357 | smprintf(s, "Alarm: "); |
355 | if (msg.Buffer[4]==0x01) { | 358 | if (msg.Buffer[4]==0x01) { |
356 | smprintf(s, "set OK\n"); | 359 | smprintf(s, "set OK\n"); |
357 | return ERR_NONE; | 360 | return ERR_NONE; |
358 | } | 361 | } |
359 | smprintf(s, "error setting\n"); | 362 | smprintf(s, "error setting\n"); |
360 | return ERR_UNKNOWN; | 363 | return ERR_UNKNOWN; |
361 | } | 364 | } |
362 | 365 | ||
363 | GSM_Error DCT3_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm, unsigned char msgtype) | 366 | GSM_Error DCT3_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm, unsigned char msgtype) |
364 | { | 367 | { |
365 | unsigned char req[] = {N6110_FRAME_HEADER, 0x6b, 0x01, 0x20, 0x03, | 368 | unsigned char req[] = {N6110_FRAME_HEADER, 0x6b, 0x01, 0x20, 0x03, |
366 | 0x02, /* Unknown. Not for enabling/disabling */ | 369 | 0x02, /* Unknown. Not for enabling/disabling */ |
367 | 0x00, /* Hour */ | 370 | 0x00, /* Hour */ |
368 | 0x00, /* Minute */ | 371 | 0x00, /* Minute */ |
369 | 0x00}; /* Unknown. Not seconds */ | 372 | 0x00}; /* Unknown. Not seconds */ |
370 | 373 | ||
371 | if (alarm->Location != 1) return ERR_NOTSUPPORTED; | 374 | if (alarm->Location != 1) return ERR_NOTSUPPORTED; |
372 | 375 | ||
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; |
488 | Data->NetworkInfo->NetworkName[1] = 0x00; | 492 | Data->NetworkInfo->NetworkName[1] = 0x00; |
489 | Data->NetworkInfo->State = 0; | 493 | Data->NetworkInfo->State = 0; |
490 | switch (msg.Buffer[8]) { | 494 | switch (msg.Buffer[8]) { |
491 | case 0x01: Data->NetworkInfo->State = GSM_HomeNetwork; break; | 495 | case 0x01: Data->NetworkInfo->State = GSM_HomeNetwork; break; |
492 | case 0x02: Data->NetworkInfo->State = GSM_RoamingNetwork;break; | 496 | case 0x02: Data->NetworkInfo->State = GSM_RoamingNetwork;break; |
493 | case 0x03: Data->NetworkInfo->State = GSM_RequestingNetwork;break; | 497 | case 0x03: Data->NetworkInfo->State = GSM_RequestingNetwork;break; |
494 | case 0x04: Data->NetworkInfo->State = GSM_NoNetwork; break; | 498 | case 0x04: Data->NetworkInfo->State = GSM_NoNetwork; break; |
495 | } | 499 | } |
496 | if (Data->NetworkInfo->State == GSM_HomeNetwork || Data->NetworkInfo->State == GSM_RoamingNetwork) { | 500 | if (Data->NetworkInfo->State == GSM_HomeNetwork || Data->NetworkInfo->State == GSM_RoamingNetwork) { |
497 | if (msg.Buffer[18]==0x00) { | 501 | if (msg.Buffer[18]==0x00) { |
498 | /* In 6210 name is in "normal" Unicode */ | 502 | /* In 6210 name is in "normal" Unicode */ |
499 | memcpy(Data->NetworkInfo->NetworkName,msg.Buffer+18,msg.Buffer[17]*2); | 503 | memcpy(Data->NetworkInfo->NetworkName,msg.Buffer+18,msg.Buffer[17]*2); |
500 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2] = 0x00; | 504 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2] = 0x00; |
501 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2+1] = 0x00; | 505 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2+1] = 0x00; |
502 | } else { | 506 | } else { |
503 | /* In 9210 first 0x00 is cut from Unicode string */ | 507 | /* In 9210 first 0x00 is cut from Unicode string */ |
504 | Data->NetworkInfo->NetworkName[0] = 0; | 508 | Data->NetworkInfo->NetworkName[0] = 0; |
505 | memcpy(Data->NetworkInfo->NetworkName+1,msg.Buffer+18,msg.Buffer[17]*2); | 509 | memcpy(Data->NetworkInfo->NetworkName+1,msg.Buffer+18,msg.Buffer[17]*2); |
506 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2+1]=0x00; | 510 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2+1]=0x00; |
507 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2+2]=0x00; | 511 | Data->NetworkInfo->NetworkName[msg.Buffer[17]*2+2]=0x00; |
508 | } | 512 | } |
509 | NOKIA_DecodeNetworkCode(msg.Buffer+14,Data->NetworkInfo->NetworkCode); | 513 | NOKIA_DecodeNetworkCode(msg.Buffer+14,Data->NetworkInfo->NetworkCode); |
510 | sprintf(Data->NetworkInfo->CID, "%02x%02x", msg.Buffer[10], msg.Buffer[11]); | 514 | sprintf(Data->NetworkInfo->CID, "%02x%02x", msg.Buffer[10], msg.Buffer[11]); |
511 | sprintf(Data->NetworkInfo->LAC, "%02x%02x", msg.Buffer[12], msg.Buffer[13]); | 515 | sprintf(Data->NetworkInfo->LAC, "%02x%02x", msg.Buffer[12], msg.Buffer[13]); |
@@ -1163,101 +1167,101 @@ GSM_Error DCT3_SetWAPSettings(GSM_StateMachine *s, GSM_MultiWAPSettings *setting | |||
1163 | SetReq2[pos++] = 0x02; | 1167 | SetReq2[pos++] = 0x02; |
1164 | SetReq2[pos++] = 0x00; /* SMS */ | 1168 | SetReq2[pos++] = 0x00; /* SMS */ |
1165 | if (loc2 != -1) { | 1169 | if (loc2 != -1) { |
1166 | /* Service number */ | 1170 | /* Service number */ |
1167 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc2].Service, false); | 1171 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc2].Service, false); |
1168 | /* Server number */ | 1172 | /* Server number */ |
1169 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc2].Server, false); | 1173 | pos += NOKIA_SetUnicodeString(s, SetReq2 + pos, settings->Settings[loc2].Server, false); |
1170 | } else pos += 2; | 1174 | } else pos += 2; |
1171 | memcpy(SetReq2 + pos, "\x80\x00\x00\x00\x00\x00\x00\x00", 8); | 1175 | memcpy(SetReq2 + pos, "\x80\x00\x00\x00\x00\x00\x00\x00", 8); |
1172 | pos += 8; | 1176 | pos += 8; |
1173 | smprintf(s, "Writing WAP settings part 2 (SMS bearer)\n"); | 1177 | smprintf(s, "Writing WAP settings part 2 (SMS bearer)\n"); |
1174 | error=GSM_WaitFor (s, SetReq2, pos, 0x3f, 4, ID_SetConnectSet); | 1178 | error=GSM_WaitFor (s, SetReq2, pos, 0x3f, 4, ID_SetConnectSet); |
1175 | if (error != ERR_NONE) return error; | 1179 | if (error != ERR_NONE) return error; |
1176 | } | 1180 | } |
1177 | /* USSD */ | 1181 | /* USSD */ |
1178 | if (phone3 != -1) { | 1182 | if (phone3 != -1) { |
1179 | pos = 4; | 1183 | pos = 4; |
1180 | memset(SetReq2 + pos, 0, 200 - pos); | 1184 | memset(SetReq2 + pos, 0, 200 - pos); |
1181 | SetReq2[pos++] = phone3; | 1185 | SetReq2[pos++] = phone3; |
1182 | SetReq2[pos++] = 0x02; | 1186 | SetReq2[pos++] = 0x02; |
1183 | SetReq2[pos++] = 0x02; /* USSD */ | 1187 | SetReq2[pos++] = 0x02; /* USSD */ |
1184 | if (loc3 != -1) { | 1188 | if (loc3 != -1) { |
1185 | if (!settings->Settings[loc3].IsIP) SetReq2[pos] = 0x01; | 1189 | if (!settings->Settings[loc3].IsIP) SetReq2[pos] = 0x01; |
1186 | } | 1190 | } |
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; |
1240 | default: | 1244 | default: |
1241 | smprintf(s, "Menu %i\n",msg.Buffer[3]); | 1245 | smprintf(s, "Menu %i\n",msg.Buffer[3]); |
1242 | smprintf(s, "%s\n",msg.Buffer+4); | 1246 | smprintf(s, "%s\n",msg.Buffer+4); |
1243 | strcpy(s->Phone.Data.Netmonitor,msg.Buffer+4); | 1247 | strcpy(s->Phone.Data.Netmonitor,msg.Buffer+4); |
1244 | break; | 1248 | break; |
1245 | } | 1249 | } |
1246 | return ERR_NONE; | 1250 | return ERR_NONE; |
1247 | } | 1251 | } |
1248 | 1252 | ||
1249 | GSM_Error DCT3_Netmonitor(GSM_StateMachine *s, int testnumber, char *value) | 1253 | GSM_Error DCT3_Netmonitor(GSM_StateMachine *s, int testnumber, char *value) |
1250 | { | 1254 | { |
1251 | GSM_Error error; | 1255 | GSM_Error error; |
1252 | unsigned char req[] = {0x00, 0x01, 0x7e, | 1256 | unsigned char req[] = {0x00, 0x01, 0x7e, |
1253 | 0x00}; /* Test number */ | 1257 | 0x00}; /* Test number */ |
1254 | 1258 | ||
1255 | value[0] = 0; | 1259 | value[0] = 0; |
1256 | 1260 | ||
1257 | error=DCT3_EnableSecurity (s, 0x01); | 1261 | error=DCT3_EnableSecurity (s, 0x01); |
1258 | if (error != ERR_NONE) return error; | 1262 | if (error != ERR_NONE) return error; |
1259 | 1263 | ||
1260 | req[3] = testnumber; | 1264 | req[3] = testnumber; |
1261 | 1265 | ||
1262 | smprintf(s, "Getting netmonitor test\n"); | 1266 | smprintf(s, "Getting netmonitor test\n"); |
1263 | s->Phone.Data.Netmonitor = value; | 1267 | s->Phone.Data.Netmonitor = value; |
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,53 +1,55 @@ | |||
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); |
30 | GSM_Error N61_91_ReplySetOpLogo (GSM_Protocol_Message msg, GSM_StateMachine *s); | 32 | GSM_Error N61_91_ReplySetOpLogo (GSM_Protocol_Message msg, GSM_StateMachine *s); |
31 | #ifdef GSM_ENABLE_CELLBROADCAST | 33 | #ifdef GSM_ENABLE_CELLBROADCAST |
32 | GSM_Error DCT3_ReplySetIncomingCB(GSM_Protocol_Message msg, GSM_StateMachine *s); | 34 | GSM_Error DCT3_ReplySetIncomingCB(GSM_Protocol_Message msg, GSM_StateMachine *s); |
33 | GSM_Error DCT3_ReplyIncomingCB (GSM_Protocol_Message msg, GSM_StateMachine *s); | 35 | GSM_Error DCT3_ReplyIncomingCB (GSM_Protocol_Message msg, GSM_StateMachine *s); |
34 | #endif | 36 | #endif |
35 | 37 | ||
36 | GSM_Error DCT3_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark); | 38 | GSM_Error DCT3_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark); |
37 | GSM_Error DCT3_GetWAPBookmark (GSM_StateMachine *s, GSM_WAPBookmark *bookmark); | 39 | GSM_Error DCT3_GetWAPBookmark (GSM_StateMachine *s, GSM_WAPBookmark *bookmark); |
38 | GSM_Error DCT3_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press); | 40 | GSM_Error DCT3_PressKey (GSM_StateMachine *s, GSM_KeyCode Key, bool Press); |
39 | GSM_Error DCT3_PlayTone (GSM_StateMachine *s, int Herz, unsigned char Volume, bool start); | 41 | GSM_Error DCT3_PlayTone (GSM_StateMachine *s, int Herz, unsigned char Volume, bool start); |
40 | GSM_Error DCT3_EnableSecurity (GSM_StateMachine *s, unsigned char status); | 42 | GSM_Error DCT3_EnableSecurity (GSM_StateMachine *s, unsigned char status); |
41 | GSM_Error DCT3_GetIMEI (GSM_StateMachine *s); | 43 | GSM_Error DCT3_GetIMEI (GSM_StateMachine *s); |
42 | GSM_Error DCT3_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc ); | 44 | GSM_Error DCT3_GetSMSC (GSM_StateMachine *s, GSM_SMSC *smsc ); |
43 | GSM_Error DCT3_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo); | 45 | GSM_Error DCT3_GetNetworkInfo (GSM_StateMachine *s, GSM_NetworkInfo *netinfo); |
44 | GSM_Error DCT3_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber); | 46 | GSM_Error DCT3_DialVoice (GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber); |
45 | GSM_Error DCT3_Reset (GSM_StateMachine *s, bool hard ); | 47 | GSM_Error DCT3_Reset (GSM_StateMachine *s, bool hard ); |
46 | GSM_Error DCT3_CancelCall (GSM_StateMachine *s, int ID, bool all); | 48 | GSM_Error DCT3_CancelCall (GSM_StateMachine *s, int ID, bool all); |
47 | GSM_Error DCT3_AnswerAllCalls (GSM_StateMachine *s); | 49 | GSM_Error DCT3_AnswerAllCalls (GSM_StateMachine *s); |
48 | GSM_Error DCT3_SendSMSMessage (GSM_StateMachine *s, GSM_SMSMessage *sms ); | 50 | GSM_Error DCT3_SendSMSMessage (GSM_StateMachine *s, GSM_SMSMessage *sms ); |
49 | GSM_Error DCT3_GetAlarm (GSM_StateMachine *s, GSM_Alarm *alarm,unsigned char msgtype); | 51 | GSM_Error DCT3_GetAlarm (GSM_StateMachine *s, GSM_Alarm *alarm,unsigned char msgtype); |
50 | GSM_Error DCT3_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time, unsigned char msgtype); | 52 | GSM_Error DCT3_GetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time, unsigned char msgtype); |
51 | GSM_Error DCT3_SetAlarm (GSM_StateMachine *s, GSM_Alarm *alarm, unsigned char msgtype); | 53 | GSM_Error DCT3_SetAlarm (GSM_StateMachine *s, GSM_Alarm *alarm, unsigned char msgtype); |
52 | GSM_Error DCT3_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time, unsigned char msgtype); | 54 | GSM_Error DCT3_SetDateTime (GSM_StateMachine *s, GSM_DateTime *date_time, unsigned char msgtype); |
53 | GSM_Error DCT3_SetIncomingCB (GSM_StateMachine *s, bool enable); | 55 | GSM_Error DCT3_SetIncomingCB (GSM_StateMachine *s, bool enable); |
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,52 +1,54 @@ | |||
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, |
29 | 0x00, 0x00 | 31 | 0x00, 0x00 |
30 | }; | 32 | }; |
31 | 33 | ||
32 | static GSM_Error N6110_ReplyGetPhoneLanguage(GSM_Protocol_Message msg, GSM_StateMachine *s) | 34 | static GSM_Error N6110_ReplyGetPhoneLanguage(GSM_Protocol_Message msg, GSM_StateMachine *s) |
33 | { | 35 | { |
34 | N6110_Language lang = N6110_Auto; | 36 | N6110_Language lang = N6110_Auto; |
35 | 37 | ||
36 | if (msg.Buffer[3] == 0x15) return ERR_NONE; | 38 | if (msg.Buffer[3] == 0x15) return ERR_NONE; |
37 | 39 | ||
38 | smprintf(s, "Phone language is %02x\n",msg.Buffer[6]); | 40 | smprintf(s, "Phone language is %02x\n",msg.Buffer[6]); |
39 | switch (msg.Buffer[6]) { | 41 | switch (msg.Buffer[6]) { |
40 | case 0x21: lang = N6110_Europe; break; //Polish | 42 | case 0x21: lang = N6110_Europe; break; //Polish |
41 | } | 43 | } |
42 | s->Phone.Data.Priv.N6110.PhoneLanguage = lang; | 44 | s->Phone.Data.Priv.N6110.PhoneLanguage = lang; |
43 | return ERR_NONE; | 45 | return ERR_NONE; |
44 | } | 46 | } |
45 | 47 | ||
46 | static GSM_Error N6110_GetPhoneLanguage(GSM_StateMachine *s) | 48 | static GSM_Error N6110_GetPhoneLanguage(GSM_StateMachine *s) |
47 | { | 49 | { |
48 | unsigned char feat_req[] = {N6110_FRAME_HEADER, 0x13, 0x01, | 50 | unsigned char feat_req[] = {N6110_FRAME_HEADER, 0x13, 0x01, |
49 | 0x00, /* Profile location */ | 51 | 0x00, /* Profile location */ |
50 | 0x00}; /* Feature number */ | 52 | 0x00}; /* Feature number */ |
51 | 53 | ||
52 | s->Phone.Data.Priv.N6110.PhoneLanguage = N6110_Auto; | 54 | s->Phone.Data.Priv.N6110.PhoneLanguage = N6110_Auto; |
@@ -82,96 +84,97 @@ static struct N6110_Lang_Char N6110_Lang_Table[] = { | |||
82 | {N6110_Europe,0x93,0x01,0x44},//Latin small letter n with acute | 84 | {N6110_Europe,0x93,0x01,0x44},//Latin small letter n with acute |
83 | {N6110_Europe,0x9A,0x00,0xF3},//Latin small letter o with acute | 85 | {N6110_Europe,0x9A,0x00,0xF3},//Latin small letter o with acute |
84 | {N6110_Europe,0xB2,0x20,0xAC},//euro | 86 | {N6110_Europe,0xB2,0x20,0xAC},//euro |
85 | {N6110_Europe,0xB5,0x01,0x5A},//Latin capital letter s with acute | 87 | {N6110_Europe,0xB5,0x01,0x5A},//Latin capital letter s with acute |
86 | {N6110_Europe,0xB6,0x01,0x5B},//Latin small letter s with acute | 88 | {N6110_Europe,0xB6,0x01,0x5B},//Latin small letter s with acute |
87 | {N6110_Europe,0xE7,0x01,0x79},//Latin capital letter z with acute | 89 | {N6110_Europe,0xE7,0x01,0x79},//Latin capital letter z with acute |
88 | {N6110_Europe,0xEE,0x01,0x7A},//Latin small letter z with acute | 90 | {N6110_Europe,0xEE,0x01,0x7A},//Latin small letter z with acute |
89 | {N6110_Europe,0xF4,0x01,0x7C},//Latin small letter z with dot above | 91 | {N6110_Europe,0xF4,0x01,0x7C},//Latin small letter z with dot above |
90 | {N6110_Europe,0xF0,0x01,0x7B},//Latin capital letter z with dot above | 92 | {N6110_Europe,0xF0,0x01,0x7B},//Latin capital letter z with dot above |
91 | {0,0,0,0} | 93 | {0,0,0,0} |
92 | }; | 94 | }; |
93 | 95 | ||
94 | static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const unsigned char *src, int len) | 96 | static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const unsigned char *src, int len) |
95 | { | 97 | { |
96 | int i_len = 0, o_len, i; | 98 | int i_len = 0, o_len, i; |
97 | wchar_t wc; | 99 | wchar_t wc; |
98 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; | 100 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; |
99 | bool found; | 101 | bool found; |
100 | 102 | ||
101 | for (o_len = 0; i_len < len; o_len++) { | 103 | for (o_len = 0; i_len < len; o_len++) { |
102 | found = false; | 104 | found = false; |
103 | if (Priv->PhoneLanguage != N6110_Auto) { | 105 | if (Priv->PhoneLanguage != N6110_Auto) { |
104 | i = 0; | 106 | i = 0; |
105 | while(1) { | 107 | while(1) { |
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). */ |
154 | Temp[8] = Imei[2]; Temp[9] = Imei[3]; | 157 | Temp[8] = Imei[2]; Temp[9] = Imei[3]; |
155 | Temp[10] = Imei[4]; Temp[11] = Imei[5]; | 158 | Temp[10] = Imei[4]; Temp[11] = Imei[5]; |
156 | 159 | ||
157 | /* And now we pack magic bytes from the phone. */ | 160 | /* And now we pack magic bytes from the phone. */ |
158 | Temp[12] = MagicBytes[0]; Temp[13] = MagicBytes[1]; | 161 | Temp[12] = MagicBytes[0]; Temp[13] = MagicBytes[1]; |
159 | Temp[14] = MagicBytes[2]; Temp[15] = MagicBytes[3]; | 162 | Temp[14] = MagicBytes[2]; Temp[15] = MagicBytes[3]; |
160 | 163 | ||
161 | for (i=0; i<=11; i++) if (Temp[i + 1]& 1) Temp[i]<<=1; | 164 | for (i=0; i<=11; i++) if (Temp[i + 1]& 1) Temp[i]<<=1; |
162 | switch (Temp[15] & 0x03) { | 165 | switch (Temp[15] & 0x03) { |
163 | case 1: | 166 | case 1: |
164 | case 2: j = Temp[13] & 0x07; | 167 | case 2: j = Temp[13] & 0x07; |
165 | for (i=0; i<=3; i++) Temp[i+j] ^= Temp[i+12]; | 168 | for (i=0; i<=3; i++) Temp[i+j] ^= Temp[i+12]; |
166 | break; | 169 | break; |
167 | default: j = Temp[14] & 0x07; | 170 | default: j = Temp[14] & 0x07; |
168 | for (i=0; i<=3; i++) Temp[i + j] |= Temp[i + 12]; | 171 | for (i=0; i<=3; i++) Temp[i + j] |= Temp[i + 12]; |
169 | } | 172 | } |
170 | for (i=0; i<=15; i++) CRC ^= Temp[i]; | 173 | for (i=0; i<=15; i++) CRC ^= Temp[i]; |
171 | for (i=0; i<=15; i++) { | 174 | for (i=0; i<=15; i++) { |
172 | switch (Temp[15 - i] & 0x06) { | 175 | switch (Temp[15 - i] & 0x06) { |
173 | case 0: j = Temp[i] | CRC; break; | 176 | case 0: j = Temp[i] | CRC; break; |
174 | case 2: | 177 | case 2: |
175 | case 4: j = Temp[i] ^ CRC; break; | 178 | case 4: j = Temp[i] ^ CRC; break; |
176 | case 6: j = Temp[i] & CRC; break; | 179 | case 6: j = Temp[i] & CRC; break; |
177 | } | 180 | } |
@@ -779,96 +782,97 @@ static GSM_Error N6110_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, | |||
779 | 0x00,0x78}; | 782 | 0x00,0x78}; |
780 | unsigned char reqBin[1000] = {0x00,0x01,0xa0,0x00,0x00,0x0c,0x01,0x2c}; | 783 | unsigned char reqBin[1000] = {0x00,0x01,0xa0,0x00,0x00,0x0c,0x01,0x2c}; |
781 | 784 | ||
782 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NORING)) return ERR_NOTSUPPORTED; | 785 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NORING)) return ERR_NOTSUPPORTED; |
783 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; | 786 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; |
784 | 787 | ||
785 | switch (Ringtone->Format) { | 788 | switch (Ringtone->Format) { |
786 | case RING_NOTETONE: | 789 | case RING_NOTETONE: |
787 | if (Ringtone->Location==255) { | 790 | if (Ringtone->Location==255) { |
788 | /* Only 6110, 6130 and 6150 support it */ | 791 | /* Only 6110, 6130 and 6150 support it */ |
789 | if (strcmp(s->Phone.Data.Model,"NSE-3") == 0 || strcmp(s->Phone.Data.Model,"NSK-3") == 0 || | 792 | if (strcmp(s->Phone.Data.Model,"NSE-3") == 0 || strcmp(s->Phone.Data.Model,"NSK-3") == 0 || |
790 | strcmp(s->Phone.Data.Model,"NSM-1") == 0) { | 793 | strcmp(s->Phone.Data.Model,"NSM-1") == 0) { |
791 | req[0] = 0x0c; | 794 | req[0] = 0x0c; |
792 | req[1] = 0x01; | 795 | req[1] = 0x01; |
793 | UDHHeader.Type = UDH_NokiaRingtone; | 796 | UDHHeader.Type = UDH_NokiaRingtone; |
794 | GSM_EncodeUDHHeader(&UDHHeader); | 797 | GSM_EncodeUDHHeader(&UDHHeader); |
795 | /* We copy UDH now */ | 798 | /* We copy UDH now */ |
796 | memcpy(req+2,UDHHeader.Text,UDHHeader.Length); | 799 | memcpy(req+2,UDHHeader.Text,UDHHeader.Length); |
797 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+2+UDHHeader.Length, &size); | 800 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+2+UDHHeader.Length, &size); |
798 | error = s->Protocol.Functions->WriteMessage(s, req, 2+UDHHeader.Length+size, 0x12); | 801 | error = s->Protocol.Functions->WriteMessage(s, req, 2+UDHHeader.Length+size, 0x12); |
799 | if (error!=ERR_NONE) return error; | 802 | if (error!=ERR_NONE) return error; |
800 | my_sleep(1000); | 803 | my_sleep(1000); |
801 | /* We have to make something (not important, what) now */ | 804 | /* We have to make something (not important, what) now */ |
802 | /* no answer from phone*/ | 805 | /* no answer from phone*/ |
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; |
851 | } | 855 | } |
852 | 856 | ||
853 | static GSM_Error N6110_ReplyGetStartup(GSM_Protocol_Message msg, GSM_StateMachine *s) | 857 | static GSM_Error N6110_ReplyGetStartup(GSM_Protocol_Message msg, GSM_StateMachine *s) |
854 | { | 858 | { |
855 | int i, count = 5; | 859 | int i, count = 5; |
856 | GSM_Phone_Data *Data = &s->Phone.Data; | 860 | GSM_Phone_Data *Data = &s->Phone.Data; |
857 | 861 | ||
858 | smprintf(s, "Startup logo & notes received\n"); | 862 | smprintf(s, "Startup logo & notes received\n"); |
859 | for (i=0;i<msg.Buffer[4];i++) { | 863 | for (i=0;i<msg.Buffer[4];i++) { |
860 | switch (msg.Buffer[count++]) { | 864 | switch (msg.Buffer[count++]) { |
861 | case 0x01: | 865 | case 0x01: |
862 | smprintf(s, "Startup logo\n"); | 866 | smprintf(s, "Startup logo\n"); |
863 | if (Data->Bitmap->Type == GSM_StartupLogo) { | 867 | if (Data->Bitmap->Type == GSM_StartupLogo) { |
864 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; | 868 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; |
865 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; | 869 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; |
866 | PHONE_DecodeBitmap(GSM_NokiaStartupLogo, msg.Buffer + count, Data->Bitmap); | 870 | PHONE_DecodeBitmap(GSM_NokiaStartupLogo, msg.Buffer + count, Data->Bitmap); |
867 | } else { | 871 | } else { |
868 | count = count + 2; | 872 | count = count + 2; |
869 | } | 873 | } |
870 | count = count + PHONE_GetBitmapSize(GSM_NokiaStartupLogo,0,0); | 874 | count = count + PHONE_GetBitmapSize(GSM_NokiaStartupLogo,0,0); |
871 | break; | 875 | break; |
872 | case 0x02: | 876 | case 0x02: |
873 | smprintf(s, "Welcome note\n"); | 877 | smprintf(s, "Welcome note\n"); |
874 | if (Data->Bitmap->Type == GSM_WelcomeNote_Text) { | 878 | if (Data->Bitmap->Type == GSM_WelcomeNote_Text) { |
@@ -1479,133 +1483,135 @@ static GSM_Error N6110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi | |||
1479 | int i,end,start; | 1483 | int i,end,start; |
1480 | 1484 | ||
1481 | smprintf(s, "Ringtone received\n"); | 1485 | smprintf(s, "Ringtone received\n"); |
1482 | switch (msg.Buffer[4]) { | 1486 | switch (msg.Buffer[4]) { |
1483 | case 0x00: | 1487 | case 0x00: |
1484 | switch (Data->Ringtone->Format) { | 1488 | switch (Data->Ringtone->Format) { |
1485 | case RING_NOTETONE: | 1489 | case RING_NOTETONE: |
1486 | memcpy(buffer,msg.Buffer,msg.Length); | 1490 | memcpy(buffer,msg.Buffer,msg.Length); |
1487 | i=7; | 1491 | i=7; |
1488 | if (buffer[9]==0x4a && buffer[10]==0x3a) i=8; | 1492 | if (buffer[9]==0x4a && buffer[10]==0x3a) i=8; |
1489 | buffer[i]=0x02; | 1493 | buffer[i]=0x02; |
1490 | error=GSM_DecodeNokiaRTTLRingtone(Data->Ringtone, buffer+i, msg.Length-i); | 1494 | error=GSM_DecodeNokiaRTTLRingtone(Data->Ringtone, buffer+i, msg.Length-i); |
1491 | if (error!=ERR_NONE) return ERR_EMPTY; | 1495 | if (error!=ERR_NONE) return ERR_EMPTY; |
1492 | return ERR_NONE; | 1496 | return ERR_NONE; |
1493 | case RING_NOKIABINARY: | 1497 | case RING_NOKIABINARY: |
1494 | i=8; | 1498 | i=8; |
1495 | while (msg.Buffer[i]!=0) { | 1499 | while (msg.Buffer[i]!=0) { |
1496 | i++; | 1500 | i++; |
1497 | if (i>msg.Length) return ERR_EMPTY; | 1501 | if (i>msg.Length) return ERR_EMPTY; |
1498 | } | 1502 | } |
1499 | EncodeUnicode(Data->Ringtone->Name,msg.Buffer+8,i-8); | 1503 | EncodeUnicode(Data->Ringtone->Name,msg.Buffer+8,i-8); |
1500 | smprintf(s, "Name \"%s\"\n",DecodeUnicodeString(Data->Ringtone->Name)); | 1504 | smprintf(s, "Name \"%s\"\n",DecodeUnicodeString(Data->Ringtone->Name)); |
1501 | /* Looking for start && end */ | 1505 | /* Looking for start && end */ |
1502 | end=0;start=0;i=0; | 1506 | end=0;start=0;i=0; |
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; |
1588 | case SEC_None : smprintf(s, "nothing to enter.\n"); break; | 1594 | case SEC_None : smprintf(s, "nothing to enter.\n"); break; |
1589 | default : smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); | 1595 | default : smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); |
1590 | return ERR_UNKNOWNRESPONSE; | 1596 | return ERR_UNKNOWNRESPONSE; |
1591 | } | 1597 | } |
1592 | #endif | 1598 | #endif |
1593 | return ERR_NONE; | 1599 | return ERR_NONE; |
1594 | } | 1600 | } |
1595 | 1601 | ||
1596 | static GSM_Error N6110_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status) | 1602 | static GSM_Error N6110_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status) |
1597 | { | 1603 | { |
1598 | unsigned char req[4] = {N6110_FRAME_HEADER, 0x07}; | 1604 | unsigned char req[4] = {N6110_FRAME_HEADER, 0x07}; |
1599 | 1605 | ||
1600 | s->Phone.Data.SecurityStatus=Status; | 1606 | s->Phone.Data.SecurityStatus=Status; |
1601 | smprintf(s, "Getting security code status\n"); | 1607 | smprintf(s, "Getting security code status\n"); |
1602 | return GSM_WaitFor (s, req, 4, 0x08, 2, ID_GetSecurityStatus); | 1608 | return GSM_WaitFor (s, req, 4, 0x08, 2, ID_GetSecurityStatus); |
1603 | } | 1609 | } |
1604 | 1610 | ||
1605 | static GSM_Error N6110_ReplyEnterSecurityCode(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1611 | static GSM_Error N6110_ReplyEnterSecurityCode(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1606 | { | 1612 | { |
1607 | switch (msg.Buffer[3]) { | 1613 | switch (msg.Buffer[3]) { |
1608 | case 0x0b: | 1614 | case 0x0b: |
1609 | smprintf(s, "Security code OK\n"); | 1615 | smprintf(s, "Security code OK\n"); |
1610 | return ERR_NONE; | 1616 | return ERR_NONE; |
1611 | case 0x0c: | 1617 | case 0x0c: |
@@ -2398,98 +2404,98 @@ static GSM_Error N6110_ReplyGetNextCalendar(GSM_Protocol_Message msg, GSM_StateM | |||
2398 | } | 2404 | } |
2399 | } | 2405 | } |
2400 | return ERR_NONE; | 2406 | return ERR_NONE; |
2401 | case 0x93: | 2407 | case 0x93: |
2402 | smprintf(s, "Can't get calendar note - too high location?\n"); | 2408 | smprintf(s, "Can't get calendar note - too high location?\n"); |
2403 | return ERR_INVALIDLOCATION; | 2409 | return ERR_INVALIDLOCATION; |
2404 | } | 2410 | } |
2405 | return ERR_UNKNOWNRESPONSE; | 2411 | return ERR_UNKNOWNRESPONSE; |
2406 | } | 2412 | } |
2407 | 2413 | ||
2408 | static GSM_Error N6110_GetNextCalendarNote(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start) | 2414 | static GSM_Error N6110_GetNextCalendarNote(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start) |
2409 | { | 2415 | { |
2410 | int Text, Time, Alarm, Phone, Recurrance, EndTime, Location; | 2416 | int Text, Time, Alarm, Phone, Recurrance, EndTime, Location; |
2411 | GSM_Error error; | 2417 | GSM_Error error; |
2412 | GSM_DateTime date_time; | 2418 | GSM_DateTime date_time; |
2413 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; | 2419 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; |
2414 | unsigned char req[] = {N6110_FRAME_HEADER, 0x66, | 2420 | unsigned char req[] = {N6110_FRAME_HEADER, 0x66, |
2415 | 0x00}; /* Location */ | 2421 | 0x00}; /* Location */ |
2416 | 2422 | ||
2417 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOCALENDAR)) return ERR_NOTSUPPORTED; | 2423 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOCALENDAR)) return ERR_NOTSUPPORTED; |
2418 | 2424 | ||
2419 | if (start) { | 2425 | if (start) { |
2420 | Priv->LastCalendarPos = 1; | 2426 | Priv->LastCalendarPos = 1; |
2421 | } else { | 2427 | } else { |
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); |
2472 | } | 2478 | } |
2473 | 2479 | ||
2474 | return DCT3_AnswerAllCalls(s); | 2480 | return DCT3_AnswerAllCalls(s); |
2475 | } | 2481 | } |
2476 | 2482 | ||
2477 | static GSM_Error N6110_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber) | 2483 | static GSM_Error N6110_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber) |
2478 | { | 2484 | { |
2479 | unsigned int pos = 4; | 2485 | unsigned int pos = 4; |
2480 | unsigned char req[100] = {N6110_FRAME_HEADER,0x01, | 2486 | unsigned char req[100] = {N6110_FRAME_HEADER,0x01, |
2481 | 0x0c}; /* Length of number */ | 2487 | 0x0c}; /* Length of number */ |
2482 | 2488 | ||
2483 | if (ShowNumber == GSM_CALL_DefaultNumberPresence) return DCT3_DialVoice(s,number,ShowNumber); | 2489 | if (ShowNumber == GSM_CALL_DefaultNumberPresence) return DCT3_DialVoice(s,number,ShowNumber); |
2484 | 2490 | ||
2485 | req[pos++] = strlen(number); | 2491 | req[pos++] = strlen(number); |
2486 | memcpy(req+pos,number,strlen(number)); | 2492 | memcpy(req+pos,number,strlen(number)); |
2487 | pos += strlen(number); | 2493 | pos += strlen(number); |
2488 | req[pos++] = 0x05; /* call type: voice - 0x05, data - 0x01 */ | 2494 | req[pos++] = 0x05; /* call type: voice - 0x05, data - 0x01 */ |
2489 | req[pos++] = 0x01; | 2495 | req[pos++] = 0x01; |
2490 | req[pos++] = 0x01; | 2496 | req[pos++] = 0x01; |
2491 | req[pos++] = 0x05; | 2497 | req[pos++] = 0x05; |
2492 | req[pos++] = 0x81; | 2498 | req[pos++] = 0x81; |
2493 | switch (ShowNumber) { | 2499 | switch (ShowNumber) { |
2494 | case GSM_CALL_HideNumber: | 2500 | case GSM_CALL_HideNumber: |
2495 | req[pos++] = 0x02; | 2501 | req[pos++] = 0x02; |
@@ -2762,123 +2768,124 @@ GSM_Phone_Functions N6110Phone = { | |||
2762 | NOKIA_GetManufacturer, | 2768 | NOKIA_GetManufacturer, |
2763 | DCT3DCT4_GetModel, | 2769 | DCT3DCT4_GetModel, |
2764 | DCT3DCT4_GetFirmware, | 2770 | DCT3DCT4_GetFirmware, |
2765 | DCT3_GetIMEI, | 2771 | DCT3_GetIMEI, |
2766 | DCT3_GetOriginalIMEI, | 2772 | DCT3_GetOriginalIMEI, |
2767 | DCT3_GetManufactureMonth, | 2773 | DCT3_GetManufactureMonth, |
2768 | DCT3_GetProductCode, | 2774 | DCT3_GetProductCode, |
2769 | DCT3_GetHardware, | 2775 | DCT3_GetHardware, |
2770 | DCT3_GetPPM, | 2776 | DCT3_GetPPM, |
2771 | NOTSUPPORTED, /* GetSIMIMSI */ | 2777 | NOTSUPPORTED, /* GetSIMIMSI */ |
2772 | N6110_GetDateTime, | 2778 | N6110_GetDateTime, |
2773 | N6110_SetDateTime, | 2779 | N6110_SetDateTime, |
2774 | N6110_GetAlarm, | 2780 | N6110_GetAlarm, |
2775 | N6110_SetAlarm, | 2781 | N6110_SetAlarm, |
2776 | NOTSUPPORTED, /* GetLocale */ | 2782 | NOTSUPPORTED, /* GetLocale */ |
2777 | NOTSUPPORTED, /* SetLocale */ | 2783 | NOTSUPPORTED, /* SetLocale */ |
2778 | DCT3_PressKey, | 2784 | DCT3_PressKey, |
2779 | DCT3_Reset, | 2785 | DCT3_Reset, |
2780 | N61_71_ResetPhoneSettings, | 2786 | N61_71_ResetPhoneSettings, |
2781 | N6110_EnterSecurityCode, | 2787 | N6110_EnterSecurityCode, |
2782 | N6110_GetSecurityStatus, | 2788 | N6110_GetSecurityStatus, |
2783 | N6110_GetDisplayStatus, | 2789 | N6110_GetDisplayStatus, |
2784 | NOTIMPLEMENTED, /* SetAutoNetworkLogin */ | 2790 | NOTIMPLEMENTED, /* SetAutoNetworkLogin */ |
2785 | N6110_GetBatteryCharge, | 2791 | N6110_GetBatteryCharge, |
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 */ |
2834 | DCT3_PlayTone, | 2841 | DCT3_PlayTone, |
2835 | DCT3_GetWAPBookmark, | 2842 | DCT3_GetWAPBookmark, |
2836 | DCT3_SetWAPBookmark, | 2843 | DCT3_SetWAPBookmark, |
2837 | DCT3_DeleteWAPBookmark, | 2844 | DCT3_DeleteWAPBookmark, |
2838 | DCT3_GetWAPSettings, | 2845 | DCT3_GetWAPSettings, |
2839 | DCT3_SetWAPSettings, | 2846 | DCT3_SetWAPSettings, |
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,50 +1,53 @@ | |||
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 | { |
27 | return DCT3_SetAlarm(s, alarm, 0x19); | 30 | return DCT3_SetAlarm(s, alarm, 0x19); |
28 | } | 31 | } |
29 | 32 | ||
30 | static GSM_Error N7110_ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) | 33 | static GSM_Error N7110_ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) |
31 | { | 34 | { |
32 | GSM_Phone_Data *Data = &s->Phone.Data; | 35 | GSM_Phone_Data *Data = &s->Phone.Data; |
33 | 36 | ||
34 | smprintf(s, "Phonebook entry received\n"); | 37 | smprintf(s, "Phonebook entry received\n"); |
35 | switch (msg.Buffer[6]) { | 38 | switch (msg.Buffer[6]) { |
36 | case 0x0f: | 39 | case 0x0f: |
37 | return N71_65_ReplyGetMemoryError(msg.Buffer[10], s); | 40 | return N71_65_ReplyGetMemoryError(msg.Buffer[10], s); |
38 | default: | 41 | default: |
39 | return N71_65_DecodePhonebook(s, Data->Memory,Data->Bitmap,Data->SpeedDial,msg.Buffer+18,msg.Length-18,false); | 42 | return N71_65_DecodePhonebook(s, Data->Memory,Data->Bitmap,Data->SpeedDial,msg.Buffer+18,msg.Length-18,false); |
40 | } | 43 | } |
41 | return ERR_UNKNOWN; | 44 | return ERR_UNKNOWN; |
42 | } | 45 | } |
43 | 46 | ||
44 | static GSM_Error N7110_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry) | 47 | static GSM_Error N7110_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry) |
45 | { | 48 | { |
46 | unsigned char req[] = {N7110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, | 49 | unsigned char req[] = {N7110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, |
47 | 0x02, /* memory type */ | 50 | 0x02, /* memory type */ |
48 | 0x05, | 51 | 0x05, |
49 | 0x00, 0x00,/* location */ | 52 | 0x00, 0x00,/* location */ |
50 | 0x00, 0x00}; | 53 | 0x00, 0x00}; |
@@ -481,96 +484,97 @@ static GSM_Error N7110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi | |||
481 | tmp=0;i=4; | 484 | tmp=0;i=4; |
482 | while (msg.Buffer[i]!=0 || msg.Buffer[i+1]!=0) { | 485 | while (msg.Buffer[i]!=0 || msg.Buffer[i+1]!=0) { |
483 | tmp++; | 486 | tmp++; |
484 | i=i+2; | 487 | i=i+2; |
485 | if (i>msg.Length) return ERR_EMPTY; | 488 | if (i>msg.Length) return ERR_EMPTY; |
486 | } | 489 | } |
487 | memcpy(Data->Ringtone->Name,msg.Buffer+6,tmp*2); | 490 | memcpy(Data->Ringtone->Name,msg.Buffer+6,tmp*2); |
488 | smprintf(s, "Name \"%s\"\n",DecodeUnicodeString(Data->Ringtone->Name)); | 491 | smprintf(s, "Name \"%s\"\n",DecodeUnicodeString(Data->Ringtone->Name)); |
489 | /* Looking for end */ | 492 | /* Looking for end */ |
490 | i=37; | 493 | i=37; |
491 | while (true) { | 494 | while (true) { |
492 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { | 495 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { |
493 | i=i+2; break; | 496 | i=i+2; break; |
494 | } | 497 | } |
495 | if (msg.Buffer[i]==0x0e && msg.Buffer[i+1]==0x0b) { | 498 | if (msg.Buffer[i]==0x0e && msg.Buffer[i+1]==0x0b) { |
496 | i=i+2; break; | 499 | i=i+2; break; |
497 | } | 500 | } |
498 | i++; | 501 | i++; |
499 | if (i==msg.Length) return ERR_EMPTY; | 502 | if (i==msg.Length) return ERR_EMPTY; |
500 | } | 503 | } |
501 | /* Copying frame */ | 504 | /* Copying frame */ |
502 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+37,i-37); | 505 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+37,i-37); |
503 | Data->Ringtone->NokiaBinary.Length=i-37; | 506 | Data->Ringtone->NokiaBinary.Length=i-37; |
504 | return ERR_NONE; | 507 | return ERR_NONE; |
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 | { |
553 | GSM_Phone_N7110Data*Priv = &s->Phone.Data.Priv.N7110; | 557 | GSM_Phone_N7110Data*Priv = &s->Phone.Data.Priv.N7110; |
554 | GSM_SMSFolders folders; | 558 | GSM_SMSFolders folders; |
555 | GSM_Error error; | 559 | GSM_Error error; |
556 | int i, j = 0, count = 0; | 560 | int i, j = 0, count = 0; |
557 | unsigned char req[] = {N6110_FRAME_HEADER, 0x96, | 561 | unsigned char req[] = {N6110_FRAME_HEADER, 0x96, |
558 | 0x00, /* Folder ID */ | 562 | 0x00, /* Folder ID */ |
559 | 0x0f, 0x07}; | 563 | 0x0f, 0x07}; |
560 | 564 | ||
561 | error=N7110_GetSMSFolders (s, &folders); | 565 | error=N7110_GetSMSFolders (s, &folders); |
562 | if (error!=ERR_NONE) return error; | 566 | if (error!=ERR_NONE) return error; |
563 | 567 | ||
564 | for (i=0;i<folders.Number;i++) { | 568 | for (i=0;i<folders.Number;i++) { |
565 | req[4] = (i+1) * 0x08;/* SMS folder ID */ | 569 | req[4] = (i+1) * 0x08;/* SMS folder ID */ |
566 | error = GSM_WaitFor (s, req, 7, 0x14, 4, ID_GetBitmap); | 570 | error = GSM_WaitFor (s, req, 7, 0x14, 4, ID_GetBitmap); |
567 | if (error!=ERR_NONE) return error; | 571 | if (error!=ERR_NONE) return error; |
568 | for (j=0;j<Priv->LastPictureImageFolder.Number;j++) { | 572 | for (j=0;j<Priv->LastPictureImageFolder.Number;j++) { |
569 | count++; | 573 | count++; |
570 | if (count==Bitmap->Location) break; | 574 | if (count==Bitmap->Location) break; |
571 | } | 575 | } |
572 | if (count==Bitmap->Location) break; | 576 | if (count==Bitmap->Location) break; |
573 | } | 577 | } |
574 | if (count!=Bitmap->Location) return ERR_INVALIDLOCATION; | 578 | if (count!=Bitmap->Location) return ERR_INVALIDLOCATION; |
575 | *folder = (i+1) * 0x08;/* SMS Folder ID */ | 579 | *folder = (i+1) * 0x08;/* SMS Folder ID */ |
576 | *location= Priv->LastPictureImageFolder.Location[j]; | 580 | *location= Priv->LastPictureImageFolder.Location[j]; |
@@ -1602,123 +1606,124 @@ GSM_Phone_Functions N7110Phone = { | |||
1602 | NOKIA_GetManufacturer, | 1606 | NOKIA_GetManufacturer, |
1603 | DCT3DCT4_GetModel, | 1607 | DCT3DCT4_GetModel, |
1604 | DCT3DCT4_GetFirmware, | 1608 | DCT3DCT4_GetFirmware, |
1605 | DCT3_GetIMEI, | 1609 | DCT3_GetIMEI, |
1606 | DCT3_GetOriginalIMEI, | 1610 | DCT3_GetOriginalIMEI, |
1607 | DCT3_GetManufactureMonth, | 1611 | DCT3_GetManufactureMonth, |
1608 | DCT3_GetProductCode, | 1612 | DCT3_GetProductCode, |
1609 | DCT3_GetHardware, | 1613 | DCT3_GetHardware, |
1610 | DCT3_GetPPM, | 1614 | DCT3_GetPPM, |
1611 | NOTSUPPORTED, /* GetSIMIMSI */ | 1615 | NOTSUPPORTED, /* GetSIMIMSI */ |
1612 | N71_92_GetDateTime, | 1616 | N71_92_GetDateTime, |
1613 | N71_92_SetDateTime, | 1617 | N71_92_SetDateTime, |
1614 | N7110_GetAlarm, | 1618 | N7110_GetAlarm, |
1615 | N7110_SetAlarm, | 1619 | N7110_SetAlarm, |
1616 | NOTSUPPORTED, /* GetLocale */ | 1620 | NOTSUPPORTED, /* GetLocale */ |
1617 | NOTSUPPORTED, /* SetLocale */ | 1621 | NOTSUPPORTED, /* SetLocale */ |
1618 | DCT3_PressKey, | 1622 | DCT3_PressKey, |
1619 | DCT3_Reset, | 1623 | DCT3_Reset, |
1620 | N61_71_ResetPhoneSettings, | 1624 | N61_71_ResetPhoneSettings, |
1621 | NOTSUPPORTED, /* EnterSecurityCode*/ | 1625 | NOTSUPPORTED, /* EnterSecurityCode*/ |
1622 | NOTSUPPORTED, /* GetSecurityStatus*/ | 1626 | NOTSUPPORTED, /* GetSecurityStatus*/ |
1623 | NOTSUPPORTED, /* GetDisplayStatus*/ | 1627 | NOTSUPPORTED, /* GetDisplayStatus*/ |
1624 | NOTIMPLEMENTED, /* SetAutoNetworkLogin*/ | 1628 | NOTIMPLEMENTED, /* SetAutoNetworkLogin*/ |
1625 | N71_92_GetBatteryCharge, | 1629 | N71_92_GetBatteryCharge, |
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*/ |
1674 | DCT3_PlayTone, | 1679 | DCT3_PlayTone, |
1675 | DCT3_GetWAPBookmark, | 1680 | DCT3_GetWAPBookmark, |
1676 | DCT3_SetWAPBookmark, | 1681 | DCT3_SetWAPBookmark, |
1677 | DCT3_DeleteWAPBookmark, | 1682 | DCT3_DeleteWAPBookmark, |
1678 | DCT3_GetWAPSettings, | 1683 | DCT3_GetWAPSettings, |
1679 | DCT3_SetWAPSettings, | 1684 | DCT3_SetWAPSettings, |
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 | |||
@@ -274,123 +274,124 @@ GSM_Phone_Functions N9210Phone = { | |||
274 | NOKIA_GetManufacturer, | 274 | NOKIA_GetManufacturer, |
275 | DCT3DCT4_GetModel, | 275 | DCT3DCT4_GetModel, |
276 | DCT3DCT4_GetFirmware, | 276 | DCT3DCT4_GetFirmware, |
277 | DCT3_GetIMEI, | 277 | DCT3_GetIMEI, |
278 | DCT3_GetOriginalIMEI, | 278 | DCT3_GetOriginalIMEI, |
279 | DCT3_GetManufactureMonth, | 279 | DCT3_GetManufactureMonth, |
280 | DCT3_GetProductCode, | 280 | DCT3_GetProductCode, |
281 | DCT3_GetHardware, | 281 | DCT3_GetHardware, |
282 | DCT3_GetPPM, | 282 | DCT3_GetPPM, |
283 | NOTSUPPORTED, /* GetSIMIMSI */ | 283 | NOTSUPPORTED, /* GetSIMIMSI */ |
284 | N71_92_GetDateTime, | 284 | N71_92_GetDateTime, |
285 | N71_92_SetDateTime, | 285 | N71_92_SetDateTime, |
286 | NOTIMPLEMENTED, /* GetAlarm */ | 286 | NOTIMPLEMENTED, /* GetAlarm */ |
287 | NOTIMPLEMENTED, /* SetAlarm */ | 287 | NOTIMPLEMENTED, /* SetAlarm */ |
288 | NOTSUPPORTED, /* GetLocale */ | 288 | NOTSUPPORTED, /* GetLocale */ |
289 | NOTSUPPORTED, /* SetLocale */ | 289 | NOTSUPPORTED, /* SetLocale */ |
290 | NOTIMPLEMENTED, /* PressKey */ | 290 | NOTIMPLEMENTED, /* PressKey */ |
291 | NOTIMPLEMENTED, /* Reset */ | 291 | NOTIMPLEMENTED, /* Reset */ |
292 | NOTIMPLEMENTED, /* ResetPhoneSettings*/ | 292 | NOTIMPLEMENTED, /* ResetPhoneSettings*/ |
293 | NOTSUPPORTED, /* EnterSecurityCode*/ | 293 | NOTSUPPORTED, /* EnterSecurityCode*/ |
294 | NOTSUPPORTED, /* GetSecurityStatus*/ | 294 | NOTSUPPORTED, /* GetSecurityStatus*/ |
295 | NOTSUPPORTED, /* GetDisplayStatus*/ | 295 | NOTSUPPORTED, /* GetDisplayStatus*/ |
296 | NOTIMPLEMENTED, /* SetAutoNetworkLogin*/ | 296 | NOTIMPLEMENTED, /* SetAutoNetworkLogin*/ |
297 | N71_92_GetBatteryCharge, | 297 | N71_92_GetBatteryCharge, |
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*/ |
346 | NOTSUPPORTED, /* PlayTone */ | 347 | NOTSUPPORTED, /* PlayTone */ |
347 | NOTIMPLEMENTED, /* GetWAPBookmark */ | 348 | NOTIMPLEMENTED, /* GetWAPBookmark */ |
348 | NOTIMPLEMENTED, /* SetWAPBookmark */ | 349 | NOTIMPLEMENTED, /* SetWAPBookmark */ |
349 | NOTIMPLEMENTED, /* DeleteWAPBookmark */ | 350 | NOTIMPLEMENTED, /* DeleteWAPBookmark */ |
350 | NOTIMPLEMENTED, /* GetWAPSettings */ | 351 | NOTIMPLEMENTED, /* GetWAPSettings */ |
351 | NOTSUPPORTED, /* SetWAPSettings */ | 352 | NOTSUPPORTED, /* SetWAPSettings */ |
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 | |||
@@ -149,123 +149,124 @@ GSM_Phone_Functions N3320Phone = { | |||
149 | NOKIA_GetManufacturer, | 149 | NOKIA_GetManufacturer, |
150 | DCT3DCT4_GetModel, | 150 | DCT3DCT4_GetModel, |
151 | DCT3DCT4_GetFirmware, | 151 | DCT3DCT4_GetFirmware, |
152 | NOTSUPPORTED, /* GetIMEI */ | 152 | NOTSUPPORTED, /* GetIMEI */ |
153 | NOTSUPPORTED, /* GetOriginalIMEI */ | 153 | NOTSUPPORTED, /* GetOriginalIMEI */ |
154 | NOTSUPPORTED, /* GetManufactureMonth*/ | 154 | NOTSUPPORTED, /* GetManufactureMonth*/ |
155 | NOTSUPPORTED, /* GetProductCode */ | 155 | NOTSUPPORTED, /* GetProductCode */ |
156 | NOTSUPPORTED, /* GetHardware */ | 156 | NOTSUPPORTED, /* GetHardware */ |
157 | NOTSUPPORTED, /* GetPPM */ | 157 | NOTSUPPORTED, /* GetPPM */ |
158 | NOTSUPPORTED, /* GetSIMIMSI */ | 158 | NOTSUPPORTED, /* GetSIMIMSI */ |
159 | N3320_GetDateTime, | 159 | N3320_GetDateTime, |
160 | NOTSUPPORTED, /* SetDateTime */ | 160 | NOTSUPPORTED, /* SetDateTime */ |
161 | NOTSUPPORTED, /* GetAlarm */ | 161 | NOTSUPPORTED, /* GetAlarm */ |
162 | NOTSUPPORTED, /* SetAlarm */ | 162 | NOTSUPPORTED, /* SetAlarm */ |
163 | NOTSUPPORTED, /* GetLocale */ | 163 | NOTSUPPORTED, /* GetLocale */ |
164 | NOTSUPPORTED, /* SetLocale */ | 164 | NOTSUPPORTED, /* SetLocale */ |
165 | NOTSUPPORTED, /* PressKey */ | 165 | NOTSUPPORTED, /* PressKey */ |
166 | NOTSUPPORTED, /* Reset */ | 166 | NOTSUPPORTED, /* Reset */ |
167 | NOTSUPPORTED, /* ResetPhoneSettings*/ | 167 | NOTSUPPORTED, /* ResetPhoneSettings*/ |
168 | NOTSUPPORTED, /* EnterSecurityCode*/ | 168 | NOTSUPPORTED, /* EnterSecurityCode*/ |
169 | NOTSUPPORTED, /* GetSecurityStatus*/ | 169 | NOTSUPPORTED, /* GetSecurityStatus*/ |
170 | NOTSUPPORTED, /* GetDisplayStatus*/ | 170 | NOTSUPPORTED, /* GetDisplayStatus*/ |
171 | NOTSUPPORTED, /* SetAutoNetworkLogin*/ | 171 | NOTSUPPORTED, /* SetAutoNetworkLogin*/ |
172 | NOTSUPPORTED, /* GetBatteryCharge*/ | 172 | NOTSUPPORTED, /* GetBatteryCharge*/ |
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*/ |
221 | NOTSUPPORTED, /* PlayTone */ | 222 | NOTSUPPORTED, /* PlayTone */ |
222 | NOTSUPPORTED, /* GetWAPBookmark */ | 223 | NOTSUPPORTED, /* GetWAPBookmark */ |
223 | NOTSUPPORTED, /* SetWAPBookmark */ | 224 | NOTSUPPORTED, /* SetWAPBookmark */ |
224 | NOTSUPPORTED, /* DeleteWAPBookmark */ | 225 | NOTSUPPORTED, /* DeleteWAPBookmark */ |
225 | NOTSUPPORTED, /* GetWAPSettings */ | 226 | NOTSUPPORTED, /* GetWAPSettings */ |
226 | NOTSUPPORTED, /* SetWAPSettings */ | 227 | NOTSUPPORTED, /* SetWAPSettings */ |
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 | |||
@@ -270,123 +270,124 @@ GSM_Phone_Functions N3650Phone = { | |||
270 | NOKIA_GetManufacturer, | 270 | NOKIA_GetManufacturer, |
271 | DCT3DCT4_GetModel, | 271 | DCT3DCT4_GetModel, |
272 | DCT3DCT4_GetFirmware, | 272 | DCT3DCT4_GetFirmware, |
273 | DCT4_GetIMEI, | 273 | DCT4_GetIMEI, |
274 | NOTSUPPORTED, /* GetOriginalIMEI */ | 274 | NOTSUPPORTED, /* GetOriginalIMEI */ |
275 | NOTSUPPORTED, /* GetManufactureMonth*/ | 275 | NOTSUPPORTED, /* GetManufactureMonth*/ |
276 | DCT4_GetProductCode, | 276 | DCT4_GetProductCode, |
277 | DCT4_GetHardware, | 277 | DCT4_GetHardware, |
278 | NOTSUPPORTED, /* GetPPM */ | 278 | NOTSUPPORTED, /* GetPPM */ |
279 | NOTSUPPORTED, /* GetSIMIMSI */ | 279 | NOTSUPPORTED, /* GetSIMIMSI */ |
280 | NOTSUPPORTED, /* GetDateTime */ | 280 | NOTSUPPORTED, /* GetDateTime */ |
281 | NOTSUPPORTED, /* SetDateTime */ | 281 | NOTSUPPORTED, /* SetDateTime */ |
282 | NOTSUPPORTED, /* GetAlarm */ | 282 | NOTSUPPORTED, /* GetAlarm */ |
283 | NOTSUPPORTED, /* SetAlarm */ | 283 | NOTSUPPORTED, /* SetAlarm */ |
284 | NOTSUPPORTED, /* GetLocale */ | 284 | NOTSUPPORTED, /* GetLocale */ |
285 | NOTSUPPORTED, /* SetLocale */ | 285 | NOTSUPPORTED, /* SetLocale */ |
286 | NOTSUPPORTED, /* PressKey */ | 286 | NOTSUPPORTED, /* PressKey */ |
287 | DCT4_Reset, | 287 | DCT4_Reset, |
288 | NOTSUPPORTED, /* ResetPhoneSettings*/ | 288 | NOTSUPPORTED, /* ResetPhoneSettings*/ |
289 | NOTSUPPORTED, /* EnterSecurityCode*/ | 289 | NOTSUPPORTED, /* EnterSecurityCode*/ |
290 | NOTSUPPORTED, /* GetSecurityStatus*/ | 290 | NOTSUPPORTED, /* GetSecurityStatus*/ |
291 | NOTSUPPORTED, /* GetDisplayStatus*/ | 291 | NOTSUPPORTED, /* GetDisplayStatus*/ |
292 | NOTSUPPORTED, /* SetAutoNetworkLogin*/ | 292 | NOTSUPPORTED, /* SetAutoNetworkLogin*/ |
293 | NOTSUPPORTED, /* GetBatteryCharge*/ | 293 | NOTSUPPORTED, /* GetBatteryCharge*/ |
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*/ |
342 | NOTSUPPORTED, /* PlayTone */ | 343 | NOTSUPPORTED, /* PlayTone */ |
343 | NOTSUPPORTED, /* GetWAPBookmark */ | 344 | NOTSUPPORTED, /* GetWAPBookmark */ |
344 | NOTSUPPORTED, /* SetWAPBookmark */ | 345 | NOTSUPPORTED, /* SetWAPBookmark */ |
345 | NOTSUPPORTED, /* DeleteWAPBookmark */ | 346 | NOTSUPPORTED, /* DeleteWAPBookmark */ |
346 | NOTSUPPORTED, /* GetWAPSettings */ | 347 | NOTSUPPORTED, /* GetWAPSettings */ |
347 | NOTSUPPORTED, /* SetWAPSettings */ | 348 | NOTSUPPORTED, /* SetWAPSettings */ |
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,50 +1,53 @@ | |||
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); |
27 | } | 30 | } |
28 | 31 | ||
29 | static GSM_Error N6510_ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) | 32 | static GSM_Error N6510_ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) |
30 | { | 33 | { |
31 | smprintf(s, "Phonebook entry received\n"); | 34 | smprintf(s, "Phonebook entry received\n"); |
32 | switch (msg.Buffer[6]) { | 35 | switch (msg.Buffer[6]) { |
33 | case 0x0f: | 36 | case 0x0f: |
34 | return N71_65_ReplyGetMemoryError(msg.Buffer[10], s); | 37 | return N71_65_ReplyGetMemoryError(msg.Buffer[10], s); |
35 | default: | 38 | default: |
36 | return N71_65_DecodePhonebook(s, s->Phone.Data.Memory, s->Phone.Data.Bitmap, s->Phone.Data.SpeedDial, msg.Buffer+22, msg.Length-22,false); | 39 | return N71_65_DecodePhonebook(s, s->Phone.Data.Memory, s->Phone.Data.Bitmap, s->Phone.Data.SpeedDial, msg.Buffer+22, msg.Length-22,false); |
37 | } | 40 | } |
38 | return ERR_UNKNOWN; | 41 | return ERR_UNKNOWN; |
39 | } | 42 | } |
40 | 43 | ||
41 | static GSM_Error N6510_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry) | 44 | static GSM_Error N6510_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry) |
42 | { | 45 | { |
43 | unsigned char req[] = {N6110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, | 46 | unsigned char req[] = {N6110_FRAME_HEADER, 0x07, 0x01, 0x01, 0x00, 0x01, |
44 | 0xfe, 0x10, /* memory type */ | 47 | 0xfe, 0x10, /* memory type */ |
45 | 0x00, 0x00, 0x00, 0x00, | 48 | 0x00, 0x00, 0x00, 0x00, |
46 | 0x00, 0x01, /* location */ | 49 | 0x00, 0x01, /* location */ |
47 | 0x00, 0x00, 0x01}; | 50 | 0x00, 0x00, 0x01}; |
48 | 51 | ||
49 | req[9] = NOKIA_GetMemoryType(s, entry->MemoryType,N71_65_MEMORY_TYPES); | 52 | req[9] = NOKIA_GetMemoryType(s, entry->MemoryType,N71_65_MEMORY_TYPES); |
50 | if (req[9]==0xff) return ERR_NOTSUPPORTED; | 53 | if (req[9]==0xff) return ERR_NOTSUPPORTED; |
@@ -74,96 +77,98 @@ static GSM_Error N6510_ReplyGetMemoryStatus(GSM_Protocol_Message msg, GSM_StateM | |||
74 | Data->MemoryStatus->MemoryUsed = msg.Buffer[20]*256 + msg.Buffer[21]; | 77 | Data->MemoryStatus->MemoryUsed = msg.Buffer[20]*256 + msg.Buffer[21]; |
75 | smprintf(s, "Used : %i\n",Data->MemoryStatus->MemoryUsed); | 78 | smprintf(s, "Used : %i\n",Data->MemoryStatus->MemoryUsed); |
76 | Data->MemoryStatus->MemoryFree -= Data->MemoryStatus->MemoryUsed; | 79 | Data->MemoryStatus->MemoryFree -= Data->MemoryStatus->MemoryUsed; |
77 | smprintf(s, "Free : %i\n",Data->MemoryStatus->MemoryFree); | 80 | smprintf(s, "Free : %i\n",Data->MemoryStatus->MemoryFree); |
78 | return ERR_NONE; | 81 | return ERR_NONE; |
79 | } | 82 | } |
80 | 83 | ||
81 | static GSM_Error N6510_GetMemoryStatus(GSM_StateMachine *s, GSM_MemoryStatus *Status) | 84 | static GSM_Error N6510_GetMemoryStatus(GSM_StateMachine *s, GSM_MemoryStatus *Status) |
82 | { | 85 | { |
83 | unsigned char req[] = {N6110_FRAME_HEADER, 0x03, 0x02, | 86 | unsigned char req[] = {N6110_FRAME_HEADER, 0x03, 0x02, |
84 | 0x00, /* memory type */ | 87 | 0x00, /* memory type */ |
85 | 0x55, 0x55, 0x55, 0x00}; | 88 | 0x55, 0x55, 0x55, 0x00}; |
86 | 89 | ||
87 | req[5] = NOKIA_GetMemoryType(s, Status->MemoryType,N71_65_MEMORY_TYPES); | 90 | req[5] = NOKIA_GetMemoryType(s, Status->MemoryType,N71_65_MEMORY_TYPES); |
88 | if (req[5]==0xff) return ERR_NOTSUPPORTED; | 91 | if (req[5]==0xff) return ERR_NOTSUPPORTED; |
89 | 92 | ||
90 | s->Phone.Data.MemoryStatus=Status; | 93 | s->Phone.Data.MemoryStatus=Status; |
91 | smprintf(s, "Getting memory status\n"); | 94 | smprintf(s, "Getting memory status\n"); |
92 | return GSM_WaitFor (s, req, 10, 0x03, 4, ID_GetMemoryStatus); | 95 | return GSM_WaitFor (s, req, 10, 0x03, 4, ID_GetMemoryStatus); |
93 | } | 96 | } |
94 | 97 | ||
95 | static GSM_Error N6510_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *s) | 98 | static GSM_Error N6510_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *s) |
96 | { | 99 | { |
97 | int i, current, j; | 100 | int i, current, j; |
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; |
146 | default: | 151 | default: |
147 | smprintf(s, "Unknown SMSC number: %02x\n",msg.Buffer[current+2]); | 152 | smprintf(s, "Unknown SMSC number: %02x\n",msg.Buffer[current+2]); |
148 | return ERR_UNKNOWNRESPONSE; | 153 | return ERR_UNKNOWNRESPONSE; |
149 | } | 154 | } |
150 | break; | 155 | break; |
151 | default: | 156 | default: |
152 | smprintf(s, "Unknown SMSC block: %02x\n",msg.Buffer[current]); | 157 | smprintf(s, "Unknown SMSC block: %02x\n",msg.Buffer[current]); |
153 | return ERR_UNKNOWNRESPONSE; | 158 | return ERR_UNKNOWNRESPONSE; |
154 | } | 159 | } |
155 | current = current + msg.Buffer[current+1]; | 160 | current = current + msg.Buffer[current+1]; |
156 | } | 161 | } |
157 | return ERR_NONE; | 162 | return ERR_NONE; |
158 | } | 163 | } |
159 | 164 | ||
160 | static GSM_Error N6510_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc) | 165 | static GSM_Error N6510_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc) |
161 | { | 166 | { |
162 | unsigned char req[] = {N6110_FRAME_HEADER, 0x14, | 167 | unsigned char req[] = {N6110_FRAME_HEADER, 0x14, |
163 | 0x01, /* location */ | 168 | 0x01, /* location */ |
164 | 0x00}; | 169 | 0x00}; |
165 | 170 | ||
166 | if (smsc->Location==0x00) return ERR_INVALIDLOCATION; | 171 | if (smsc->Location==0x00) return ERR_INVALIDLOCATION; |
167 | 172 | ||
168 | req[4]=smsc->Location; | 173 | req[4]=smsc->Location; |
169 | 174 | ||
@@ -220,97 +225,97 @@ static GSM_Error N6510_SetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc) | |||
220 | req[count++] = 0x02; | 225 | req[count++] = 0x02; |
221 | req[count] = GSM_PackSemiOctetNumber(smsc->Number, req+count+2, false) + 1; | 226 | req[count] = GSM_PackSemiOctetNumber(smsc->Number, req+count+2, false) + 1; |
222 | if (req[count]>18) { | 227 | if (req[count]>18) { |
223 | smprintf(s, "Too long SMSC number in frame\n"); | 228 | smprintf(s, "Too long SMSC number in frame\n"); |
224 | return ERR_UNKNOWN; | 229 | return ERR_UNKNOWN; |
225 | } | 230 | } |
226 | req[count+1] = req[count] - 1; | 231 | req[count+1] = req[count] - 1; |
227 | count += 23; | 232 | count += 23; |
228 | 233 | ||
229 | /* --------------- Default number ------------- */ | 234 | /* --------------- Default number ------------- */ |
230 | /* Block type: number */ | 235 | /* Block type: number */ |
231 | req[count++] = 0x82; | 236 | req[count++] = 0x82; |
232 | /* Offset to next block */ | 237 | /* Offset to next block */ |
233 | req[count++] = 0x14; | 238 | req[count++] = 0x14; |
234 | /* Type of number: default number */ | 239 | /* Type of number: default number */ |
235 | req[count++] = 0x01; | 240 | req[count++] = 0x01; |
236 | req[count] = GSM_PackSemiOctetNumber(smsc->DefaultNumber, req+count+2, true) + 1; | 241 | req[count] = GSM_PackSemiOctetNumber(smsc->DefaultNumber, req+count+2, true) + 1; |
237 | if (req[count]*2>12) { | 242 | if (req[count]*2>12) { |
238 | smprintf(s, "Too long SMSC number in frame\n"); | 243 | smprintf(s, "Too long SMSC number in frame\n"); |
239 | return ERR_UNKNOWN; | 244 | return ERR_UNKNOWN; |
240 | } | 245 | } |
241 | req[count+1] = req[count] - 1; | 246 | req[count+1] = req[count] - 1; |
242 | count += 17; | 247 | count += 17; |
243 | 248 | ||
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)); |
293 | } | 298 | } |
294 | #endif | 299 | #endif |
295 | if (Data->RequestID==ID_GetNetworkInfo) { | 300 | if (Data->RequestID==ID_GetNetworkInfo) { |
296 | Data->NetworkInfo->NetworkName[0] = 0x00; | 301 | Data->NetworkInfo->NetworkName[0] = 0x00; |
297 | Data->NetworkInfo->NetworkName[1] = 0x00; | 302 | Data->NetworkInfo->NetworkName[1] = 0x00; |
298 | Data->NetworkInfo->State = 0; | 303 | Data->NetworkInfo->State = 0; |
299 | switch (msg.Buffer[8]) { | 304 | switch (msg.Buffer[8]) { |
300 | case 0x00: Data->NetworkInfo->State = GSM_HomeNetwork; break; | 305 | case 0x00: Data->NetworkInfo->State = GSM_HomeNetwork; break; |
301 | case 0x01: Data->NetworkInfo->State = GSM_RoamingNetwork;break; | 306 | case 0x01: Data->NetworkInfo->State = GSM_RoamingNetwork;break; |
302 | case 0x04: | 307 | case 0x04: |
303 | case 0x06: | 308 | case 0x06: |
304 | case 0x09: Data->NetworkInfo->State = GSM_NoNetwork; break; | 309 | case 0x09: Data->NetworkInfo->State = GSM_NoNetwork; break; |
305 | } | 310 | } |
306 | if (Data->NetworkInfo->State == GSM_HomeNetwork || Data->NetworkInfo->State == GSM_RoamingNetwork) { | 311 | if (Data->NetworkInfo->State == GSM_HomeNetwork || Data->NetworkInfo->State == GSM_RoamingNetwork) { |
307 | tmp = 10; | 312 | tmp = 10; |
308 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,Data->NetworkInfo->NetworkName,true); | 313 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,Data->NetworkInfo->NetworkName,true); |
309 | sprintf(Data->NetworkInfo->LAC, "%02x%02x", msg.Buffer[current+1], msg.Buffer[current+2]); | 314 | sprintf(Data->NetworkInfo->LAC, "%02x%02x", msg.Buffer[current+1], msg.Buffer[current+2]); |
310 | sprintf(Data->NetworkInfo->CID, "%02x%02x", msg.Buffer[current+5], msg.Buffer[current+6]); | 315 | sprintf(Data->NetworkInfo->CID, "%02x%02x", msg.Buffer[current+5], msg.Buffer[current+6]); |
311 | NOKIA_DecodeNetworkCode(msg.Buffer + (current+7),Data->NetworkInfo->NetworkCode); | 316 | NOKIA_DecodeNetworkCode(msg.Buffer + (current+7),Data->NetworkInfo->NetworkCode); |
312 | } | 317 | } |
313 | } | 318 | } |
314 | return ERR_NONE; | 319 | return ERR_NONE; |
315 | } | 320 | } |
316 | 321 | ||
@@ -940,101 +945,101 @@ static GSM_Error N6510_ReplyGetSignalQuality(GSM_Protocol_Message msg, GSM_State | |||
940 | { | 945 | { |
941 | GSM_Phone_Data *Data = &s->Phone.Data; | 946 | GSM_Phone_Data *Data = &s->Phone.Data; |
942 | 947 | ||
943 | smprintf(s, "Network level received: %i\n",msg.Buffer[8]); | 948 | smprintf(s, "Network level received: %i\n",msg.Buffer[8]); |
944 | Data->SignalQuality->SignalStrength = -1; | 949 | Data->SignalQuality->SignalStrength = -1; |
945 | Data->SignalQuality->SignalPercent = ((int)msg.Buffer[8]); | 950 | Data->SignalQuality->SignalPercent = ((int)msg.Buffer[8]); |
946 | Data->SignalQuality->BitErrorRate = -1; | 951 | Data->SignalQuality->BitErrorRate = -1; |
947 | return ERR_NONE; | 952 | return ERR_NONE; |
948 | } | 953 | } |
949 | 954 | ||
950 | static GSM_Error N6510_GetSignalQuality(GSM_StateMachine *s, GSM_SignalQuality *sig) | 955 | static GSM_Error N6510_GetSignalQuality(GSM_StateMachine *s, GSM_SignalQuality *sig) |
951 | { | 956 | { |
952 | unsigned char req[] = {N6110_FRAME_HEADER, 0x0B, 0x00, 0x02, 0x00, 0x00, 0x00}; | 957 | unsigned char req[] = {N6110_FRAME_HEADER, 0x0B, 0x00, 0x02, 0x00, 0x00, 0x00}; |
953 | 958 | ||
954 | s->Phone.Data.SignalQuality = sig; | 959 | s->Phone.Data.SignalQuality = sig; |
955 | smprintf(s, "Getting network level\n"); | 960 | smprintf(s, "Getting network level\n"); |
956 | return GSM_WaitFor (s, req, 9, 0x0a, 4, ID_GetSignalQuality); | 961 | return GSM_WaitFor (s, req, 9, 0x0a, 4, ID_GetSignalQuality); |
957 | } | 962 | } |
958 | 963 | ||
959 | static GSM_Error N6510_ReplyGetBatteryCharge(GSM_Protocol_Message msg, GSM_StateMachine *s) | 964 | static GSM_Error N6510_ReplyGetBatteryCharge(GSM_Protocol_Message msg, GSM_StateMachine *s) |
960 | { | 965 | { |
961 | GSM_Phone_Data *Data = &s->Phone.Data; | 966 | GSM_Phone_Data *Data = &s->Phone.Data; |
962 | 967 | ||
963 | smprintf(s, "Battery level received: %i\n",msg.Buffer[9]*100/7); | 968 | smprintf(s, "Battery level received: %i\n",msg.Buffer[9]*100/7); |
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; |
1017 | 1022 | ||
1018 | smprintf(s, "Deleting phonebook entry\n"); | 1023 | smprintf(s, "Deleting phonebook entry\n"); |
1019 | return GSM_WaitFor (s, req, 22, 0x03, 4, ID_SetMemory); | 1024 | return GSM_WaitFor (s, req, 22, 0x03, 4, ID_SetMemory); |
1020 | } | 1025 | } |
1021 | 1026 | ||
1022 | static GSM_Error N6510_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry) | 1027 | static GSM_Error N6510_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry) |
1023 | { | 1028 | { |
1024 | int count = 22, blocks; | 1029 | int count = 22, blocks; |
1025 | unsigned char req[500] = { | 1030 | unsigned char req[500] = { |
1026 | N7110_FRAME_HEADER, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x10, | 1031 | N7110_FRAME_HEADER, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x10, |
1027 | 0x02, 0x00, /* memory type */ | 1032 | 0x02, 0x00, /* memory type */ |
1028 | 0x00, 0x00, /* location */ | 1033 | 0x00, 0x00, /* location */ |
1029 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; | 1034 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; |
1030 | 1035 | ||
1031 | if (entry->Location == 0) return ERR_NOTSUPPORTED; | 1036 | if (entry->Location == 0) return ERR_NOTSUPPORTED; |
1032 | 1037 | ||
1033 | req[11] = NOKIA_GetMemoryType(s, entry->MemoryType,N71_65_MEMORY_TYPES); | 1038 | req[11] = NOKIA_GetMemoryType(s, entry->MemoryType,N71_65_MEMORY_TYPES); |
1034 | if (req[11]==0xff) return ERR_NOTSUPPORTED; | 1039 | if (req[11]==0xff) return ERR_NOTSUPPORTED; |
1035 | 1040 | ||
1036 | req[12] = entry->Location / 256; | 1041 | req[12] = entry->Location / 256; |
1037 | req[13] = entry->Location % 256; | 1042 | req[13] = entry->Location % 256; |
1038 | 1043 | ||
1039 | count = count + N71_65_EncodePhonebookFrame(s, req+22, *entry, &blocks, true, IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_VOICETAGS)); | 1044 | count = count + N71_65_EncodePhonebookFrame(s, req+22, *entry, &blocks, true, IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_VOICETAGS)); |
1040 | req[21] = blocks; | 1045 | req[21] = blocks; |
@@ -1720,97 +1725,98 @@ static GSM_Error N6510_ReplyGetSyncMLSettings(GSM_Protocol_Message msg, GSM_Stat | |||
1720 | smprintf(s, "SyncML settings received OK\n"); | 1725 | smprintf(s, "SyncML settings received OK\n"); |
1721 | CopyUnicodeString(Sett->User,msg.Buffer+18); | 1726 | CopyUnicodeString(Sett->User,msg.Buffer+18); |
1722 | CopyUnicodeString(Sett->Password,msg.Buffer+86); | 1727 | CopyUnicodeString(Sett->Password,msg.Buffer+86); |
1723 | CopyUnicodeString(Sett->PhonebookDataBase,msg.Buffer+130); | 1728 | CopyUnicodeString(Sett->PhonebookDataBase,msg.Buffer+130); |
1724 | CopyUnicodeString(Sett->CalendarDataBase,msg.Buffer+234); | 1729 | CopyUnicodeString(Sett->CalendarDataBase,msg.Buffer+234); |
1725 | CopyUnicodeString(Sett->Server,msg.Buffer+338); | 1730 | CopyUnicodeString(Sett->Server,msg.Buffer+338); |
1726 | 1731 | ||
1727 | Sett->SyncPhonebook = false; | 1732 | Sett->SyncPhonebook = false; |
1728 | Sett->SyncCalendar = false; | 1733 | Sett->SyncCalendar = false; |
1729 | if ((msg.Buffer[598] & 0x02)==0x02) Sett->SyncCalendar = true; | 1734 | if ((msg.Buffer[598] & 0x02)==0x02) Sett->SyncCalendar = true; |
1730 | if ((msg.Buffer[598] & 0x01)==0x01) Sett->SyncPhonebook = true; | 1735 | if ((msg.Buffer[598] & 0x01)==0x01) Sett->SyncPhonebook = true; |
1731 | 1736 | ||
1732 | return ERR_NONE; | 1737 | return ERR_NONE; |
1733 | } | 1738 | } |
1734 | 1739 | ||
1735 | static GSM_Error N6510_ReplyGetSyncMLName(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1740 | static GSM_Error N6510_ReplyGetSyncMLName(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1736 | { | 1741 | { |
1737 | GSM_SyncMLSettings *Sett = s->Phone.Data.SyncMLSettings; | 1742 | GSM_SyncMLSettings *Sett = s->Phone.Data.SyncMLSettings; |
1738 | 1743 | ||
1739 | smprintf(s, "SyncML names received OK\n"); | 1744 | smprintf(s, "SyncML names received OK\n"); |
1740 | 1745 | ||
1741 | CopyUnicodeString(Sett->Name,msg.Buffer+18); | 1746 | CopyUnicodeString(Sett->Name,msg.Buffer+18); |
1742 | 1747 | ||
1743 | return ERR_NONE; | 1748 | return ERR_NONE; |
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]) { |
1793 | case 0x3B: | 1799 | case 0x3B: |
1794 | smprintf(s, "Chat settings received OK\n"); | 1800 | smprintf(s, "Chat settings received OK\n"); |
1795 | memcpy(Sett->Name,msg.Buffer+20,msg.Buffer[12]*2); | 1801 | memcpy(Sett->Name,msg.Buffer+20,msg.Buffer[12]*2); |
1796 | Sett->Name[msg.Buffer[12]*2] = 0; | 1802 | Sett->Name[msg.Buffer[12]*2] = 0; |
1797 | Sett->Name[msg.Buffer[12]*2+1] = 0; | 1803 | Sett->Name[msg.Buffer[12]*2+1] = 0; |
1798 | memcpy(Sett->HomePage,msg.Buffer+20+msg.Buffer[12]*2,msg.Buffer[15]*2); | 1804 | memcpy(Sett->HomePage,msg.Buffer+20+msg.Buffer[12]*2,msg.Buffer[15]*2); |
1799 | Sett->HomePage[msg.Buffer[15]*2] = 0; | 1805 | Sett->HomePage[msg.Buffer[15]*2] = 0; |
1800 | Sett->HomePage[msg.Buffer[15]*2+1] = 0; | 1806 | Sett->HomePage[msg.Buffer[15]*2+1] = 0; |
1801 | i = msg.Buffer[12]*2 + msg.Buffer[15]*2 + 29; | 1807 | i = msg.Buffer[12]*2 + msg.Buffer[15]*2 + 29; |
1802 | memcpy(Sett->User,msg.Buffer+i+3,msg.Buffer[i]*2); | 1808 | memcpy(Sett->User,msg.Buffer+i+3,msg.Buffer[i]*2); |
1803 | Sett->User[msg.Buffer[i]*2] = 0; | 1809 | Sett->User[msg.Buffer[i]*2] = 0; |
1804 | Sett->User[msg.Buffer[i]*2+1] = 0; | 1810 | Sett->User[msg.Buffer[i]*2+1] = 0; |
1805 | memcpy(Sett->Password,msg.Buffer+i+3+msg.Buffer[i]*2,msg.Buffer[i+1]*2); | 1811 | memcpy(Sett->Password,msg.Buffer+i+3+msg.Buffer[i]*2,msg.Buffer[i+1]*2); |
1806 | Sett->Password[msg.Buffer[i+1]*2] = 0; | 1812 | Sett->Password[msg.Buffer[i+1]*2] = 0; |
1807 | Sett->Password[msg.Buffer[i+1]*2+1] = 0; | 1813 | Sett->Password[msg.Buffer[i+1]*2+1] = 0; |
1808 | return ERR_NONE; | 1814 | return ERR_NONE; |
1809 | case 0x3C: | 1815 | case 0x3C: |
1810 | smprintf(s, "Empty chat settings received\n"); | 1816 | smprintf(s, "Empty chat settings received\n"); |
1811 | return ERR_NONE; | 1817 | return ERR_NONE; |
1812 | } | 1818 | } |
1813 | return ERR_UNKNOWNRESPONSE; | 1819 | return ERR_UNKNOWNRESPONSE; |
1814 | } | 1820 | } |
1815 | 1821 | ||
1816 | static GSM_Error N6510_GetChatSettings(GSM_StateMachine *s, GSM_ChatSettings *settings) | 1822 | static GSM_Error N6510_GetChatSettings(GSM_StateMachine *s, GSM_ChatSettings *settings) |
@@ -2238,97 +2244,97 @@ static GSM_Error N6510_GetSMSStatus(GSM_StateMachine *s, GSM_SMSMemoryStatus *st | |||
2238 | 2244 | ||
2239 | static GSM_Error N6510_ReplyDeleteSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s) | 2245 | static GSM_Error N6510_ReplyDeleteSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s) |
2240 | { | 2246 | { |
2241 | switch (msg.Buffer[3]) { | 2247 | switch (msg.Buffer[3]) { |
2242 | case 0x05: | 2248 | case 0x05: |
2243 | smprintf(s, "SMS deleted OK\n"); | 2249 | smprintf(s, "SMS deleted OK\n"); |
2244 | return ERR_NONE; | 2250 | return ERR_NONE; |
2245 | case 0x06: | 2251 | case 0x06: |
2246 | switch (msg.Buffer[4]) { | 2252 | switch (msg.Buffer[4]) { |
2247 | case 0x02: | 2253 | case 0x02: |
2248 | smprintf(s, "Invalid location\n"); | 2254 | smprintf(s, "Invalid location\n"); |
2249 | return ERR_INVALIDLOCATION; | 2255 | return ERR_INVALIDLOCATION; |
2250 | default: | 2256 | default: |
2251 | smprintf(s, "Unknown error: %02x\n",msg.Buffer[4]); | 2257 | smprintf(s, "Unknown error: %02x\n",msg.Buffer[4]); |
2252 | return ERR_UNKNOWNRESPONSE; | 2258 | return ERR_UNKNOWNRESPONSE; |
2253 | } | 2259 | } |
2254 | } | 2260 | } |
2255 | return ERR_UNKNOWNRESPONSE; | 2261 | return ERR_UNKNOWNRESPONSE; |
2256 | } | 2262 | } |
2257 | 2263 | ||
2258 | static GSM_Error N6510_DeleteSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms) | 2264 | static GSM_Error N6510_DeleteSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms) |
2259 | { | 2265 | { |
2260 | unsigned char folderid; | 2266 | unsigned char folderid; |
2261 | int location; | 2267 | int location; |
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); |
2311 | } | 2317 | } |
2312 | 2318 | ||
2313 | static GSM_Error N6510_ReplyGetSecurityStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) | 2319 | static GSM_Error N6510_ReplyGetSecurityStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) |
2314 | { | 2320 | { |
2315 | GSM_Phone_Data *Data = &s->Phone.Data; | 2321 | GSM_Phone_Data *Data = &s->Phone.Data; |
2316 | 2322 | ||
2317 | smprintf(s, "Security Code status received: "); | 2323 | smprintf(s, "Security Code status received: "); |
2318 | switch (msg.Buffer[4]) { | 2324 | switch (msg.Buffer[4]) { |
2319 | case 0x01 : smprintf(s, "waiting for Security Code.\n"); *Data->SecurityStatus = SEC_SecurityCode;break; | 2325 | case 0x01 : smprintf(s, "waiting for Security Code.\n"); *Data->SecurityStatus = SEC_SecurityCode;break; |
2320 | case 0x07 : | 2326 | case 0x07 : |
2321 | case 0x02 : smprintf(s, "waiting for PIN.\n"); *Data->SecurityStatus = SEC_Pin; break; | 2327 | case 0x02 : smprintf(s, "waiting for PIN.\n"); *Data->SecurityStatus = SEC_Pin; break; |
2322 | case 0x03 : smprintf(s, "waiting for PUK.\n"); *Data->SecurityStatus = SEC_Puk; break; | 2328 | case 0x03 : smprintf(s, "waiting for PUK.\n"); *Data->SecurityStatus = SEC_Puk; break; |
2323 | case 0x05 : smprintf(s, "PIN ok, SIM ok\n"); *Data->SecurityStatus = SEC_None; break; | 2329 | case 0x05 : smprintf(s, "PIN ok, SIM ok\n"); *Data->SecurityStatus = SEC_None; break; |
2324 | case 0x06 : smprintf(s, "No input status\n"); *Data->SecurityStatus = SEC_None; break; | 2330 | case 0x06 : smprintf(s, "No input status\n"); *Data->SecurityStatus = SEC_None; break; |
2325 | case 0x16 : smprintf(s, "No SIM card\n"); *Data->SecurityStatus = SEC_None; break; | 2331 | case 0x16 : smprintf(s, "No SIM card\n"); *Data->SecurityStatus = SEC_None; break; |
2326 | case 0x1A : smprintf(s, "SIM card rejected!\n"); *Data->SecurityStatus = SEC_None; break; | 2332 | case 0x1A : smprintf(s, "SIM card rejected!\n"); *Data->SecurityStatus = SEC_None; break; |
2327 | default : smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); | 2333 | default : smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); |
2328 | return ERR_UNKNOWNRESPONSE; | 2334 | return ERR_UNKNOWNRESPONSE; |
2329 | } | 2335 | } |
2330 | return ERR_NONE; | 2336 | return ERR_NONE; |
2331 | } | 2337 | } |
2332 | 2338 | ||
2333 | static GSM_Error N6510_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status) | 2339 | static GSM_Error N6510_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status) |
2334 | { | 2340 | { |
@@ -2725,96 +2731,97 @@ static GSM_Error N6510_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachi | |||
2725 | msg.Buffer[msg.Buffer[7]*2+12] == 'h' && | 2731 | msg.Buffer[msg.Buffer[7]*2+12] == 'h' && |
2726 | msg.Buffer[msg.Buffer[7]*2+13] == 'd') { | 2732 | msg.Buffer[msg.Buffer[7]*2+13] == 'd') { |
2727 | smprintf(s,"MIDI\n"); | 2733 | smprintf(s,"MIDI\n"); |
2728 | tmp = msg.Buffer[7]*2+10; | 2734 | tmp = msg.Buffer[7]*2+10; |
2729 | i = msg.Length - 2; /* ?????? */ | 2735 | i = msg.Length - 2; /* ?????? */ |
2730 | Data->Ringtone->Format = RING_MIDI; | 2736 | Data->Ringtone->Format = RING_MIDI; |
2731 | } else { | 2737 | } else { |
2732 | /* Looking for end */ | 2738 | /* Looking for end */ |
2733 | i=8+msg.Buffer[7]*2+3; | 2739 | i=8+msg.Buffer[7]*2+3; |
2734 | tmp = i; | 2740 | tmp = i; |
2735 | while (true) { | 2741 | while (true) { |
2736 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { | 2742 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { |
2737 | i=i+2; break; | 2743 | i=i+2; break; |
2738 | } | 2744 | } |
2739 | i++; | 2745 | i++; |
2740 | if (i==msg.Length) return ERR_EMPTY; | 2746 | if (i==msg.Length) return ERR_EMPTY; |
2741 | } | 2747 | } |
2742 | } | 2748 | } |
2743 | /* Copying frame */ | 2749 | /* Copying frame */ |
2744 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+tmp,i-tmp); | 2750 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+tmp,i-tmp); |
2745 | Data->Ringtone->NokiaBinary.Length=i-tmp; | 2751 | Data->Ringtone->NokiaBinary.Length=i-tmp; |
2746 | return ERR_NONE; | 2752 | return ERR_NONE; |
2747 | } | 2753 | } |
2748 | 2754 | ||
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[] = { |
2797 | // 0x00,0x06,0x01,0x14,0x05,0x04, | 2804 | // 0x00,0x06,0x01,0x14,0x05,0x04, |
2798 | // 0x00,0x00,0x00,0x01,0x03,0x08, | 2805 | // 0x00,0x00,0x00,0x01,0x03,0x08, |
2799 | // 0x00,0x00,0x00,0x00,0x00,0x00}; | 2806 | // 0x00,0x00,0x00,0x00,0x00,0x00}; |
2800 | 2807 | ||
2801 | if (start) { | 2808 | if (start) { |
2802 | smprintf(s, "Enabling sound - part 1\n"); | 2809 | smprintf(s, "Enabling sound - part 1\n"); |
2803 | error=GSM_WaitFor (s, reqStart, 6, 0x0b, 4, ID_PlayTone); | 2810 | error=GSM_WaitFor (s, reqStart, 6, 0x0b, 4, ID_PlayTone); |
2804 | if (error!=ERR_NONE) return error; | 2811 | if (error!=ERR_NONE) return error; |
2805 | smprintf(s, "Enabling sound - part 2 (disabling sound command)\n"); | 2812 | smprintf(s, "Enabling sound - part 2 (disabling sound command)\n"); |
2806 | error=GSM_WaitFor (s, reqOff, 18, 0x0b, 4, ID_PlayTone); | 2813 | error=GSM_WaitFor (s, reqOff, 18, 0x0b, 4, ID_PlayTone); |
2807 | if (error!=ERR_NONE) return error; | 2814 | if (error!=ERR_NONE) return error; |
2808 | } | 2815 | } |
2809 | 2816 | ||
2810 | /* For Herz==255*255 we have silent */ | 2817 | /* For Herz==255*255 we have silent */ |
2811 | if (Herz!=255*255) { | 2818 | if (Herz!=255*255) { |
2812 | reqPlay[23] = Herz%256; | 2819 | reqPlay[23] = Herz%256; |
2813 | reqPlay[22] = Herz/256; | 2820 | reqPlay[22] = Herz/256; |
2814 | reqPlay[31] = Volume; | 2821 | reqPlay[31] = Volume; |
2815 | smprintf(s, "Playing sound\n"); | 2822 | smprintf(s, "Playing sound\n"); |
2816 | return GSM_WaitFor (s, reqPlay, 34, 0x0b, 4, ID_PlayTone); | 2823 | return GSM_WaitFor (s, reqPlay, 34, 0x0b, 4, ID_PlayTone); |
2817 | } else { | 2824 | } else { |
2818 | reqPlay[23] = 0; | 2825 | reqPlay[23] = 0; |
2819 | reqPlay[22] = 0; | 2826 | reqPlay[22] = 0; |
2820 | reqPlay[31] = 0; | 2827 | reqPlay[31] = 0; |
@@ -2941,96 +2948,99 @@ static GSM_Error N6510_ReplyGetProfile(GSM_Protocol_Message msg, GSM_StateMachin | |||
2941 | case 0x05:/* SMS tone */ | 2948 | case 0x05:/* SMS tone */ |
2942 | j = Data->Profile->FeaturesNumber; | 2949 | j = Data->Profile->FeaturesNumber; |
2943 | NOKIA_FindFeatureValue(s, Profile71_65,blockstart[1],blockstart[7],Data,false); | 2950 | NOKIA_FindFeatureValue(s, Profile71_65,blockstart[1],blockstart[7],Data,false); |
2944 | if (j == Data->Profile->FeaturesNumber) { | 2951 | if (j == Data->Profile->FeaturesNumber) { |
2945 | Data->Profile->FeatureID[Data->Profile->FeaturesNumber] = Profile_MessageTone; | 2952 | Data->Profile->FeatureID[Data->Profile->FeaturesNumber] = Profile_MessageTone; |
2946 | Data->Profile->FeatureValue[Data->Profile->FeaturesNumber] = PROFILE_MESSAGE_PERSONAL; | 2953 | Data->Profile->FeatureValue[Data->Profile->FeaturesNumber] = PROFILE_MESSAGE_PERSONAL; |
2947 | Data->Profile->FeaturesNumber++; | 2954 | Data->Profile->FeaturesNumber++; |
2948 | Data->Profile->FeatureID[Data->Profile->FeaturesNumber] = Profile_MessageToneID; | 2955 | Data->Profile->FeatureID[Data->Profile->FeaturesNumber] = Profile_MessageToneID; |
2949 | Data->Profile->FeatureValue[Data->Profile->FeaturesNumber] = blockstart[7]; | 2956 | Data->Profile->FeatureValue[Data->Profile->FeaturesNumber] = blockstart[7]; |
2950 | Data->Profile->FeaturesNumber++; | 2957 | Data->Profile->FeaturesNumber++; |
2951 | } | 2958 | } |
2952 | break; | 2959 | break; |
2953 | case 0x08:/* Caller groups */ | 2960 | case 0x08:/* Caller groups */ |
2954 | NOKIA_FindFeatureValue(s, Profile71_65,blockstart[1],blockstart[7],Data,true); | 2961 | NOKIA_FindFeatureValue(s, Profile71_65,blockstart[1],blockstart[7],Data,true); |
2955 | break; | 2962 | break; |
2956 | case 0x0c : | 2963 | case 0x0c : |
2957 | CopyUnicodeString(Data->Profile->Name,blockstart + 7); | 2964 | CopyUnicodeString(Data->Profile->Name,blockstart + 7); |
2958 | smprintf(s, "profile Name: \"%s\"\n", DecodeUnicodeString(Data->Profile->Name)); | 2965 | smprintf(s, "profile Name: \"%s\"\n", DecodeUnicodeString(Data->Profile->Name)); |
2959 | Data->Profile->DefaultName = false; | 2966 | Data->Profile->DefaultName = false; |
2960 | break; | 2967 | break; |
2961 | default: | 2968 | default: |
2962 | NOKIA_FindFeatureValue(s, Profile71_65,blockstart[1],blockstart[7],Data,false); | 2969 | NOKIA_FindFeatureValue(s, Profile71_65,blockstart[1],blockstart[7],Data,false); |
2963 | } | 2970 | } |
2964 | blockstart = blockstart + blockstart[0]; | 2971 | blockstart = blockstart + blockstart[0]; |
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"); |
3013 | error = GSM_WaitFor (s, req, length, 0x39, 4, ID_GetProfile); | 3023 | error = GSM_WaitFor (s, req, length, 0x39, 4, ID_GetProfile); |
3014 | if (error != ERR_NONE) return error; | 3024 | if (error != ERR_NONE) return error; |
3015 | 3025 | ||
3016 | smprintf(s, "Checking, which profile is active\n"); | 3026 | smprintf(s, "Checking, which profile is active\n"); |
3017 | return GSM_WaitFor (s, reqActive, 4, 0x39, 4, ID_GetProfile); | 3027 | return GSM_WaitFor (s, reqActive, 4, 0x39, 4, ID_GetProfile); |
3018 | } | 3028 | } |
3019 | 3029 | ||
3020 | static GSM_Error N6510_ReplySetProfile(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3030 | static GSM_Error N6510_ReplySetProfile(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3021 | { | 3031 | { |
3022 | unsigned char *blockstart; | 3032 | unsigned char *blockstart; |
3023 | int i; | 3033 | int i; |
3024 | 3034 | ||
3025 | smprintf(s, "Response to profile writing received!\n"); | 3035 | smprintf(s, "Response to profile writing received!\n"); |
3026 | 3036 | ||
3027 | blockstart = msg.Buffer + 6; | 3037 | blockstart = msg.Buffer + 6; |
3028 | for (i = 0; i < msg.Buffer[5]; i++) { | 3038 | for (i = 0; i < msg.Buffer[5]; i++) { |
3029 | switch (blockstart[2]) { | 3039 | switch (blockstart[2]) { |
3030 | case 0x00: smprintf(s, "keypad tone level"); break; | 3040 | case 0x00: smprintf(s, "keypad tone level"); break; |
3031 | case 0x02: smprintf(s, "call alert"); break; | 3041 | case 0x02: smprintf(s, "call alert"); break; |
3032 | case 0x03: smprintf(s, "ringtone"); break; | 3042 | case 0x03: smprintf(s, "ringtone"); break; |
3033 | case 0x04: smprintf(s, "ringtone volume"); break; | 3043 | case 0x04: smprintf(s, "ringtone volume"); break; |
3034 | case 0x05: smprintf(s, "SMS tone"); break; | 3044 | case 0x05: smprintf(s, "SMS tone"); break; |
3035 | case 0x06: smprintf(s, "vibration"); break; | 3045 | case 0x06: smprintf(s, "vibration"); break; |
3036 | case 0x07: smprintf(s, "warning tone level"); break; | 3046 | case 0x07: smprintf(s, "warning tone level"); break; |
@@ -3070,194 +3080,224 @@ static GSM_Error N6510_SetProfile(GSM_StateMachine *s, GSM_Profile *Profile) | |||
3070 | Value = Profile->FeatureValue[i]; | 3080 | Value = Profile->FeatureValue[i]; |
3071 | found = true; | 3081 | found = true; |
3072 | break; | 3082 | break; |
3073 | default: | 3083 | default: |
3074 | found=NOKIA_FindPhoneFeatureValue( | 3084 | found=NOKIA_FindPhoneFeatureValue( |
3075 | s, | 3085 | s, |
3076 | Profile71_65, | 3086 | Profile71_65, |
3077 | Profile->FeatureID[i],Profile->FeatureValue[i], | 3087 | Profile->FeatureID[i],Profile->FeatureValue[i], |
3078 | &ID,&Value); | 3088 | &ID,&Value); |
3079 | } | 3089 | } |
3080 | if (found) { | 3090 | if (found) { |
3081 | req[length] = 0x09; | 3091 | req[length] = 0x09; |
3082 | req[length + 1] = ID; | 3092 | req[length + 1] = ID; |
3083 | req[length + 2] = Profile->Location; | 3093 | req[length + 2] = Profile->Location; |
3084 | memcpy(req + length + 4, "\x00\x00\x01", 3); | 3094 | memcpy(req + length + 4, "\x00\x00\x01", 3); |
3085 | req[length + 8] = 0x03; | 3095 | req[length + 8] = 0x03; |
3086 | req[length + 3] = req[length + 7] = Value; | 3096 | req[length + 3] = req[length + 7] = Value; |
3087 | blocks++; | 3097 | blocks++; |
3088 | length += 9; | 3098 | length += 9; |
3089 | } | 3099 | } |
3090 | } | 3100 | } |
3091 | 3101 | ||
3092 | smprintf(s, "Setting profile\n"); | 3102 | smprintf(s, "Setting profile\n"); |
3093 | return GSM_WaitFor (s, req, length, 0x39, 4, ID_SetProfile); | 3103 | return GSM_WaitFor (s, req, length, 0x39, 4, ID_SetProfile); |
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; |
3240 | case 0x08: smprintf(s,"Memo\n"); entry->Type = GSM_CAL_MEMO; break; | 3280 | case 0x08: smprintf(s,"Memo\n"); entry->Type = GSM_CAL_MEMO; break; |
3241 | default : smprintf(s,"unknown\n"); | 3281 | default : smprintf(s,"unknown\n"); |
3242 | } | 3282 | } |
3243 | 3283 | ||
3244 | smprintf(s,"StartTime: %04i-%02i-%02i %02i:%02i\n", | 3284 | smprintf(s,"StartTime: %04i-%02i-%02i %02i:%02i\n", |
3245 | msg.Buffer[28]*256+msg.Buffer[29], | 3285 | msg.Buffer[28]*256+msg.Buffer[29], |
3246 | msg.Buffer[30],msg.Buffer[31],msg.Buffer[32], | 3286 | msg.Buffer[30],msg.Buffer[31],msg.Buffer[32], |
3247 | msg.Buffer[33]); | 3287 | msg.Buffer[33]); |
3248 | Date.Year = msg.Buffer[28]*256+msg.Buffer[29]; | 3288 | Date.Year = msg.Buffer[28]*256+msg.Buffer[29]; |
3249 | if (entry->Type == GSM_CAL_BIRTHDAY) { | 3289 | if (entry->Type == GSM_CAL_BIRTHDAY) { |
3250 | Date.Year = entry->Entries[0].Date.Year; | 3290 | Date.Year = entry->Entries[0].Date.Year; |
3251 | smprintf(s,"%i\n",Date.Year); | 3291 | smprintf(s,"%i\n",Date.Year); |
3252 | } | 3292 | } |
3253 | Date.Month = msg.Buffer[30]; | 3293 | Date.Month = msg.Buffer[30]; |
3254 | Date.Day = msg.Buffer[31]; | 3294 | Date.Day = msg.Buffer[31]; |
3255 | Date.Hour = msg.Buffer[32]; | 3295 | Date.Hour = msg.Buffer[32]; |
3256 | Date.Minute = msg.Buffer[33]; | 3296 | Date.Minute = msg.Buffer[33]; |
3257 | /* Garbage seen with 3510i 3.51 */ | 3297 | /* Garbage seen with 3510i 3.51 */ |
3258 | if (Date.Month == 0 && Date.Day == 0 && Date.Hour == 0 && Date.Minute == 0) return ERR_EMPTY; | 3298 | if (Date.Month == 0 && Date.Day == 0 && Date.Hour == 0 && Date.Minute == 0) return ERR_EMPTY; |
3259 | Date.Second= 0; | 3299 | Date.Second= 0; |
3260 | entry->Entries[0].EntryType = CAL_START_DATETIME; | 3300 | entry->Entries[0].EntryType = CAL_START_DATETIME; |
3261 | memcpy(&entry->Entries[0].Date,&Date,sizeof(GSM_DateTime)); | 3301 | memcpy(&entry->Entries[0].Date,&Date,sizeof(GSM_DateTime)); |
3262 | entry->EntriesNum++; | 3302 | entry->EntriesNum++; |
3263 | 3303 | ||
@@ -3305,241 +3345,247 @@ GSM_Error N6510_ReplyGetCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s) | |||
3305 | entry->Entries[entry->EntriesNum].Date.Year, entry->Entries[entry->EntriesNum].Date.Hour, | 3345 | entry->Entries[entry->EntriesNum].Date.Year, entry->Entries[entry->EntriesNum].Date.Hour, |
3306 | entry->Entries[entry->EntriesNum].Date.Minute,entry->Entries[entry->EntriesNum].Date.Second); | 3346 | entry->Entries[entry->EntriesNum].Date.Minute,entry->Entries[entry->EntriesNum].Date.Second); |
3307 | 3347 | ||
3308 | entry->Entries[entry->EntriesNum].EntryType = CAL_ALARM_DATETIME; | 3348 | entry->Entries[entry->EntriesNum].EntryType = CAL_ALARM_DATETIME; |
3309 | if (msg.Buffer[22]==0x00 && msg.Buffer[23]==0x00 && | 3349 | if (msg.Buffer[22]==0x00 && msg.Buffer[23]==0x00 && |
3310 | msg.Buffer[24]==0x00 && msg.Buffer[25]==0x00) | 3350 | msg.Buffer[24]==0x00 && msg.Buffer[25]==0x00) |
3311 | { | 3351 | { |
3312 | entry->Entries[entry->EntriesNum].EntryType = CAL_SILENT_ALARM_DATETIME; | 3352 | entry->Entries[entry->EntriesNum].EntryType = CAL_SILENT_ALARM_DATETIME; |
3313 | smprintf(s, "Alarm type : Silent\n"); | 3353 | smprintf(s, "Alarm type : Silent\n"); |
3314 | } | 3354 | } |
3315 | entry->EntriesNum++; | 3355 | entry->EntriesNum++; |
3316 | } | 3356 | } |
3317 | 3357 | ||
3318 | N71_65_GetCalendarRecurrance(s, msg.Buffer+40, entry); | 3358 | N71_65_GetCalendarRecurrance(s, msg.Buffer+40, entry); |
3319 | 3359 | ||
3320 | if (entry->Type == GSM_CAL_BIRTHDAY) { | 3360 | if (entry->Type == GSM_CAL_BIRTHDAY) { |
3321 | if (msg.Buffer[42] == 0xff && msg.Buffer[43] == 0xff) { | 3361 | if (msg.Buffer[42] == 0xff && msg.Buffer[43] == 0xff) { |
3322 | entry->Entries[0].Date.Year = 0; | 3362 | entry->Entries[0].Date.Year = 0; |
3323 | } else { | 3363 | } else { |
3324 | entry->Entries[0].Date.Year = msg.Buffer[42]*256+msg.Buffer[43]; | 3364 | entry->Entries[0].Date.Year = msg.Buffer[42]*256+msg.Buffer[43]; |
3325 | } | 3365 | } |
3326 | } | 3366 | } |
3327 | 3367 | ||
3328 | memcpy(entry->Entries[entry->EntriesNum].Text, msg.Buffer+54, msg.Buffer[51]*2); | 3368 | memcpy(entry->Entries[entry->EntriesNum].Text, msg.Buffer+54, msg.Buffer[51]*2); |
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 | { |
3422 | switch (msg.Buffer[3]) { | 3468 | switch (msg.Buffer[3]) { |
3423 | case 0x3B: | 3469 | case 0x3B: |
3424 | /* Old method 1 for accessing calendar */ | 3470 | /* Old method 1 for accessing calendar */ |
3425 | return N71_65_ReplyGetCalendarInfo1(msg, s, &s->Phone.Data.Priv.N6510.LastCalendar); | 3471 | return N71_65_ReplyGetCalendarInfo1(msg, s, &s->Phone.Data.Priv.N6510.LastCalendar); |
3426 | case 0x9F: | 3472 | case 0x9F: |
3427 | smprintf(s, "Info with calendar notes locations received method 3\n"); | 3473 | smprintf(s, "Info with calendar notes locations received method 3\n"); |
3428 | return N6510_ReplyGetCalendarInfo3(msg, s, &s->Phone.Data.Priv.N6510.LastCalendar); | 3474 | return N6510_ReplyGetCalendarInfo3(msg, s, &s->Phone.Data.Priv.N6510.LastCalendar); |
3429 | } | 3475 | } |
3430 | return ERR_UNKNOWNRESPONSE; | 3476 | return ERR_UNKNOWNRESPONSE; |
3431 | } | 3477 | } |
3432 | 3478 | ||
3433 | /* method 3 */ | 3479 | /* method 3 */ |
3434 | GSM_Error N6510_ReplyGetCalendarNotePos3(GSM_Protocol_Message msg, GSM_StateMachine *s,int *FirstCalendarPos) | 3480 | GSM_Error N6510_ReplyGetCalendarNotePos3(GSM_Protocol_Message msg, GSM_StateMachine *s,int *FirstCalendarPos) |
3435 | { | 3481 | { |
3436 | smprintf(s, "First calendar location: %i\n",msg.Buffer[8]*256+msg.Buffer[9]); | 3482 | smprintf(s, "First calendar location: %i\n",msg.Buffer[8]*256+msg.Buffer[9]); |
3437 | *FirstCalendarPos = msg.Buffer[8]*256+msg.Buffer[9]; | 3483 | *FirstCalendarPos = msg.Buffer[8]*256+msg.Buffer[9]; |
3438 | return ERR_NONE; | 3484 | return ERR_NONE; |
3439 | } | 3485 | } |
3440 | 3486 | ||
3441 | /* method 3 */ | 3487 | /* method 3 */ |
3442 | static GSM_Error N6510_GetCalendarNotePos3(GSM_StateMachine *s) | 3488 | static GSM_Error N6510_GetCalendarNotePos3(GSM_StateMachine *s) |
3443 | { | 3489 | { |
3444 | unsigned char req[] = {N6110_FRAME_HEADER, 0x95, 0x00}; | 3490 | unsigned char req[] = {N6110_FRAME_HEADER, 0x95, 0x00}; |
3445 | 3491 | ||
3446 | smprintf(s, "Getting first free calendar note location\n"); | 3492 | smprintf(s, "Getting first free calendar note location\n"); |
3447 | return GSM_WaitFor (s, req, 5, 0x13, 4, ID_GetCalendarNotePos); | 3493 | return GSM_WaitFor (s, req, 5, 0x13, 4, ID_GetCalendarNotePos); |
3448 | } | 3494 | } |
3449 | 3495 | ||
3450 | static GSM_Error N6510_ReplyGetCalendarNotePos(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3496 | static GSM_Error N6510_ReplyGetCalendarNotePos(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3451 | { | 3497 | { |
3452 | switch (msg.Buffer[3]) { | 3498 | switch (msg.Buffer[3]) { |
3453 | case 0x32: | 3499 | case 0x32: |
3454 | /* Old method 1 for accessing calendar */ | 3500 | /* Old method 1 for accessing calendar */ |
3455 | return N71_65_ReplyGetCalendarNotePos1(msg, s,&s->Phone.Data.Priv.N6510.FirstCalendarPos); | 3501 | return N71_65_ReplyGetCalendarNotePos1(msg, s,&s->Phone.Data.Priv.N6510.FirstCalendarPos); |
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++) { |
3522 | if (Priv->CalendarIconsTypes[j] == Entry->Type) { | 3568 | if (Priv->CalendarIconsTypes[j] == Entry->Type) { |
3523 | *ID = Priv->CalendarIcons[j]; | 3569 | *ID = Priv->CalendarIcons[j]; |
3524 | return ERR_NONE; | 3570 | return ERR_NONE; |
3525 | } | 3571 | } |
3526 | } | 3572 | } |
3527 | return ERR_UNKNOWN; | 3573 | return ERR_UNKNOWN; |
3528 | } | 3574 | } |
3529 | } | 3575 | } |
3530 | 3576 | ||
3531 | return ERR_UNKNOWN; | 3577 | return ERR_UNKNOWN; |
3532 | } | 3578 | } |
3533 | 3579 | ||
3534 | /* method 3 */ | 3580 | /* method 3 */ |
3535 | static GSM_Error N6510_ReplyAddCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3581 | static GSM_Error N6510_ReplyAddCalendar3(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3536 | { | 3582 | { |
3537 | smprintf(s, "Calendar note added\n"); | 3583 | smprintf(s, "Calendar note added\n"); |
3538 | return ERR_NONE; | 3584 | return ERR_NONE; |
3539 | } | 3585 | } |
3540 | 3586 | ||
3541 | /* method 3 */ | 3587 | /* method 3 */ |
3542 | GSM_Error N6510_AddCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, int *FirstCalendarPos) | 3588 | GSM_Error N6510_AddCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, int *FirstCalendarPos) |
3543 | { | 3589 | { |
3544 | GSM_CalendarNoteTypeNoteType, OldNoteType; | 3590 | GSM_CalendarNoteTypeNoteType, OldNoteType; |
3545 | time_t t_time1,t_time2; | 3591 | time_t t_time1,t_time2; |
@@ -3692,97 +3738,97 @@ GSM_Error N6510_AddCalendar3(GSM_StateMachine *s, GSM_CalendarEntry *Note, int * | |||
3692 | req[count++] = 0x00; | 3738 | req[count++] = 0x00; |
3693 | 3739 | ||
3694 | smprintf(s, "Writing calendar note method 3\n"); | 3740 | smprintf(s, "Writing calendar note method 3\n"); |
3695 | return GSM_WaitFor (s, req, count, 0x13, 4, ID_SetCalendarNote); | 3741 | return GSM_WaitFor (s, req, count, 0x13, 4, ID_SetCalendarNote); |
3696 | } | 3742 | } |
3697 | 3743 | ||
3698 | static GSM_Error N6510_GetNextCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start) | 3744 | static GSM_Error N6510_GetNextCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start) |
3699 | { | 3745 | { |
3700 | #ifdef GSM_FORCE_DCT4_CALENDAR_6210 | 3746 | #ifdef GSM_FORCE_DCT4_CALENDAR_6210 |
3701 | /* Method 1. Some features missed. Not working with some notes in 3510 */ | 3747 | /* Method 1. Some features missed. Not working with some notes in 3510 */ |
3702 | return N71_65_GetNextCalendar1(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendar,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); | 3748 | return N71_65_GetNextCalendar1(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendar,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); |
3703 | #endif | 3749 | #endif |
3704 | 3750 | ||
3705 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { | 3751 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_CAL62)) { |
3706 | /* Method 1. Some features missed. Not working with some notes in 3510 */ | 3752 | /* Method 1. Some features missed. Not working with some notes in 3510 */ |
3707 | return N71_65_GetNextCalendar1(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendar,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); | 3753 | return N71_65_GetNextCalendar1(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendar,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); |
3708 | 3754 | ||
3709 | /* Method 2. In known phones texts of notes cut to 50 chars. Some features missed */ | 3755 | /* Method 2. In known phones texts of notes cut to 50 chars. Some features missed */ |
3710 | // return N71_65_GetNextCalendar2(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); | 3756 | // return N71_65_GetNextCalendar2(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); |
3711 | } else { | 3757 | } else { |
3712 | /* Method 3. All DCT4 features supported. Not supported by 8910 */ | 3758 | /* Method 3. All DCT4 features supported. Not supported by 8910 */ |
3713 | return N6510_GetNextCalendar3(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendar,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); | 3759 | return N6510_GetNextCalendar3(s,Note,start,&s->Phone.Data.Priv.N6510.LastCalendar,&s->Phone.Data.Priv.N6510.LastCalendarYear,&s->Phone.Data.Priv.N6510.LastCalendarPos); |
3714 | } | 3760 | } |
3715 | } | 3761 | } |
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"); |
3765 | return ERR_NONE; | 3811 | return ERR_NONE; |
3766 | } | 3812 | } |
3767 | 3813 | ||
3768 | void N6510_EncodeFMFrequency(double freq, unsigned char *buff) | 3814 | void N6510_EncodeFMFrequency(double freq, unsigned char *buff) |
3769 | { | 3815 | { |
3770 | double freq0; | 3816 | double freq0; |
3771 | unsigned char buffer[20]; | 3817 | unsigned char buffer[20]; |
3772 | unsigned int i,freq2; | 3818 | unsigned int i,freq2; |
3773 | 3819 | ||
3774 | sprintf(buffer,"%.3f",freq); | 3820 | sprintf(buffer,"%.3f",freq); |
3775 | for (i=0;i<strlen(buffer);i++) { | 3821 | for (i=0;i<strlen(buffer);i++) { |
3776 | if (buffer[i] == ',' || buffer[i] == '.') buffer[i] = ' '; | 3822 | if (buffer[i] == ',' || buffer[i] == '.') buffer[i] = ' '; |
3777 | } | 3823 | } |
3778 | StringToDouble(buffer, &freq0); | 3824 | StringToDouble(buffer, &freq0); |
3779 | freq2 = (unsigned int)freq0; | 3825 | freq2 = (unsigned int)freq0; |
3780 | dbgprintf("Frequency: %s %i\n",buffer,freq2); | 3826 | dbgprintf("Frequency: %s %i\n",buffer,freq2); |
3781 | freq2= freq2 - 0xffff; | 3827 | freq2= freq2 - 0xffff; |
3782 | buff[0] = freq2 / 0x100; | 3828 | buff[0] = freq2 / 0x100; |
3783 | buff[1] = freq2 % 0x100; | 3829 | buff[1] = freq2 % 0x100; |
3784 | } | 3830 | } |
3785 | 3831 | ||
3786 | void N6510_DecodeFMFrequency(double *freq, unsigned char *buff) | 3832 | void N6510_DecodeFMFrequency(double *freq, unsigned char *buff) |
3787 | { | 3833 | { |
3788 | unsigned char buffer[20]; | 3834 | unsigned char buffer[20]; |
@@ -3927,180 +3973,216 @@ static GSM_Error N6510_SetFMStation (GSM_StateMachine *s, GSM_FMStation *FMStati | |||
3927 | smprintf(s, "Setting FM Station %i\n",FMStation->Location); | 3973 | smprintf(s, "Setting FM Station %i\n",FMStation->Location); |
3928 | return GSM_WaitFor (s, req, 0x13+len*2, 0x3E, 2, ID_SetFMStation); | 3974 | return GSM_WaitFor (s, req, 0x13+len*2, 0x3E, 2, ID_SetFMStation); |
3929 | } | 3975 | } |
3930 | 3976 | ||
3931 | static GSM_Error N6510_ReplySetLight(GSM_Protocol_Message msg, GSM_StateMachine *s) | 3977 | static GSM_Error N6510_ReplySetLight(GSM_Protocol_Message msg, GSM_StateMachine *s) |
3932 | { | 3978 | { |
3933 | smprintf(s, "Light set\n"); | 3979 | smprintf(s, "Light set\n"); |
3934 | return ERR_NONE; | 3980 | return ERR_NONE; |
3935 | } | 3981 | } |
3936 | 3982 | ||
3937 | GSM_Error N6510_SetLight(GSM_StateMachine *s, N6510_PHONE_LIGHTS light, bool enable) | 3983 | GSM_Error N6510_SetLight(GSM_StateMachine *s, N6510_PHONE_LIGHTS light, bool enable) |
3938 | { | 3984 | { |
3939 | unsigned char req[14] = { | 3985 | unsigned char req[14] = { |
3940 | N6110_FRAME_HEADER, 0x05, | 3986 | N6110_FRAME_HEADER, 0x05, |
3941 | 0x01, /* 0x01 = Display, 0x03 = keypad */ | 3987 | 0x01, /* 0x01 = Display, 0x03 = keypad */ |
3942 | 0x01, /* 0x01 = Enable, 0x02 = disable */ | 3988 | 0x01, /* 0x01 = Enable, 0x02 = disable */ |
3943 | 0x00, 0x00, 0x00, 0x01, | 3989 | 0x00, 0x00, 0x00, 0x01, |
3944 | 0x05, 0x04, 0x02, 0x00}; | 3990 | 0x05, 0x04, 0x02, 0x00}; |
3945 | 3991 | ||
3946 | req[4] = light; | 3992 | req[4] = light; |
3947 | if (!enable) req[5] = 0x02; | 3993 | if (!enable) req[5] = 0x02; |
3948 | smprintf(s, "Setting light\n"); | 3994 | smprintf(s, "Setting light\n"); |
3949 | return GSM_WaitFor (s, req, 14, 0x3A, 4, ID_SetLight); | 3995 | return GSM_WaitFor (s, req, 14, 0x3A, 4, ID_SetLight); |
3950 | } | 3996 | } |
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; |
3999 | int i; | 4081 | int i; |
4000 | 4082 | ||
4001 | switch (msg.Buffer[3]) { | 4083 | switch (msg.Buffer[3]) { |
4002 | case 0x15: | 4084 | case 0x15: |
4003 | smprintf(s,"File or folder details received\n"); | 4085 | smprintf(s,"File or folder details received\n"); |
4004 | CopyUnicodeString(File->Name,msg.Buffer+10); | 4086 | CopyUnicodeString(File->Name,msg.Buffer+10); |
4005 | if (!strncmp(DecodeUnicodeString(File->Name),"GMSTemp",7)) return ERR_EMPTY; | 4087 | if (!strncmp(DecodeUnicodeString(File->Name),"GMSTemp",7)) return ERR_EMPTY; |
4006 | if (File->Name[0] == 0x00 && File->Name[1] == 0x00) return ERR_UNKNOWN; | 4088 | if (File->Name[0] == 0x00 && File->Name[1] == 0x00) return ERR_UNKNOWN; |
4007 | 4089 | ||
4008 | i = msg.Buffer[8]*256+msg.Buffer[9]; | 4090 | i = msg.Buffer[8]*256+msg.Buffer[9]; |
4009 | dbgprintf("%02x %02x %02x %02x %02x %02x %02x %02x %02x\n", | 4091 | dbgprintf("%02x %02x %02x %02x %02x %02x %02x %02x %02x\n", |
4010 | msg.Buffer[i-5],msg.Buffer[i-4],msg.Buffer[i-3], | 4092 | msg.Buffer[i-5],msg.Buffer[i-4],msg.Buffer[i-3], |
4011 | msg.Buffer[i-2],msg.Buffer[i-1],msg.Buffer[i], | 4093 | msg.Buffer[i-2],msg.Buffer[i-1],msg.Buffer[i], |
4012 | msg.Buffer[i+1],msg.Buffer[i+2],msg.Buffer[i+3]); | 4094 | msg.Buffer[i+1],msg.Buffer[i+2],msg.Buffer[i+3]); |
4013 | 4095 | ||
4014 | File->Folder = false; | 4096 | File->Folder = false; |
4015 | if (msg.Buffer[i-5] == 0x00) File->Folder = true; | 4097 | if (msg.Buffer[i-5] == 0x00) File->Folder = true; |
4016 | 4098 | ||
4017 | File->ReadOnly = false; | 4099 | File->ReadOnly = false; |
4018 | File->Protected = false; | 4100 | File->Protected = false; |
4019 | File->System= false; | 4101 | File->System= false; |
4020 | File->Hidden= false; | 4102 | File->Hidden= false; |
4021 | if (msg.Buffer[i+2] == 0x01) File->Protected = true; | 4103 | if (msg.Buffer[i+2] == 0x01) File->Protected = true; |
4022 | if (msg.Buffer[i+4] == 0x01) File->ReadOnly = true; | 4104 | if (msg.Buffer[i+4] == 0x01) File->ReadOnly = true; |
4023 | if (msg.Buffer[i+5] == 0x01) File->Hidden= true; | 4105 | if (msg.Buffer[i+5] == 0x01) File->Hidden= true; |
4024 | if (msg.Buffer[i+6] == 0x01) File->System= true;//fixme | 4106 | if (msg.Buffer[i+6] == 0x01) File->System= true;//fixme |
4025 | 4107 | ||
4026 | File->ModifiedEmpty = false; | 4108 | File->ModifiedEmpty = false; |
4027 | NOKIA_DecodeDateTime(s, msg.Buffer+i-22, &File->Modified); | 4109 | NOKIA_DecodeDateTime(s, msg.Buffer+i-22, &File->Modified); |
4028 | if (File->Modified.Year == 0x00) File->ModifiedEmpty = true; | 4110 | if (File->Modified.Year == 0x00) File->ModifiedEmpty = true; |
4029 | dbgprintf("%02x %02x %02x %02x\n",msg.Buffer[i-22],msg.Buffer[i-21],msg.Buffer[i-20],msg.Buffer[i-19]); | 4111 | dbgprintf("%02x %02x %02x %02x\n",msg.Buffer[i-22],msg.Buffer[i-21],msg.Buffer[i-20],msg.Buffer[i-19]); |
4030 | 4112 | ||
4031 | Priv->FileToken = msg.Buffer[i-10]*256+msg.Buffer[i-9]; | 4113 | Priv->FileToken = msg.Buffer[i-10]*256+msg.Buffer[i-9]; |
4032 | Priv->ParentID = msg.Buffer[i]*256+msg.Buffer[i+1]; | 4114 | Priv->ParentID = msg.Buffer[i]*256+msg.Buffer[i+1]; |
4033 | smprintf(s,"ParentID is %i\n",Priv->ParentID); | 4115 | smprintf(s,"ParentID is %i\n",Priv->ParentID); |
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 | } |
4083 | Priv->FilesLocationsUsed += msg.Buffer[9]; | 4165 | Priv->FilesLocationsUsed += msg.Buffer[9]; |
4084 | for (i=0;i<msg.Buffer[9];i++) { | 4166 | for (i=0;i<msg.Buffer[9];i++) { |
4085 | Priv->FilesLocations[Priv->FilesLocationsCurrent+i] = msg.Buffer[13+i*4-1]*256 + msg.Buffer[13+i*4]; | 4167 | Priv->FilesLocations[Priv->FilesLocationsCurrent+i] = msg.Buffer[13+i*4-1]*256 + msg.Buffer[13+i*4]; |
4086 | Priv->FilesLevels[Priv->FilesLocationsCurrent+i] = File->Level+1; | 4168 | Priv->FilesLevels[Priv->FilesLocationsCurrent+i] = File->Level+1; |
4087 | dbgprintf("%i ",Priv->FilesLocations[Priv->FilesLocationsCurrent+i]); | 4169 | dbgprintf("%i ",Priv->FilesLocations[Priv->FilesLocationsCurrent+i]); |
4088 | } | 4170 | } |
4089 | dbgprintf("\n"); | 4171 | dbgprintf("\n"); |
4090 | } | 4172 | } |
4091 | if (msg.Buffer[9] != 0x00) File->Folder = true; | 4173 | if (msg.Buffer[9] != 0x00) File->Folder = true; |
4092 | return ERR_NONE; | 4174 | return ERR_NONE; |
4093 | case 0x43: | 4175 | case 0x43: |
4094 | Priv->FileCheckSum = msg.Buffer[6] * 256 + msg.Buffer[7]; | 4176 | Priv->FileCheckSum = msg.Buffer[6] * 256 + msg.Buffer[7]; |
4095 | smprintf(s,"File checksum from phone is %04X\n",Priv->FileCheckSum); | 4177 | smprintf(s,"File checksum from phone is %04X\n",Priv->FileCheckSum); |
4096 | return ERR_NONE; | 4178 | return ERR_NONE; |
4097 | } | 4179 | } |
4098 | return ERR_UNKNOWNRESPONSE; | 4180 | return ERR_UNKNOWNRESPONSE; |
4099 | } | 4181 | } |
4100 | 4182 | ||
4101 | static GSM_Error N6510_GetFileFolderInfo(GSM_StateMachine *s, GSM_File *File, GSM_Phone_RequestID Request) | 4183 | static GSM_Error N6510_GetFileFolderInfo(GSM_StateMachine *s, GSM_File *File, GSM_Phone_RequestID Request) |
4102 | { | 4184 | { |
4103 | GSM_Error error; | 4185 | GSM_Error error; |
4104 | unsigned char req[10] = { | 4186 | unsigned char req[10] = { |
4105 | N7110_FRAME_HEADER, | 4187 | N7110_FRAME_HEADER, |
4106 | 0x14, /* 0x14 - info, 0x22 - free/total, 0x2E - used, 0x32 - sublocations */ | 4188 | 0x14, /* 0x14 - info, 0x22 - free/total, 0x2E - used, 0x32 - sublocations */ |
@@ -4353,97 +4435,97 @@ static GSM_Error N6510_SetReadOnly(GSM_StateMachine *s, unsigned char *ID, bool | |||
4353 | smprintf(s, "Setting readonly attribute\n"); | 4435 | smprintf(s, "Setting readonly attribute\n"); |
4354 | return GSM_WaitFor (s, SetAttr, 10, 0x6D, 4, ID_DeleteFile); | 4436 | return GSM_WaitFor (s, SetAttr, 10, 0x6D, 4, ID_DeleteFile); |
4355 | } | 4437 | } |
4356 | 4438 | ||
4357 | static GSM_Error N6510_ReplyAddFileHeader(GSM_Protocol_Message msg, GSM_StateMachine *s) | 4439 | static GSM_Error N6510_ReplyAddFileHeader(GSM_Protocol_Message msg, GSM_StateMachine *s) |
4358 | { | 4440 | { |
4359 | switch (msg.Buffer[3]) { | 4441 | switch (msg.Buffer[3]) { |
4360 | case 0x03: | 4442 | case 0x03: |
4361 | smprintf(s,"File header added\n"); | 4443 | smprintf(s,"File header added\n"); |
4362 | sprintf(s->Phone.Data.File->ID_FullName,"%i",msg.Buffer[9]); | 4444 | sprintf(s->Phone.Data.File->ID_FullName,"%i",msg.Buffer[9]); |
4363 | return ERR_NONE; | 4445 | return ERR_NONE; |
4364 | case 0x13: | 4446 | case 0x13: |
4365 | return ERR_NONE; | 4447 | return ERR_NONE; |
4366 | } | 4448 | } |
4367 | return ERR_UNKNOWNRESPONSE; | 4449 | return ERR_UNKNOWNRESPONSE; |
4368 | } | 4450 | } |
4369 | 4451 | ||
4370 | static GSM_Error N6510_ReplyAddFilePart(GSM_Protocol_Message msg, GSM_StateMachine *s) | 4452 | static GSM_Error N6510_ReplyAddFilePart(GSM_Protocol_Message msg, GSM_StateMachine *s) |
4371 | { | 4453 | { |
4372 | return ERR_NONE; | 4454 | return ERR_NONE; |
4373 | } | 4455 | } |
4374 | 4456 | ||
4375 | static GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, int *Pos) | 4457 | static GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, int *Pos) |
4376 | { | 4458 | { |
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; |
4426 | Header[215]=0xd3; | 4508 | Header[215]=0xd3; |
4427 | Header[216]=0x06; | 4509 | Header[216]=0x06; |
4428 | Header[217]=0x01; | 4510 | Header[217]=0x01; |
4429 | Header[218]=0x12; | 4511 | Header[218]=0x12; |
4430 | Header[219]=0x13; | 4512 | Header[219]=0x13; |
4431 | Header[220]=0x29; | 4513 | Header[220]=0x29; |
4432 | Header[233]=0x01; | 4514 | Header[233]=0x01; |
4433 | break; | 4515 | break; |
4434 | #endif | 4516 | #endif |
4435 | default : Header[231]=0x01; Header[233]=0x05; | 4517 | default : Header[231]=0x01; Header[233]=0x05; |
4436 | } | 4518 | } |
4437 | Header[235] = 0x01; | 4519 | Header[235] = 0x01; |
4438 | Header[236] = atoi(File->ID_FullName) / 256; | 4520 | Header[236] = atoi(File->ID_FullName) / 256; |
4439 | Header[237] = atoi(File->ID_FullName) % 256; | 4521 | Header[237] = atoi(File->ID_FullName) % 256; |
4440 | if (File->Protected) Header[238] = 0x01; //Nokia forward lock | 4522 | if (File->Protected) Header[238] = 0x01; //Nokia forward lock |
4441 | if (File->Hidden) Header[241] = 0x01; | 4523 | if (File->Hidden) Header[241] = 0x01; |
4442 | if (File->System) Header[242] = 0x01; //fixme | 4524 | if (File->System) Header[242] = 0x01; //fixme |
4443 | smprintf(s, "Adding file header\n"); | 4525 | smprintf(s, "Adding file header\n"); |
4444 | error=GSM_WaitFor (s, Header, 246, 0x6D, 4, ID_AddFile); | 4526 | error=GSM_WaitFor (s, Header, 246, 0x6D, 4, ID_AddFile); |
4445 | if (error != ERR_NONE) return error; | 4527 | if (error != ERR_NONE) return error; |
4446 | } | 4528 | } |
4447 | 4529 | ||
4448 | j = 1000; | 4530 | j = 1000; |
4449 | if (File->Used - *Pos < 1000) j = File->Used - *Pos; | 4531 | if (File->Used - *Pos < 1000) j = File->Used - *Pos; |
@@ -4769,97 +4851,97 @@ static GSM_Error N6510_SetGPRSAccessPoint(GSM_StateMachine *s, GSM_GPRSAccessPoi | |||
4769 | error=GSM_WaitFor (s, buff, s->Phone.Data.Priv.N6510.GPRSPointsLength, 0x43, 4, ID_SetGPRSPoint); | 4851 | error=GSM_WaitFor (s, buff, s->Phone.Data.Priv.N6510.GPRSPointsLength, 0x43, 4, ID_SetGPRSPoint); |
4770 | if (error != ERR_NONE) return error; | 4852 | if (error != ERR_NONE) return error; |
4771 | } | 4853 | } |
4772 | 4854 | ||
4773 | return error; | 4855 | return error; |
4774 | } | 4856 | } |
4775 | 4857 | ||
4776 | /* ToDo support - 6310 style */ | 4858 | /* ToDo support - 6310 style */ |
4777 | static GSM_Error N6510_ReplyGetToDoStatus1(GSM_Protocol_Message msg, GSM_StateMachine *s) | 4859 | static GSM_Error N6510_ReplyGetToDoStatus1(GSM_Protocol_Message msg, GSM_StateMachine *s) |
4778 | { | 4860 | { |
4779 | int i; | 4861 | int i; |
4780 | GSM_NOKIACalToDoLocations*Last = &s->Phone.Data.Priv.N6510.LastToDo; | 4862 | GSM_NOKIACalToDoLocations*Last = &s->Phone.Data.Priv.N6510.LastToDo; |
4781 | 4863 | ||
4782 | smprintf(s, "TODO locations received\n"); | 4864 | smprintf(s, "TODO locations received\n"); |
4783 | Last->Number=msg.Buffer[6]*256+msg.Buffer[7]; | 4865 | Last->Number=msg.Buffer[6]*256+msg.Buffer[7]; |
4784 | smprintf(s, "Number of Entries: %i\n",Last->Number); | 4866 | smprintf(s, "Number of Entries: %i\n",Last->Number); |
4785 | smprintf(s, "Locations: "); | 4867 | smprintf(s, "Locations: "); |
4786 | for (i=0;i<Last->Number;i++) { | 4868 | for (i=0;i<Last->Number;i++) { |
4787 | Last->Location[i]=msg.Buffer[12+(i*4)]*256+msg.Buffer[(i*4)+13]; | 4869 | Last->Location[i]=msg.Buffer[12+(i*4)]*256+msg.Buffer[(i*4)+13]; |
4788 | smprintf(s, "%i ",Last->Location[i]); | 4870 | smprintf(s, "%i ",Last->Location[i]); |
4789 | } | 4871 | } |
4790 | smprintf(s, "\n"); | 4872 | smprintf(s, "\n"); |
4791 | return ERR_NONE; | 4873 | return ERR_NONE; |
4792 | } | 4874 | } |
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 | ||
4842 | smprintf(s, "TODO received method 1\n"); | 4924 | smprintf(s, "TODO received method 1\n"); |
4843 | 4925 | ||
4844 | switch (msg.Buffer[4]) { | 4926 | switch (msg.Buffer[4]) { |
4845 | case 1 : Last->Priority = GSM_Priority_High; break; | 4927 | case 1 : Last->Priority = GSM_Priority_High; break; |
4846 | case 2 : Last->Priority = GSM_Priority_Medium; break; | 4928 | case 2 : Last->Priority = GSM_Priority_Medium; break; |
4847 | case 3 : Last->Priority = GSM_Priority_Low; break; | 4929 | case 3 : Last->Priority = GSM_Priority_Low; break; |
4848 | default: return ERR_UNKNOWN; | 4930 | default: return ERR_UNKNOWN; |
4849 | } | 4931 | } |
4850 | smprintf(s, "Priority: %i\n",msg.Buffer[4]); | 4932 | smprintf(s, "Priority: %i\n",msg.Buffer[4]); |
4851 | 4933 | ||
4852 | CopyUnicodeString(Last->Entries[0].Text,msg.Buffer+14); | 4934 | CopyUnicodeString(Last->Entries[0].Text,msg.Buffer+14); |
4853 | Last->Entries[0].EntryType = TODO_TEXT; | 4935 | Last->Entries[0].EntryType = TODO_TEXT; |
4854 | Last->EntriesNum = 1; | 4936 | Last->EntriesNum = 1; |
4855 | smprintf(s, "Text: \"%s\"\n",DecodeUnicodeString(Last->Entries[0].Text)); | 4937 | smprintf(s, "Text: \"%s\"\n",DecodeUnicodeString(Last->Entries[0].Text)); |
4856 | 4938 | ||
4857 | return ERR_NONE; | 4939 | return ERR_NONE; |
4858 | } | 4940 | } |
4859 | 4941 | ||
4860 | /* ToDo support - 6310 style */ | 4942 | /* ToDo support - 6310 style */ |
4861 | static GSM_Error N6510_GetNextToDo1(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh) | 4943 | static GSM_Error N6510_GetNextToDo1(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, bool refresh) |
4862 | { | 4944 | { |
4863 | GSM_Error error; | 4945 | GSM_Error error; |
4864 | GSM_ToDoStatus status; | 4946 | GSM_ToDoStatus status; |
4865 | GSM_NOKIACalToDoLocations*LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; | 4947 | GSM_NOKIACalToDoLocations*LastToDo = &s->Phone.Data.Priv.N6510.LastToDo; |
@@ -4899,196 +4981,187 @@ static GSM_Error N6510_ReplyGetToDo2(GSM_Protocol_Message msg, GSM_StateMachine | |||
4899 | smprintf(s, "ToDo received method 2\n"); | 4981 | smprintf(s, "ToDo received method 2\n"); |
4900 | 4982 | ||
4901 | switch (msg.Buffer[44]) { | 4983 | switch (msg.Buffer[44]) { |
4902 | case 0x10: Last->Priority = GSM_Priority_Low; break; | 4984 | case 0x10: Last->Priority = GSM_Priority_Low; break; |
4903 | case 0x20: Last->Priority = GSM_Priority_Medium; break; | 4985 | case 0x20: Last->Priority = GSM_Priority_Medium; break; |
4904 | case 0x30: Last->Priority = GSM_Priority_High; break; | 4986 | case 0x30: Last->Priority = GSM_Priority_High; break; |
4905 | default : return ERR_UNKNOWN; | 4987 | default : return ERR_UNKNOWN; |
4906 | } | 4988 | } |
4907 | 4989 | ||
4908 | memcpy(Last->Entries[0].Text,msg.Buffer+54,msg.Buffer[51]*2); | 4990 | memcpy(Last->Entries[0].Text,msg.Buffer+54,msg.Buffer[51]*2); |
4909 | Last->Entries[0].Text[msg.Buffer[51]*2] = 0; | 4991 | Last->Entries[0].Text[msg.Buffer[51]*2] = 0; |
4910 | Last->Entries[0].Text[msg.Buffer[51]*2+1] = 0; | 4992 | Last->Entries[0].Text[msg.Buffer[51]*2+1] = 0; |
4911 | Last->Entries[0].EntryType = TODO_TEXT; | 4993 | Last->Entries[0].EntryType = TODO_TEXT; |
4912 | smprintf(s, "Text: \"%s\"\n",DecodeUnicodeString(Last->Entries[0].Text)); | 4994 | smprintf(s, "Text: \"%s\"\n",DecodeUnicodeString(Last->Entries[0].Text)); |
4913 | 4995 | ||
4914 | smprintf(s,"EndTime: %04i-%02i-%02i %02i:%02i\n", | 4996 | smprintf(s,"EndTime: %04i-%02i-%02i %02i:%02i\n", |
4915 | msg.Buffer[34]*256+msg.Buffer[35], | 4997 | msg.Buffer[34]*256+msg.Buffer[35], |
4916 | msg.Buffer[36],msg.Buffer[37],msg.Buffer[38], | 4998 | msg.Buffer[36],msg.Buffer[37],msg.Buffer[38], |
4917 | msg.Buffer[39]); | 4999 | msg.Buffer[39]); |
4918 | Date.Year = msg.Buffer[34]*256+msg.Buffer[35]; | 5000 | Date.Year = msg.Buffer[34]*256+msg.Buffer[35]; |
4919 | Date.Month = msg.Buffer[36]; | 5001 | Date.Month = msg.Buffer[36]; |
4920 | Date.Day = msg.Buffer[37]; | 5002 | Date.Day = msg.Buffer[37]; |
4921 | Date.Hour = msg.Buffer[38]; | 5003 | Date.Hour = msg.Buffer[38]; |
4922 | Date.Minute = msg.Buffer[39]; | 5004 | Date.Minute = msg.Buffer[39]; |
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 | } |
5071 | 5144 | ||
5072 | /* ToDo support - 6310 style */ | 5145 | /* ToDo support - 6310 style */ |
5073 | static GSM_Error N6510_AddToDo1(GSM_StateMachine *s, GSM_ToDoEntry *ToDo) | 5146 | static GSM_Error N6510_AddToDo1(GSM_StateMachine *s, GSM_ToDoEntry *ToDo) |
5074 | { | 5147 | { |
5075 | int Text, Alarm, EndTime, Completed, ulen, Phone; | 5148 | int Text, Alarm, EndTime, Completed, ulen, Phone; |
5076 | GSM_Error error; | 5149 | GSM_Error error; |
5077 | unsigned char reqLoc[] = {N6110_FRAME_HEADER, 0x0F}; | 5150 | unsigned char reqLoc[] = {N6110_FRAME_HEADER, 0x0F}; |
5078 | unsigned char reqSet[500] = { | 5151 | unsigned char reqSet[500] = { |
5079 | N6110_FRAME_HEADER, 0x01, | 5152 | N6110_FRAME_HEADER, 0x01, |
5080 | 0x03, /* Priority */ | 5153 | 0x03, /* Priority */ |
5081 | 0x00, /* Length of text */ | 5154 | 0x00, /* Length of text */ |
5082 | 0x80,0x00,0x00, | 5155 | 0x80,0x00,0x00, |
5083 | 0x18}; /* Location */ | 5156 | 0x18}; /* Location */ |
5084 | 5157 | ||
5085 | s->Phone.Data.ToDo = ToDo; | 5158 | s->Phone.Data.ToDo = ToDo; |
5086 | 5159 | ||
5087 | smprintf(s, "Getting first ToDo location\n"); | 5160 | smprintf(s, "Getting first ToDo location\n"); |
5088 | error = GSM_WaitFor (s, reqLoc, 4, 0x55, 4, ID_SetToDo); | 5161 | error = GSM_WaitFor (s, reqLoc, 4, 0x55, 4, ID_SetToDo); |
5089 | if (error != ERR_NONE) return error; | 5162 | if (error != ERR_NONE) return error; |
5090 | reqSet[9] = ToDo->Location; | 5163 | reqSet[9] = ToDo->Location; |
5091 | 5164 | ||
5092 | switch (ToDo->Priority) { | 5165 | switch (ToDo->Priority) { |
5093 | case GSM_Priority_Low: reqSet[4] = 3; break; | 5166 | case GSM_Priority_Low: reqSet[4] = 3; break; |
5094 | case GSM_Priority_Medium: reqSet[4] = 2; break; | 5167 | case GSM_Priority_Medium: reqSet[4] = 2; break; |
@@ -5406,160 +5479,168 @@ static GSM_Error N6510_SetWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *book | |||
5406 | 5479 | ||
5407 | smprintf(s, "Setting WAP bookmark\n"); | 5480 | smprintf(s, "Setting WAP bookmark\n"); |
5408 | error = GSM_WaitFor (s, req, count, 0x3f, 4, ID_SetWAPBookmark); | 5481 | error = GSM_WaitFor (s, req, count, 0x3f, 4, ID_SetWAPBookmark); |
5409 | if (error != ERR_NONE) { | 5482 | if (error != ERR_NONE) { |
5410 | if (error == ERR_INSIDEPHONEMENU || error == ERR_EMPTY || error == ERR_FULL) { | 5483 | if (error == ERR_INSIDEPHONEMENU || error == ERR_EMPTY || error == ERR_FULL) { |
5411 | DCT3DCT4_DisableConnectionFunctions(s); | 5484 | DCT3DCT4_DisableConnectionFunctions(s); |
5412 | } | 5485 | } |
5413 | return error; | 5486 | return error; |
5414 | } | 5487 | } |
5415 | 5488 | ||
5416 | return DCT3DCT4_DisableConnectionFunctions(s); | 5489 | return DCT3DCT4_DisableConnectionFunctions(s); |
5417 | } | 5490 | } |
5418 | 5491 | ||
5419 | GSM_Error N6510_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) | 5492 | GSM_Error N6510_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) |
5420 | { | 5493 | { |
5421 | GSM_Error error; | 5494 | GSM_Error error; |
5422 | 5495 | ||
5423 | /* We have to enable WAP frames in phone */ | 5496 | /* We have to enable WAP frames in phone */ |
5424 | error=N6510_EnableConnectionFunctions(s,N6510_WAP_SETTINGS); | 5497 | error=N6510_EnableConnectionFunctions(s,N6510_WAP_SETTINGS); |
5425 | if (error!=ERR_NONE) return error; | 5498 | if (error!=ERR_NONE) return error; |
5426 | 5499 | ||
5427 | return DCT3DCT4_DeleteWAPBookmarkPart(s,bookmark); | 5500 | return DCT3DCT4_DeleteWAPBookmarkPart(s,bookmark); |
5428 | } | 5501 | } |
5429 | 5502 | ||
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 }, |
5485 | {N6510_ReplyGetSignalQuality, "\x0A",0x03,0x0C,ID_GetSignalQuality }, | 5564 | {N6510_ReplyGetSignalQuality, "\x0A",0x03,0x0C,ID_GetSignalQuality }, |
5486 | {N6510_ReplyGetIncSignalQuality, "\x0A",0x03,0x1E,ID_IncomingFrame }, | 5565 | {N6510_ReplyGetIncSignalQuality, "\x0A",0x03,0x1E,ID_IncomingFrame }, |
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 }, |
5542 | {N6510_ReplyGetAlarm, "\x19",0x03,0x20,ID_GetAlarm }, | 5623 | {N6510_ReplyGetAlarm, "\x19",0x03,0x20,ID_GetAlarm }, |
5543 | 5624 | ||
5544 | {DCT4_ReplyGetIMEI, "\x1B",0x03,0x01,ID_GetIMEI }, | 5625 | {DCT4_ReplyGetIMEI, "\x1B",0x03,0x01,ID_GetIMEI }, |
5545 | {NOKIA_ReplyGetPhoneString, "\x1B",0x03,0x08,ID_GetHardware }, | 5626 | {NOKIA_ReplyGetPhoneString, "\x1B",0x03,0x08,ID_GetHardware }, |
5546 | {N6510_ReplyGetPPM, "\x1B",0x03,0x08,ID_GetPPM }, | 5627 | {N6510_ReplyGetPPM, "\x1B",0x03,0x08,ID_GetPPM }, |
5547 | {NOKIA_ReplyGetPhoneString, "\x1B",0x03,0x0C,ID_GetProductCode }, | 5628 | {NOKIA_ReplyGetPhoneString, "\x1B",0x03,0x0C,ID_GetProductCode }, |
5548 | 5629 | ||
5549 | /* 0x1C - vibra */ | 5630 | /* 0x1C - vibra */ |
5550 | 5631 | ||
5551 | {N6510_ReplyGetRingtonesInfo, "\x1f",0x03,0x08,ID_GetRingtonesInfo }, | 5632 | {N6510_ReplyGetRingtonesInfo, "\x1f",0x03,0x08,ID_GetRingtonesInfo }, |
5552 | {N6510_ReplyDeleteRingtones, "\x1f",0x03,0x11,ID_SetRingtone }, | 5633 | {N6510_ReplyDeleteRingtones, "\x1f",0x03,0x11,ID_SetRingtone }, |
5553 | {N6510_ReplyGetRingtone, "\x1f",0x03,0x13,ID_GetRingtone }, | 5634 | {N6510_ReplyGetRingtone, "\x1f",0x03,0x13,ID_GetRingtone }, |
5554 | {N6510_ReplySetBinRingtone, "\x1f",0x03,0x0F,ID_SetRingtone }, | 5635 | {N6510_ReplySetBinRingtone, "\x1f",0x03,0x0F,ID_SetRingtone }, |
5555 | 5636 | ||
5556 | /* 0x23 - voice records */ | 5637 | /* 0x23 - voice records */ |
5557 | 5638 | ||
5558 | {N6510_ReplyGetProfile, "\x39",0x03,0x02,ID_GetProfile }, | 5639 | {N6510_ReplyGetProfile, "\x39",0x03,0x02,ID_GetProfile }, |
5559 | {N6510_ReplySetProfile, "\x39",0x03,0x04,ID_SetProfile }, | 5640 | {N6510_ReplySetProfile, "\x39",0x03,0x04,ID_SetProfile }, |
5560 | {N6510_ReplyGetProfile, "\x39",0x03,0x06,ID_GetProfile }, | 5641 | {N6510_ReplyGetProfile, "\x39",0x03,0x06,ID_GetProfile }, |
5561 | 5642 | ||
5562 | {N6510_ReplySetLight, "\x3A",0x03,0x06,ID_SetLight }, | 5643 | {N6510_ReplySetLight, "\x3A",0x03,0x06,ID_SetLight }, |
5563 | 5644 | ||
5564 | {N6510_ReplyGetFMStation, "\x3E",0x03,0x06,ID_GetFMStation }, | 5645 | {N6510_ReplyGetFMStation, "\x3E",0x03,0x06,ID_GetFMStation }, |
5565 | {N6510_ReplyGetFMStatus, "\x3E",0x03,0x0E,ID_GetFMStation }, | 5646 | {N6510_ReplyGetFMStatus, "\x3E",0x03,0x0E,ID_GetFMStation }, |
@@ -5606,177 +5687,178 @@ static GSM_Reply_Function N6510ReplyFunctions[] = { | |||
5606 | 5687 | ||
5607 | /* 0x53 - simlock */ | 5688 | /* 0x53 - simlock */ |
5608 | 5689 | ||
5609 | {N6510_ReplyAddToDo1, "\x55",0x03,0x02,ID_SetToDo }, | 5690 | {N6510_ReplyAddToDo1, "\x55",0x03,0x02,ID_SetToDo }, |
5610 | {N6510_ReplyGetToDo1, "\x55",0x03,0x04,ID_GetToDo }, | 5691 | {N6510_ReplyGetToDo1, "\x55",0x03,0x04,ID_GetToDo }, |
5611 | {N6510_ReplyGetToDoFirstLoc1, "\x55",0x03,0x10,ID_SetToDo }, | 5692 | {N6510_ReplyGetToDoFirstLoc1, "\x55",0x03,0x10,ID_SetToDo }, |
5612 | {N6510_ReplyDeleteAllToDo1, "\x55",0x03,0x12,ID_DeleteAllToDo }, | 5693 | {N6510_ReplyDeleteAllToDo1, "\x55",0x03,0x12,ID_DeleteAllToDo }, |
5613 | {N6510_ReplyGetToDoStatus1, "\x55",0x03,0x16,ID_GetToDo }, | 5694 | {N6510_ReplyGetToDoStatus1, "\x55",0x03,0x16,ID_GetToDo }, |
5614 | 5695 | ||
5615 | {N6510_ReplyAddFileHeader, "\x6D",0x03,0x03,ID_AddFile }, | 5696 | {N6510_ReplyAddFileHeader, "\x6D",0x03,0x03,ID_AddFile }, |
5616 | {N6510_ReplyAddFolder, "\x6D",0x03,0x05,ID_AddFolder }, | 5697 | {N6510_ReplyAddFolder, "\x6D",0x03,0x05,ID_AddFolder }, |
5617 | {N6510_ReplyGetFilePart, "\x6D",0x03,0x0F,ID_GetFile }, | 5698 | {N6510_ReplyGetFilePart, "\x6D",0x03,0x0F,ID_GetFile }, |
5618 | {N6510_ReplyAddFileHeader, "\x6D",0x03,0x13,ID_AddFile }, | 5699 | {N6510_ReplyAddFileHeader, "\x6D",0x03,0x13,ID_AddFile }, |
5619 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x15,ID_GetFileInfo }, | 5700 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x15,ID_GetFileInfo }, |
5620 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x15,ID_GetFile }, | 5701 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x15,ID_GetFile }, |
5621 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x15,ID_AddFile }, | 5702 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x15,ID_AddFile }, |
5622 | {N6510_ReplyDeleteFile, "\x6D",0x03,0x19,ID_DeleteFile }, | 5703 | {N6510_ReplyDeleteFile, "\x6D",0x03,0x19,ID_DeleteFile }, |
5623 | {N6510_ReplyDeleteFile, "\x6D",0x03,0x1F,ID_DeleteFile }, | 5704 | {N6510_ReplyDeleteFile, "\x6D",0x03,0x1F,ID_DeleteFile }, |
5624 | {N6510_ReplyGetFileSystemStatus, "\x6D",0x03,0x23,ID_FileSystemStatus }, | 5705 | {N6510_ReplyGetFileSystemStatus, "\x6D",0x03,0x23,ID_FileSystemStatus }, |
5625 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x2F,ID_GetFileInfo }, | 5706 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x2F,ID_GetFileInfo }, |
5626 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x2F,ID_GetFile }, | 5707 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x2F,ID_GetFile }, |
5627 | {N6510_ReplyGetFileSystemStatus, "\x6D",0x03,0x2F,ID_FileSystemStatus }, | 5708 | {N6510_ReplyGetFileSystemStatus, "\x6D",0x03,0x2F,ID_FileSystemStatus }, |
5628 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x33,ID_GetFileInfo }, | 5709 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x33,ID_GetFileInfo }, |
5629 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x33,ID_GetFile }, | 5710 | {N6510_ReplyGetFileFolderInfo, "\x6D",0x03,0x33,ID_GetFile }, |
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*/ |
5679 | N6510_EnterSecurityCode, | 5760 | N6510_EnterSecurityCode, |
5680 | N6510_GetSecurityStatus, | 5761 | N6510_GetSecurityStatus, |
5681 | NOTSUPPORTED, /* GetDisplayStatus*/ | 5762 | NOTSUPPORTED, /* GetDisplayStatus*/ |
5682 | NOTIMPLEMENTED, /* SetAutoNetworkLogin*/ | 5763 | NOTIMPLEMENTED, /* SetAutoNetworkLogin*/ |
5683 | N6510_GetBatteryCharge, | 5764 | N6510_GetBatteryCharge, |
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, |
5732 | N6510_PlayTone, | 5814 | N6510_PlayTone, |
5733 | N6510_GetWAPBookmark, | 5815 | N6510_GetWAPBookmark, |
5734 | N6510_SetWAPBookmark, | 5816 | N6510_SetWAPBookmark, |
5735 | N6510_DeleteWAPBookmark, | 5817 | N6510_DeleteWAPBookmark, |
5736 | N6510_GetWAPSettings, | 5818 | N6510_GetWAPSettings, |
5737 | N6510_SetWAPSettings, | 5819 | N6510_SetWAPSettings, |
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 | |||
@@ -1,84 +1,86 @@ | |||
1 | /* (c) 2002-2004 by Marcin Wiacek */ | 1 | /* (c) 2002-2004 by Marcin Wiacek */ |
2 | 2 | ||
3 | #ifndef n6510_h | 3 | #ifndef n6510_h |
4 | #define n6510_h | 4 | #define n6510_h |
5 | 5 | ||
6 | #include "../ncommon.h" | 6 | #include "../ncommon.h" |
7 | #include "../../../service/sms/gsmsms.h" | 7 | #include "../../../service/sms/gsmsms.h" |
8 | 8 | ||
9 | typedef enum { | 9 | typedef enum { |
10 | N6510_MMS_SETTINGS = 0x01, | 10 | N6510_MMS_SETTINGS = 0x01, |
11 | N6510_CHAT_SETTINGS, | 11 | N6510_CHAT_SETTINGS, |
12 | 12 | ||
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 | ||
61 | #ifndef GSM_USED_MBUS2 | 63 | #ifndef GSM_USED_MBUS2 |
62 | # define GSM_USED_MBUS2 | 64 | # define GSM_USED_MBUS2 |
63 | #endif | 65 | #endif |
64 | #ifndef GSM_USED_FBUS2 | 66 | #ifndef GSM_USED_FBUS2 |
65 | # define GSM_USED_FBUS2 | 67 | # define GSM_USED_FBUS2 |
66 | #endif | 68 | #endif |
67 | #ifndef GSM_USED_FBUS2DLR3 | 69 | #ifndef GSM_USED_FBUS2DLR3 |
68 | # define GSM_USED_FBUS2DLR3 | 70 | # define GSM_USED_FBUS2DLR3 |
69 | #endif | 71 | #endif |
70 | #ifndef GSM_USED_FBUS2DKU5 | 72 | #ifndef GSM_USED_FBUS2DKU5 |
71 | # define GSM_USED_FBUS2DKU5 | 73 | # define GSM_USED_FBUS2DKU5 |
72 | #endif | 74 | #endif |
73 | #ifndef GSM_USED_PHONETBLUE | 75 | #ifndef GSM_USED_PHONETBLUE |
74 | # define GSM_USED_PHONETBLUE | 76 | # define GSM_USED_PHONETBLUE |
75 | #endif | 77 | #endif |
76 | #ifndef GSM_USED_IRDAPHONET | 78 | #ifndef GSM_USED_IRDAPHONET |
77 | # define GSM_USED_IRDAPHONET | 79 | # define GSM_USED_IRDAPHONET |
78 | #endif | 80 | #endif |
79 | #ifndef GSM_USED_BLUEPHONET | 81 | #ifndef GSM_USED_BLUEPHONET |
80 | # define GSM_USED_BLUEPHONET | 82 | # define GSM_USED_BLUEPHONET |
81 | #endif | 83 | #endif |
82 | #ifndef GSM_USED_FBUS2PL2303 | 84 | #ifndef GSM_USED_FBUS2PL2303 |
83 | # define GSM_USED_FBUS2PL2303 | 85 | # define GSM_USED_FBUS2PL2303 |
84 | #endif | 86 | #endif |
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 | |||
@@ -76,69 +76,69 @@ GSM_Phone_Functions NAUTOPhone = { | |||
76 | NOTSUPPORTED, /* GetSMSFolders */ | 76 | NOTSUPPORTED, /* GetSMSFolders */ |
77 | NOTSUPPORTED, /* AddSMSFolder */ | 77 | NOTSUPPORTED, /* AddSMSFolder */ |
78 | NOTSUPPORTED, /* DeleteSMSFolder */ | 78 | NOTSUPPORTED, /* DeleteSMSFolder */ |
79 | NOTSUPPORTED, /* DialVoice */ | 79 | NOTSUPPORTED, /* DialVoice */ |
80 | NOTSUPPORTED, /* AnswerCall */ | 80 | NOTSUPPORTED, /* AnswerCall */ |
81 | NOTSUPPORTED, /* CancelCall */ | 81 | NOTSUPPORTED, /* CancelCall */ |
82 | NOTSUPPORTED, /* HoldCall */ | 82 | NOTSUPPORTED, /* HoldCall */ |
83 | NOTSUPPORTED, /* UnholdCall */ | 83 | NOTSUPPORTED, /* UnholdCall */ |
84 | NOTSUPPORTED, /* ConferenceCall */ | 84 | NOTSUPPORTED, /* ConferenceCall */ |
85 | NOTSUPPORTED, /* SplitCall */ | 85 | NOTSUPPORTED, /* SplitCall */ |
86 | NOTSUPPORTED, /* TransferCall */ | 86 | NOTSUPPORTED, /* TransferCall */ |
87 | NOTSUPPORTED, /* SwitchCall */ | 87 | NOTSUPPORTED, /* SwitchCall */ |
88 | NOTSUPPORTED, /* GetCallDivert */ | 88 | NOTSUPPORTED, /* GetCallDivert */ |
89 | NOTSUPPORTED, /* SetCallDivert */ | 89 | NOTSUPPORTED, /* SetCallDivert */ |
90 | NOTSUPPORTED, /* CancelAllDiverts*/ | 90 | NOTSUPPORTED, /* CancelAllDiverts*/ |
91 | NOTSUPPORTED, /* SetIncomingCall */ | 91 | NOTSUPPORTED, /* SetIncomingCall */ |
92 | NOTSUPPORTED, /* SetIncomingUSSD */ | 92 | NOTSUPPORTED, /* SetIncomingUSSD */ |
93 | NOTSUPPORTED, /* SendDTMF */ | 93 | NOTSUPPORTED, /* SendDTMF */ |
94 | NOTSUPPORTED, /* GetRingtone */ | 94 | NOTSUPPORTED, /* GetRingtone */ |
95 | NOTSUPPORTED, /* SetRingtone */ | 95 | NOTSUPPORTED, /* SetRingtone */ |
96 | NOTSUPPORTED, /* GetRingtonesInfo*/ | 96 | NOTSUPPORTED, /* GetRingtonesInfo*/ |
97 | NOTSUPPORTED, /* DeleteUserRingtones*/ | 97 | NOTSUPPORTED, /* DeleteUserRingtones*/ |
98 | NOTSUPPORTED, /* PlayTone */ | 98 | NOTSUPPORTED, /* PlayTone */ |
99 | NOTSUPPORTED, /* GetWAPBookmark */ | 99 | NOTSUPPORTED, /* GetWAPBookmark */ |
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 | |||
@@ -1348,125 +1348,139 @@ GSM_Error N71_65_ReplyCallInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | |||
1348 | smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii | 1348 | smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii |
1349 | tmp = 6; | 1349 | tmp = 6; |
1350 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); | 1350 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); |
1351 | smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); | 1351 | smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); |
1352 | /* FIXME: read name from frame */ | 1352 | /* FIXME: read name from frame */ |
1353 | 1353 | ||
1354 | call.Status = GSM_CALL_CallStart; | 1354 | call.Status = GSM_CALL_CallStart; |
1355 | break; | 1355 | break; |
1356 | case 0x04: | 1356 | case 0x04: |
1357 | smprintf(s, "Remote end hang up\n"); | 1357 | smprintf(s, "Remote end hang up\n"); |
1358 | smprintf(s, "Cause Type : %i\n",msg.Buffer[5]);//such interpretation is in gnokii | 1358 | smprintf(s, "Cause Type : %i\n",msg.Buffer[5]);//such interpretation is in gnokii |
1359 | smprintf(s, "CC : %i\n",msg.Buffer[6]); | 1359 | smprintf(s, "CC : %i\n",msg.Buffer[6]); |
1360 | smprintf(s, "MM(?) : %i\n",msg.Buffer[7]); | 1360 | smprintf(s, "MM(?) : %i\n",msg.Buffer[7]); |
1361 | smprintf(s, "RR(?) : %i\n",msg.Buffer[8]); | 1361 | smprintf(s, "RR(?) : %i\n",msg.Buffer[8]); |
1362 | call.Status = GSM_CALL_CallRemoteEnd; | 1362 | call.Status = GSM_CALL_CallRemoteEnd; |
1363 | call.StatusCode = msg.Buffer[6]; | 1363 | call.StatusCode = msg.Buffer[6]; |
1364 | break; | 1364 | break; |
1365 | case 0x05: | 1365 | case 0x05: |
1366 | smprintf(s, "Incoming call\n"); | 1366 | smprintf(s, "Incoming call\n"); |
1367 | smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii | 1367 | smprintf(s, "Call mode : %i\n",msg.Buffer[5]);//such interpretation is in gnokii |
1368 | tmp = 6; | 1368 | tmp = 6; |
1369 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); | 1369 | NOKIA_GetUnicodeString(s, &tmp, msg.Buffer,buffer,false); |
1370 | smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); | 1370 | smprintf(s, "Number : \"%s\"\n",DecodeUnicodeString(buffer)); |
1371 | /* FIXME: read name from frame */ | 1371 | /* FIXME: read name from frame */ |
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]; |
1449 | /* 8760 hours = 1 year */ | 1463 | /* 8760 hours = 1 year */ |
1450 | if (Recurrance == 0xffff) Recurrance=8760; | 1464 | if (Recurrance == 0xffff) Recurrance=8760; |
1451 | if (Recurrance != 0) { | 1465 | if (Recurrance != 0) { |
1452 | smprintf(s, "Recurrance : %i hours\n",Recurrance); | 1466 | smprintf(s, "Recurrance : %i hours\n",Recurrance); |
1453 | entry->Entries[entry->EntriesNum].EntryType= CAL_RECURRANCE; | 1467 | entry->Entries[entry->EntriesNum].EntryType= CAL_RECURRANCE; |
1454 | entry->Entries[entry->EntriesNum].Number= Recurrance; | 1468 | entry->Entries[entry->EntriesNum].Number= Recurrance; |
1455 | entry->EntriesNum++; | 1469 | entry->EntriesNum++; |
1456 | } | 1470 | } |
1457 | } | 1471 | } |
1458 | 1472 | ||
1459 | /* method 2 */ | 1473 | /* method 2 */ |
1460 | GSM_Error N71_65_ReplyAddCalendar2(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1474 | GSM_Error N71_65_ReplyAddCalendar2(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1461 | { | 1475 | { |
1462 | smprintf(s, "Calendar note added\n"); | 1476 | smprintf(s, "Calendar note added\n"); |
1463 | return ERR_NONE; | 1477 | return ERR_NONE; |
1464 | } | 1478 | } |
1465 | 1479 | ||
1466 | /* method 2 */ | 1480 | /* method 2 */ |
1467 | GSM_Error N71_65_AddCalendar2(GSM_StateMachine *s, GSM_CalendarEntry *Note) | 1481 | GSM_Error N71_65_AddCalendar2(GSM_StateMachine *s, GSM_CalendarEntry *Note) |
1468 | { | 1482 | { |
1469 | GSM_CalendarNoteTypeNoteType; | 1483 | GSM_CalendarNoteTypeNoteType; |
1470 | time_t t_time1,t_time2; | 1484 | time_t t_time1,t_time2; |
1471 | GSM_DateTime Date,date_time; | 1485 | GSM_DateTime Date,date_time; |
1472 | GSM_Error error; | 1486 | GSM_Error error; |