summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/phone/nokia/dct3
Unidiff
Diffstat (limited to 'gammu/emb/common/phone/nokia/dct3') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/phone/nokia/dct3/dct3func.c16
-rw-r--r--gammu/emb/common/phone/nokia/dct3/dct3func.h2
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n6110.c17
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n7110.c9
-rw-r--r--gammu/emb/common/phone/nokia/dct3/n9210.c3
5 files changed, 33 insertions, 14 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
18GSM_Error DCT3_DeleteWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) 21GSM_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
29GSM_Error DCT3_GetWAPBookmark(GSM_StateMachine *s, GSM_WAPBookmark *bookmark) 32GSM_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
40GSM_Error DCT3_ReplyPressKey(GSM_Protocol_Message msg, GSM_StateMachine *s) 43GSM_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
352GSM_Error DCT3_ReplySetAlarm(GSM_Protocol_Message msg, GSM_StateMachine *s) 355GSM_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
363GSM_Error DCT3_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm, unsigned char msgtype) 366GSM_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
380GSM_Error DCT3_ReplyGetSMSC(GSM_Protocol_Message msg, GSM_StateMachine *s) 383GSM_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
422GSM_Error DCT3_GetSMSC(GSM_StateMachine *s, GSM_SMSC *smsc) 426GSM_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
436GSM_Error DCT3_ReplyGetNetworkInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) 440GSM_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
1206GSM_Error DCT3_ReplySendSMSMessage(GSM_Protocol_Message msg, GSM_StateMachine *s) 1210GSM_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
1221GSM_Error DCT3_SendSMSMessage(GSM_StateMachine *s, GSM_SMSMessage *sms) 1225GSM_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
1234GSM_Error DCT3_ReplyNetmonitor(GSM_Protocol_Message msg, GSM_StateMachine *s) 1238GSM_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
1249GSM_Error DCT3_Netmonitor(GSM_StateMachine *s, int testnumber, char *value) 1253GSM_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);
29GSM_Error N61_71_ReplyResetPhoneSettings(GSM_Protocol_Message msg, GSM_StateMachine *s); 31GSM_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
21static unsigned char N6110_MEMORY_TYPES[] = { 23static 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
32static GSM_Error N6110_ReplyGetPhoneLanguage(GSM_Protocol_Message msg, GSM_StateMachine *s) 34static 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
46static GSM_Error N6110_GetPhoneLanguage(GSM_StateMachine *s) 48static 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
94static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const unsigned char *src, int len) 96static 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 */
142static void N6110_GetNokiaAuthentication(unsigned char *Imei, unsigned char *MagicBytes, unsigned char *MagicResponse) 145static 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
832static GSM_Error N6110_ReplyGetOpLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) 836static 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
853static GSM_Error N6110_ReplyGetStartup(GSM_Protocol_Message msg, GSM_StateMachine *s) 857static 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
1538static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) 1543static 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
1576static GSM_Error N6110_ReplyGetSecurityStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) 1582static 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
1596static GSM_Error N6110_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status) 1602static 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
1605static GSM_Error N6110_ReplyEnterSecurityCode(GSM_Protocol_Message msg, GSM_StateMachine *s) 1611static 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
2408static GSM_Error N6110_GetNextCalendarNote(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start) 2414static 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
2441GSM_Error N6110_ReplyUSSDInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) 2447GSM_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
2459GSM_Error N6110_AnswerCall(GSM_StateMachine *s, int ID, bool all) 2465GSM_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
2477static GSM_Error N6110_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber) 2483static 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
20static GSM_Error N7110_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) 23static 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
25static GSM_Error N7110_SetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm) 28static 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
30static GSM_Error N7110_ReplyGetMemory(GSM_Protocol_Message msg, GSM_StateMachine *s) 33static 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
44static GSM_Error N7110_GetMemory (GSM_StateMachine *s, GSM_MemoryEntry *entry) 47static 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
512static GSM_Error N7110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) 515static 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
534static GSM_Error N7110_ReplyGetPictureImageInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) 538static 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
551static GSM_Error N7110_GetPictureImageLocation(GSM_StateMachine *s, GSM_Bitmap *Bitmap, unsigned char *folder, int *location) 555static 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 */