2 #include "../../../gsmstate.h"
4 #ifdef GSM_ENABLE_NOKIA7110
9 #include "../../../misc/coding/coding.h"
10 #include "../../../gsmcomon.h"
11 #include "../../../service/gsmlogo.h"
12 #include "../../pfunc.h"
14 #include "../nfuncold.h"
18 static GSM_Error
N7110_GetAlarm(GSM_StateMachine
*s
, GSM_Alarm
*alarm
)
20 return DCT3_GetAlarm(s
, alarm
, 0x19);
23 static GSM_Error
N7110_SetAlarm(GSM_StateMachine
*s
, GSM_Alarm
*alarm
)
25 return DCT3_SetAlarm(s
, alarm
, 0x19);
28 static GSM_Error
N7110_ReplyGetMemory(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
30 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
32 smprintf(s
, "Phonebook entry received\n");
33 switch (msg
.Buffer
[6]) {
35 return N71_65_ReplyGetMemoryError(msg
.Buffer
[10], s
);
37 return N71_65_DecodePhonebook(s
, Data
->Memory
,Data
->Bitmap
,Data
->SpeedDial
,msg
.Buffer
+18,msg
.Length
-18);
42 static GSM_Error
N7110_GetMemory (GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
)
44 unsigned char req
[] = {
45 N7110_FRAME_HEADER
, 0x07, 0x01, 0x01, 0x00, 0x01,
46 0x02, /* memory type */
48 0x00, 0x00, /* location */
51 req
[9] = NOKIA_GetMemoryType(s
, entry
->MemoryType
,N71_65_MEMORY_TYPES
);
52 if (req
[9]==0xff) return GE_NOTSUPPORTED
;
54 if (entry
->Location
==0x00) return GE_INVALIDLOCATION
;
56 req
[10] = (entry
->Location
>>8);
57 req
[11] = entry
->Location
& 0xff;
59 s
->Phone
.Data
.Memory
=entry
;
60 smprintf(s
, "Getting phonebook entry\n");
61 return GSM_WaitFor (s
, req
, 14, 0x03, 4, ID_GetMemory
);
64 static GSM_Error
N7110_ReplyGetMemoryStatus(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
66 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
68 smprintf(s
, "Memory status received\n");
70 if (msg
.Buffer
[10]==0x10) {
71 Data
->MemoryStatus
->Free
= msg
.Buffer
[14]*256 + msg
.Buffer
[15];
73 Data
->MemoryStatus
->Free
= msg
.Buffer
[18];
75 smprintf(s
, " Size : %i\n",Data
->MemoryStatus
->Free
);
76 Data
->MemoryStatus
->Used
= msg
.Buffer
[16]*256 + msg
.Buffer
[17];
77 smprintf(s
, " Used : %i\n",Data
->MemoryStatus
->Used
);
78 Data
->MemoryStatus
->Free
-= Data
->MemoryStatus
->Used
;
79 smprintf(s
, " Free : %i\n",Data
->MemoryStatus
->Free
);
83 static GSM_Error
N7110_GetMemoryStatus(GSM_StateMachine
*s
, GSM_MemoryStatus
*Status
)
85 unsigned char req
[] = {
86 N6110_FRAME_HEADER
, 0x03, 0x02,
87 0x05 }; /* MemoryType */
89 req
[5] = NOKIA_GetMemoryType(s
, Status
->MemoryType
,N71_65_MEMORY_TYPES
);
90 if (req
[5]==0xff) return GE_NOTSUPPORTED
;
92 s
->Phone
.Data
.MemoryStatus
=Status
;
93 smprintf(s
, "Getting memory status\n");
94 return GSM_WaitFor (s
, req
, 6, 0x03, 4, ID_GetMemoryStatus
);
97 static void N7110_GetSMSLocation(GSM_StateMachine
*s
, GSM_SMSMessage
*sms
, unsigned char *folderid
, int *location
)
101 /* simulate flat SMS memory */
102 if (sms
->Folder
==0x00) {
103 ifolderid
= sms
->Location
/ PHONE_MAXSMSINFOLDER
;
104 *folderid
= (ifolderid
+ 1) * 0x08;
105 *location
= sms
->Location
- ifolderid
* PHONE_MAXSMSINFOLDER
;
107 *folderid
= sms
->Folder
* 0x08;
108 *location
= sms
->Location
;
110 smprintf(s
, "SMS folder %i & location %i -> 7110 folder %i & location %i\n",
111 sms
->Folder
,sms
->Location
,*folderid
,*location
);
114 static void N7110_SetSMSLocation(GSM_StateMachine
*s
, GSM_SMSMessage
*sms
, unsigned char folderid
, int location
)
117 sms
->Location
= (folderid
/ 0x08 - 1) * PHONE_MAXSMSINFOLDER
+ location
;
118 smprintf(s
, "7110 folder %i & location %i -> SMS folder %i & location %i\n",
119 folderid
,location
,sms
->Folder
,sms
->Location
);
122 static GSM_Error
N7110_ReplyGetSMSFolders(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
125 unsigned char buffer
[200];
126 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
128 switch (msg
.Buffer
[3]) {
130 smprintf(s
, "SMS folders names received\n");
131 Data
->SMSFolders
->Number
=msg
.Buffer
[4];
132 for (j
=0;j
<msg
.Buffer
[4];j
++) {
133 smprintf(s
, "Folder index: %02x",msg
.Buffer
[current
]);
135 smprintf(s
, ", folder name: \"");
136 CopyUnicodeString(buffer
,msg
.Buffer
+current
);
137 if ((UnicodeLength(buffer
))>GSM_MAX_SMS_FOLDER_NAME_LEN
) {
138 smprintf(s
, "Too long text\n");
139 return GE_UNKNOWNRESPONSE
;
141 CopyUnicodeString(Data
->SMSFolders
->Folder
[j
].Name
,buffer
);
142 smprintf(s
, "%s\"\n",DecodeUnicodeString(buffer
));
143 current
=current
+2+UnicodeLength(buffer
)*2;
144 Data
->SMSFolders
->Folder
[j
].InboxFolder
= false;
145 if (j
==0) Data
->SMSFolders
->Folder
[j
].InboxFolder
= true;
146 Data
->SMSFolders
->Folder
[j
].Memory
= GMT_ME
;
147 if (j
==0 || j
==1) Data
->SMSFolders
->Folder
[j
].InboxFolder
= GMT_MT
;
151 smprintf(s
, "Security error ? No PIN ?\n");
152 return GE_SECURITYERROR
;
154 smprintf(s
, "Wait a moment. Phone is during power on and busy now\n");
155 return GE_SECURITYERROR
;
157 return GE_UNKNOWNRESPONSE
;
160 static GSM_Error
N7110_GetSMSFolders(GSM_StateMachine
*s
, GSM_SMSFolders
*folders
)
162 unsigned char req
[] = {N6110_FRAME_HEADER
, 0x7A, 0x00, 0x00};
164 s
->Phone
.Data
.SMSFolders
=folders
;
165 smprintf(s
, "Getting SMS folders\n");
166 return GSM_WaitFor (s
, req
, 6, 0x14, 4, ID_GetSMSFolders
);
169 static GSM_Error
N7110_ReplyGetSMSFolderStatus(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
172 GSM_Phone_N7110Data
*Priv
= &s
->Phone
.Data
.Priv
.N7110
;
174 smprintf(s
, "SMS folder status received\n");
175 Priv
->LastSMSFolder
.Number
=msg
.Buffer
[4]*256+msg
.Buffer
[5];
176 smprintf(s
, "Number of Entries: %i\n",Priv
->LastSMSFolder
.Number
);
177 smprintf(s
, "Locations: ");
178 for (i
=0;i
<Priv
->LastSMSFolder
.Number
;i
++) {
179 Priv
->LastSMSFolder
.Location
[i
]=msg
.Buffer
[6+(i
*2)]*256+msg
.Buffer
[(i
*2)+7];
180 if (Priv
->LastSMSFolder
.Location
[i
] > PHONE_MAXSMSINFOLDER
) {
181 smprintf(s
, "Increase PHONE_MAXSMSINFOLDER\n");
182 return GE_UNKNOWNRESPONSE
;
184 smprintf(s
, "%i ",Priv
->LastSMSFolder
.Location
[i
]);
187 NOKIA_SortSMSFolderStatus(s
, &Priv
->LastSMSFolder
);
191 static GSM_Error
N7110_PrivGetSMSFolderStatus(GSM_StateMachine
*s
, int folderid
)
193 unsigned char req
[] = {
194 N7110_FRAME_HEADER
, 0x6b,
200 smprintf(s
, "Getting SMS folder status\n");
201 return GSM_WaitFor (s
, req
, 7, 0x14, 4, ID_GetSMSFolderStatus
);
204 static GSM_Error
N7110_GetSMSFolderStatus(GSM_StateMachine
*s
, int folderid
)
208 GSM_NOKIASMSFolder folder
;
210 error
= N7110_PrivGetSMSFolderStatus(s
,folderid
);
211 /* 0x08 contais read Inbox, 0xf8 unread Inbox.
212 * we want all msg from Inbox, so read both 0x08 and 0xf8 */
213 if (folderid
==0x08 && error
==GE_NONE
) {
214 folder
=s
->Phone
.Data
.Priv
.N7110
.LastSMSFolder
;
215 error
= N7110_PrivGetSMSFolderStatus(s
,0xf8);
216 if (error
==GE_NONE
) {
217 for (i
=0;i
<folder
.Number
;i
++) {
218 s
->Phone
.Data
.Priv
.N7110
.LastSMSFolder
.Location
[s
->Phone
.Data
.Priv
.N7110
.LastSMSFolder
.Number
++]=folder
.Location
[i
];
225 static GSM_SMSMessageLayout N7110_SMSTemplate
= {
226 36 /* SMS Text */, 17 /* Phone number */,
227 255 /* SMSC Number */, 15 /* TPDCS */,
228 255 /* SendingDateTime */, 255 /* SMSCDateTime */,
229 255 /* TPStatus */, 16 /* TPUDL */,
230 255 /* TPVP */, 12 /* firstbyte */,
231 255 /* TPMR */, 255 /* TPPID?? */};
233 static GSM_Error
N7110_ReplyGetSMSMessage(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
237 unsigned char output
[500], output2
[500];
238 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
240 switch(msg
.Buffer
[3]) {
242 switch (msg
.Buffer
[8]) {
245 smprintf(s
, "SMS message\n");
246 if (Data
->RequestID
== ID_GetSMSMessage
) {
247 Data
->GetSMSMessage
->Number
=1;
248 NOKIA_DecodeSMSState(s
, msg
.Buffer
[4], &Data
->GetSMSMessage
->SMS
[0]);
249 DCT3_DecodeSMSFrame(s
, &Data
->GetSMSMessage
->SMS
[0],msg
.Buffer
+9);
253 smprintf(s
, "SMS template\n");
254 if (Data
->RequestID
== ID_GetSMSMessage
) {
255 Data
->GetSMSMessage
->Number
=1;
256 NOKIA_DecodeSMSState(s
, msg
.Buffer
[4], &Data
->GetSMSMessage
->SMS
[0]);
257 Data
->GetSMSMessage
->SMS
[0].PDU
=SMS_Submit
;
258 GSM_DecodeSMSFrame(&Data
->GetSMSMessage
->SMS
[0],msg
.Buffer
+9,N7110_SMSTemplate
);
262 smprintf(s
, "Picture Image\n");
263 switch (Data
->RequestID
) {
265 PHONE_GetBitmapWidthHeight(GSM_NokiaPictureImage
, &Width
, &Height
);
266 Data
->Bitmap
->Width
= Width
;
267 Data
->Bitmap
->Height
= Height
;
268 PHONE_DecodeBitmap(GSM_NokiaPictureImage
, msg
.Buffer
+ 51, Data
->Bitmap
);
269 GSM_UnpackSemiOctetNumber(Data
->Bitmap
->Sender
,msg
.Buffer
+22,true);
271 GSM_UnpackSemiOctetNumber(output
,msg
.Buffer
+9,true);
272 smprintf(s
, "SMSC : %s\n",DecodeUnicodeString(output
));
274 Data
->Bitmap
->Text
[0] = 0;
275 Data
->Bitmap
->Text
[1] = 0;
276 if (msg
.Length
!=304) {
277 GSM_UnpackEightBitsToSeven(0, msg
.Length
-304, msg
.Length
-304, msg
.Buffer
+52+PHONE_GetBitmapSize(GSM_NokiaPictureImage
,0,0),output
);
278 DecodeDefault(Data
->Bitmap
->Text
, output
, msg
.Length
- 304, true, NULL
);
281 case ID_GetSMSMessage
:
282 Data
->GetSMSMessage
->Number
= 0;
284 output
[i
++] = 0x30; /* Smart Messaging 3.0 */
285 output
[i
++] = SM30_OTA
;
286 output
[i
++] = 0x01; /* Length */
287 output
[i
++] = 0x00; /* Length */
289 PHONE_GetBitmapWidthHeight(GSM_NokiaPictureImage
, &Width
, &Height
);
291 output
[i
++] = Height
;
293 memcpy(output
+i
,msg
.Buffer
+51,PHONE_GetBitmapSize(GSM_NokiaPictureImage
,0,0));
294 i
= i
+ PHONE_GetBitmapSize(GSM_NokiaPictureImage
,0,0);
295 if (msg
.Length
!=304) {
296 output
[i
++] = SM30_UNICODETEXT
;
298 output
[i
++] = 0; /* Length - later changed */
299 GSM_UnpackEightBitsToSeven(0, msg
.Length
-304, msg
.Length
-304, msg
.Buffer
+52+PHONE_GetBitmapSize(GSM_NokiaPictureImage
,0,0),output2
);
300 DecodeDefault(output
+i
, output2
, msg
.Length
- 304, true, NULL
);
301 output
[i
- 1] = UnicodeLength(output
+i
) * 2;
304 GSM_MakeMultiPartSMS(Data
->GetSMSMessage
,output
,i
,UDH_NokiaProfileLong
,GSM_Coding_8bit
,1,0);
306 Data
->GetSMSMessage
->SMS
[i
].Number
[0]=0;
307 Data
->GetSMSMessage
->SMS
[i
].Number
[1]=0;
311 smprintf(s
, "Unknown SMS type: %i\n",msg
.Buffer
[8]);
312 return GE_UNKNOWNRESPONSE
;
315 smprintf(s
, "Unknown SMS type: %i\n",msg
.Buffer
[8]);
319 switch (msg
.Buffer
[4]) {
321 smprintf(s
, "Too high location ?\n");
322 return GE_INVALIDLOCATION
;
324 smprintf(s
, "Empty\n");
327 smprintf(s
, "ERROR: unknown %i\n",msg
.Buffer
[4]);
330 smprintf(s
, "SMS message info received\n");
331 if (msg
.Length
== 43) {
332 Data
->GetSMSMessage
->SMS
[0].Name
[0] = 0;
333 Data
->GetSMSMessage
->SMS
[0].Name
[1] = 0;
335 CopyUnicodeString(Data
->GetSMSMessage
->SMS
[0].Name
,msg
.Buffer
+43);
337 smprintf(s
, "Name: \"%s\"\n",DecodeUnicodeString(Data
->GetSMSMessage
->SMS
[0].Name
));
340 return GE_UNKNOWNRESPONSE
;
343 static GSM_Error
N7110_PrivGetSMSMessage(GSM_StateMachine
*s
, GSM_MultiSMSMessage
*sms
)
346 unsigned char folderid
;
349 unsigned char req
[] = {
350 N6110_FRAME_HEADER
, 0x07,
351 0x08, /* folder ID */
352 0x00, 0x05, /* location */
354 unsigned char NameReq
[] = {
355 N6110_FRAME_HEADER
, 0x6E,
356 0x08, /* folder ID */
357 0x00, 0x05}; /* location */
359 N7110_GetSMSLocation(s
, &sms
->SMS
[0], &folderid
, &location
);
362 req
[5]=location
/ 256;
365 s
->Phone
.Data
.GetSMSMessage
=sms
;
366 smprintf(s
, "Getting sms\n");
367 error
=GSM_WaitFor (s
, req
, 10, 0x14, 4, ID_GetSMSMessage
);
368 if (error
==GE_NONE
) {
369 NameReq
[4] = folderid
;
370 NameReq
[5] = location
/ 256;
371 NameReq
[6] = location
;
372 smprintf(s
, "Getting sms info\n");
373 error
=GSM_WaitFor (s
, NameReq
, 7, 0x14, 4, ID_GetSMSMessage
);
374 if (error
!= GE_NONE
) return error
;
375 for (i
=0;i
<sms
->Number
;i
++) {
376 N7110_SetSMSLocation(s
, &sms
->SMS
[i
], folderid
, location
);
377 sms
->SMS
[i
].Folder
= folderid
/0x08;
378 sms
->SMS
[i
].InboxFolder
= true;
379 if (folderid
/0x08 != 0x01) sms
->SMS
[i
].InboxFolder
= false;
380 CopyUnicodeString(sms
->SMS
[i
].Name
,sms
->SMS
[0].Name
);
381 sms
->SMS
[i
].Memory
= GMT_ME
;
382 if (folderid
/0x08 == 0x01 || folderid
/0x08 == 0x02) {
383 sms
->SMS
[i
].Memory
= GMT_MT
;
384 if (folderid
/0x08 == 0x01) { /* Inbox */
385 if (sms
->SMS
[i
].State
== GSM_Sent
) sms
->SMS
[i
].Memory
= GMT_ME
;
386 if (sms
->SMS
[i
].State
== GSM_UnSent
) sms
->SMS
[i
].Memory
= GMT_ME
;
387 if (sms
->SMS
[i
].State
== GSM_Read
) sms
->SMS
[i
].Memory
= GMT_SM
;
388 if (sms
->SMS
[i
].State
== GSM_UnRead
) sms
->SMS
[i
].Memory
= GMT_SM
;
390 if (folderid
/0x08 == 0x02) { /* Outbox */
391 if (sms
->SMS
[i
].State
== GSM_Sent
) sms
->SMS
[i
].Memory
= GMT_SM
;
392 if (sms
->SMS
[i
].State
== GSM_UnSent
) sms
->SMS
[i
].Memory
= GMT_SM
;
393 if (sms
->SMS
[i
].State
== GSM_Read
) sms
->SMS
[i
].Memory
= GMT_ME
;
394 if (sms
->SMS
[i
].State
== GSM_UnRead
) sms
->SMS
[i
].Memory
= GMT_ME
;
402 static GSM_Error
N7110_GetSMSMessage(GSM_StateMachine
*s
, GSM_MultiSMSMessage
*sms
)
405 unsigned char folderid
;
407 GSM_Phone_N7110Data
*Priv
= &s
->Phone
.Data
.Priv
.N7110
;
411 N7110_GetSMSLocation(s
, &sms
->SMS
[0], &folderid
, &location
);
412 error
=N7110_GetSMSFolderStatus(s
, folderid
);
413 if (error
!=GE_NONE
) return error
;
414 for (i
=0;i
<Priv
->LastSMSFolder
.Number
;i
++) {
415 if (Priv
->LastSMSFolder
.Location
[i
]==location
) {
420 if (!found
) return GE_EMPTY
;
421 return N7110_PrivGetSMSMessage(s
,sms
);
424 static GSM_Error
N7110_GetNextSMSMessage(GSM_StateMachine
*s
, GSM_MultiSMSMessage
*sms
, bool start
)
426 GSM_Phone_N7110Data
*Priv
= &s
->Phone
.Data
.Priv
.N7110
;
427 unsigned char folderid
;
431 bool findnextfolder
= false;
436 error
=N7110_GetSMSFolders(s
,&Priv
->LastSMSFolders
);
437 if (error
!=GE_NONE
) return error
;
439 N7110_GetSMSLocation(s
, &sms
->SMS
[0], &folderid
, &location
);
440 for (i
=0;i
<Priv
->LastSMSFolder
.Number
;i
++) {
441 if (Priv
->LastSMSFolder
.Location
[i
]==location
) break;
443 /* Is this last location in this folder ? */
444 if (i
==Priv
->LastSMSFolder
.Number
-1) {
447 location
=Priv
->LastSMSFolder
.Location
[i
+1];
450 if (findnextfolder
) {
451 Priv
->LastSMSFolder
.Number
=0;
452 while (Priv
->LastSMSFolder
.Number
==0) {
453 folderid
=folderid
+0x08;
454 /* Too high folder number */
455 if ((folderid
/0x08)>Priv
->LastSMSFolders
.Number
) return GE_EMPTY
;
456 /* Get next folder status */
457 error
=N7110_GetSMSFolderStatus(s
, folderid
);
458 if (error
!=GE_NONE
) return error
;
459 /* First location from this folder */
460 location
=Priv
->LastSMSFolder
.Location
[0];
463 N7110_SetSMSLocation(s
, &sms
->SMS
[0], folderid
, location
);
465 return N7110_PrivGetSMSMessage(s
, sms
);
468 static int N7110_ReturnBinaryRingtoneLocation(char *model
)
470 if (strcmp(model
,"NSE-5") == 0) return 0x72; /* first 0x72 - 7110 */
471 if (strcmp(model
,"NPE-3") == 0) return 0x89; /* first 0x89 - 6210 */
472 if (strcmp(model
,"NHM-3") == 0) return 0x89; /* quess for 6250 */
476 static GSM_Error
N7110_ReplyGetRingtone(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
479 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
481 smprintf(s
, "Ringtone received\n");
482 switch (msg
.Buffer
[3]) {
485 while (msg
.Buffer
[i
]!=0 || msg
.Buffer
[i
+1]!=0) {
488 if (i
>msg
.Length
) return GE_EMPTY
;
490 memcpy(Data
->Ringtone
->Name
,msg
.Buffer
+6,tmp
*2);
491 smprintf(s
, "Name \"%s\"\n",DecodeUnicodeString(Data
->Ringtone
->Name
));
492 /* Looking for end */
495 if (msg
.Buffer
[i
]==0x07 && msg
.Buffer
[i
+1]==0x0b) {
498 if (msg
.Buffer
[i
]==0x0e && msg
.Buffer
[i
+1]==0x0b) {
502 if (i
==msg
.Length
) return GE_EMPTY
;
505 memcpy(Data
->Ringtone
->NokiaBinary
.Frame
,msg
.Buffer
+37,i
-37);
506 Data
->Ringtone
->NokiaBinary
.Length
=i
-37;
509 smprintf(s
, "Invalid location. Too high ?\n");
510 return GE_INVALIDLOCATION
;
512 return GE_UNKNOWNRESPONSE
;
515 static GSM_Error
N7110_GetRingtone(GSM_StateMachine
*s
, GSM_Ringtone
*Ringtone
, bool PhoneRingtone
)
517 unsigned char req
[6] = {N7110_FRAME_HEADER
, 0x22, 0x00, 0x00};
519 if (PhoneRingtone
) return GE_NOTSUPPORTED
;
520 if (Ringtone
->Format
== 0x00) Ringtone
->Format
= RING_NOKIABINARY
;
522 switch (Ringtone
->Format
) {
524 /* In the future get binary and convert */
525 return GE_NOTSUPPORTED
;
526 case RING_NOKIABINARY
:
527 req
[5]=N7110_ReturnBinaryRingtoneLocation(s
->Phone
.Data
.Model
)+Ringtone
->Location
;
528 s
->Phone
.Data
.Ringtone
=Ringtone
;
529 smprintf(s
, "Getting binary ringtone\n");
530 return GSM_WaitFor (s
, req
, 6, 0x1f, 4, ID_GetRingtone
);
532 return GE_NOTSUPPORTED
;
534 return GE_NOTSUPPORTED
;
537 static GSM_Error
N7110_ReplyGetPictureImageInfo(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
540 GSM_Phone_N7110Data
*Priv
= &s
->Phone
.Data
.Priv
.N7110
;
542 smprintf(s
, "Received info for Picture Images\n");
543 smprintf(s
, "Number : %i\n",msg
.Buffer
[4]*256+msg
.Buffer
[5]);
544 smprintf(s
, "Locations :");
545 Priv
->LastPictureImageFolder
.Number
=msg
.Buffer
[4]*256+msg
.Buffer
[5];
546 for (i
=0;i
<Priv
->LastPictureImageFolder
.Number
;i
++) {
547 Priv
->LastPictureImageFolder
.Location
[i
]=msg
.Buffer
[6+i
*2]*256+msg
.Buffer
[7+i
*2];
548 smprintf(s
, " %i",Priv
->LastPictureImageFolder
.Location
[i
]);
554 static GSM_Error
N7110_GetPictureImageLocation(GSM_StateMachine
*s
, GSM_Bitmap
*Bitmap
, unsigned char *folder
, int *location
)
556 GSM_Phone_N7110Data
*Priv
= &s
->Phone
.Data
.Priv
.N7110
;
557 GSM_SMSFolders folders
;
559 int i
, j
= 0, count
= 0;
560 unsigned char req
[7] = {
561 N6110_FRAME_HEADER
, 0x96,
562 0x00, /* Folder ID */
565 error
=N7110_GetSMSFolders (s
, &folders
);
566 if (error
!=GE_NONE
) return error
;
568 for (i
=0;i
<folders
.Number
;i
++) {
569 req
[4] = (i
+1) * 0x08; /* SMS folder ID */
570 error
= GSM_WaitFor (s
, req
, 7, 0x14, 4, ID_GetBitmap
);
571 if (error
!=GE_NONE
) return error
;
572 for (j
=0;j
<Priv
->LastPictureImageFolder
.Number
;j
++) {
574 if (count
==Bitmap
->Location
) break;
576 if (count
==Bitmap
->Location
) break;
578 if (count
!=Bitmap
->Location
) return GE_INVALIDLOCATION
;
579 *folder
= (i
+1) * 0x08; /* SMS Folder ID */
580 *location
= Priv
->LastPictureImageFolder
.Location
[j
];
584 static GSM_Error
N7110_GetPictureImage(GSM_StateMachine
*s
, GSM_Bitmap
*Bitmap
)
586 unsigned char folder
;
589 unsigned char req
[9] = {
590 N6110_FRAME_HEADER
, 0x07,
591 0x00, /* Folder ID */
592 0x00, 0x00, /* Location */
595 error
= N7110_GetPictureImageLocation(s
, Bitmap
, &folder
, &location
);
599 req
[5] = location
/ 256;
600 req
[6] = location
% 256;
601 return GSM_WaitFor (s
, req
, 9, 0x14, 4, ID_GetBitmap
);
607 static GSM_Error
N7110_GetBitmap(GSM_StateMachine
*s
, GSM_Bitmap
*Bitmap
)
611 unsigned char OpReq
[] = {N6110_FRAME_HEADER
, 0x70};
613 s
->Phone
.Data
.Bitmap
=Bitmap
;
614 switch (Bitmap
->Type
) {
615 case GSM_StartupLogo
:
616 smprintf(s
, "Getting startup logo\n");
617 return N71_92_GetPhoneSetting(s
, ID_GetBitmap
, 0x15);
618 case GSM_WelcomeNoteText
:
619 smprintf(s
, "Getting welcome note\n");
620 return N71_92_GetPhoneSetting(s
, ID_GetBitmap
, 0x02);
621 case GSM_DealerNoteText
:
622 smprintf(s
, "Getting dealer note\n");
623 return N71_92_GetPhoneSetting(s
, ID_GetBitmap
, 0x17);
625 pbk
.MemoryType
= GMT7110_CG
;
626 pbk
.Location
= Bitmap
->Location
;
627 smprintf(s
, "Getting caller group logo\n");
628 error
=N7110_GetMemory(s
,&pbk
);
629 if (error
==GE_NONE
) NOKIA_GetDefaultCallerGroupName(s
,Bitmap
);
631 case GSM_OperatorLogo
:
632 smprintf(s
, "Getting operator logo\n");
633 /* This is like DCT3_GetNetworkInfo */
634 return GSM_WaitFor (s
, OpReq
, 4, 0x0a, 4, ID_GetBitmap
);
635 case GSM_PictureImage
:
636 /* 7110 doesn't support it */
637 if (strcmp(s
->Phone
.Data
.Model
,"NSE-5") == 0) return GE_NOTSUPPORTED
;
638 return N7110_GetPictureImage(s
, Bitmap
);
642 return GE_NOTSUPPORTED
;
645 static GSM_Error
N7110_SetRingtone(GSM_StateMachine
*s
, GSM_Ringtone
*Ringtone
, int *maxlength
)
649 GSM_NetworkInfo NetInfo
;
651 unsigned char req
[1000] = {
652 0x7C, 0x01, 0x00, 0x0D, 0x00,
653 0x00, 0x00, 0x00, 0x00, 0x00,
655 unsigned char req2
[4000] = {
656 N7110_FRAME_HEADER
, 0x1F, 0x00,
658 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
659 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
660 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
661 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
662 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
664 switch (Ringtone
->Format
) {
666 if (Ringtone
->Location
==255)
668 /* 7110 doesn't support it */
669 if (strcmp(s
->Phone
.Data
.Model
,"NSE-5") == 0) return GE_NOTSUPPORTED
;
670 *maxlength
=GSM_EncodeNokiaRTTLRingtone(*Ringtone
, req
+11, &size
);
672 error
= s
->Protocol
.Functions
->WriteMessage(s
, req
, size
+11, 0x00);
673 if (error
!=GE_NONE
) return error
;
675 /* We have to make something (not important, what) now */
676 /* no answer from phone*/
677 return DCT3_GetNetworkInfo(s
,&NetInfo
);
679 GSM_RingtoneConvert(&dest
, Ringtone
, RING_NOKIABINARY
);
681 case RING_NOKIABINARY
:
682 memcpy(&dest
,Ringtone
,sizeof(GSM_Ringtone
));
685 return GE_NOTSUPPORTED
;
687 req2
[5]=N7110_ReturnBinaryRingtoneLocation(s
->Phone
.Data
.Model
)+Ringtone
->Location
;
688 CopyUnicodeString(req2
+6,Ringtone
->Name
);
689 memcpy(req2
+37,dest
.NokiaBinary
.Frame
,dest
.NokiaBinary
.Length
);
690 error
= s
->Protocol
.Functions
->WriteMessage(s
, req2
, 37+dest
.NokiaBinary
.Length
, 0x1F);
691 if (error
!=GE_NONE
) return error
;
693 /* We have to make something (not important, what) now */
694 /* no answer from phone*/
695 return DCT3_GetNetworkInfo(s
,&NetInfo
);
698 static GSM_Error
N7110_ReplySaveSMSMessage(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
700 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
702 switch (msg
.Buffer
[3]) {
704 smprintf(s
, "SMS message saving status\n");
705 smprintf(s
, "Saved in folder %i at location %i\n",msg
.Buffer
[4], msg
.Buffer
[5]*256+msg
.Buffer
[6]);
706 if (msg
.Buffer
[4] == 0xf8) {
707 N7110_SetSMSLocation(s
, Data
->SaveSMSMessage
,0x08,msg
.Buffer
[5]*256+msg
.Buffer
[6]);
708 Data
->SaveSMSMessage
->Folder
= 0x01;
710 N7110_SetSMSLocation(s
, Data
->SaveSMSMessage
,msg
.Buffer
[4],msg
.Buffer
[5]*256+msg
.Buffer
[6]);
711 Data
->SaveSMSMessage
->Folder
= msg
.Buffer
[4] / 0x08;
715 smprintf(s
, "SMS message saving status\n");
716 switch (msg
.Buffer
[4]) {
718 smprintf(s
, "Too high location ?\n");
719 return GE_INVALIDLOCATION
;
721 smprintf(s
, "ERROR: unknown %i\n",msg
.Buffer
[4]);
725 smprintf(s
, "Name for SMS changed OK to \"%s\"\n",DecodeUnicodeString(msg
.Buffer
+7));
726 smprintf(s
, "Saved in folder %i at location %i\n",msg
.Buffer
[4], msg
.Buffer
[5]*256+msg
.Buffer
[6]);
727 if (msg
.Buffer
[4] == 0xf8) {
728 N7110_SetSMSLocation(s
, Data
->SaveSMSMessage
,0x08,msg
.Buffer
[5]*256+msg
.Buffer
[6]);
729 Data
->SaveSMSMessage
->Folder
= 0x01;
731 N7110_SetSMSLocation(s
, Data
->SaveSMSMessage
,msg
.Buffer
[4],msg
.Buffer
[5]*256+msg
.Buffer
[6]);
732 Data
->SaveSMSMessage
->Folder
= msg
.Buffer
[4] / 0x08;
736 return GE_UNKNOWNRESPONSE
;
739 static GSM_Error
N7110_PrivSetSMSMessage(GSM_StateMachine
*s
, GSM_SMSMessage
*sms
)
741 int length
, location
;
742 unsigned char folderid
, folder
;
744 unsigned char req
[256] = {
745 N6110_FRAME_HEADER
, 0x04,
746 0x03, /* sms state */
748 0x00,0x00, /* location */
750 unsigned char NameReq
[200] = {N6110_FRAME_HEADER
, 0x83};
752 switch (sms
->State
) {
753 case GSM_Read
: req
[4] = 0x01; break;
754 case GSM_UnRead
: req
[4] = 0x03; break;
755 case GSM_Sent
: req
[4] = 0x05; break;
756 case GSM_UnSent
: req
[4] = 0x07; break;
759 N7110_GetSMSLocation(s
, sms
, &folderid
, &location
);
761 req
[6] = location
/ 256;
765 if (folderid
== 0x10 && (sms
->State
== GSM_Sent
|| sms
->State
== GSM_UnSent
)) {
766 /* We will use SIM Outbox */
767 sms
->PDU
= SMS_Submit
;
770 if (folderid
== 0x08 && sms
->State
== GSM_UnRead
) {
771 /* We will use SIM Inbox */
777 error
= PHONE_EncodeSMSFrame(s
,sms
,req
+9,PHONE_SMSDeliver
,&length
,true);
780 smprintf(s
, "Saving SMS template\n");
781 error
= PHONE_EncodeSMSFrame(s
,sms
,req
+9,N7110_SMSTemplate
,&length
,true);
782 req
[8] = 0x02; /* SMS Template info */
787 if (error
!= GE_NONE
) return error
;
789 s
->Phone
.Data
.SaveSMSMessage
=sms
;
790 smprintf(s
, "Saving sms\n");
791 error
=GSM_WaitFor (s
, req
, 9+length
, 0x14, 4, ID_SaveSMSMessage
);
792 if (error
== GE_NONE
&& UnicodeLength(sms
->Name
)!=0) {
793 folder
= sms
->Folder
;
795 N7110_GetSMSLocation(s
, sms
, &folderid
, &location
);
797 NameReq
[length
++] = folderid
;
798 NameReq
[length
++] = location
/ 256;
799 NameReq
[length
++] = location
;
800 CopyUnicodeString(NameReq
+length
, sms
->Name
);
801 length
= length
+UnicodeLength(sms
->Name
)*2;
802 NameReq
[length
++] = 0;
803 NameReq
[length
++] = 0;
804 error
=GSM_WaitFor (s
, NameReq
, length
, 0x14, 4, ID_SaveSMSMessage
);
805 sms
->Folder
= folder
;
810 static GSM_Error
N7110_SetSMS(GSM_StateMachine
*s
, GSM_SMSMessage
*sms
)
813 unsigned char folderid
;
815 N7110_GetSMSLocation(s
, sms
, &folderid
, &location
);
816 if (location
== 0) return GE_INVALIDLOCATION
;
817 return N7110_PrivSetSMSMessage(s
, sms
);
820 static GSM_Error
N7110_AddSMS(GSM_StateMachine
*s
, GSM_SMSMessage
*sms
)
823 unsigned char folderid
;
825 N7110_GetSMSLocation(s
, sms
, &folderid
, &location
);
827 N7110_SetSMSLocation(s
, sms
, folderid
, location
);
828 return N7110_PrivSetSMSMessage(s
, sms
);
831 static GSM_Error
N7110_ReplyClearOperatorLogo(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
833 smprintf(s
, "Clearing operator logo.....\n");
837 static GSM_Error
N7110_ReplySetOperatorLogo(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
839 smprintf(s
, "Setting operator logo.....\n");
843 static GSM_Error
N7110_SetCallerLogo(GSM_StateMachine
*s
, GSM_Bitmap
*bitmap
)
845 unsigned char req
[500] = {
846 N6110_FRAME_HEADER
, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0c,
847 0x00, 0x10, /* memory type */
848 0x00, 0x00, /* location */
852 unsigned int count
= 18;
855 req
[13] = bitmap
->Location
;
858 if (bitmap
->DefaultBitmap
) {
862 string
[0] = bitmap
->Enabled
?1:0;
865 count
+= N71_65_PackPBKBlock(s
, N7110_ENTRYTYPE_LOGOON
, 2, block
++, string
, req
+ count
);
868 if (!bitmap
->DefaultRingtone
) {
869 string
[0] = bitmap
->Ringtone
;
871 count
+= N71_65_PackPBKBlock(s
, N7110_ENTRYTYPE_RINGTONE
, 2, block
++, string
, req
+ count
);
874 /* Number of group */
875 string
[0] = bitmap
->Location
;
877 count
+= N71_65_PackPBKBlock(s
, N7110_ENTRYTYPE_GROUP
, 2, block
++, string
, req
+ count
);
880 if (!bitmap
->DefaultName
) {
881 i
= UnicodeLength(bitmap
->Text
) * 2;
883 memcpy(string
+ 1, bitmap
->Text
, i
);
885 count
+= N71_65_PackPBKBlock(s
, N7110_ENTRYTYPE_NAME
, i
+ 2, block
++, string
, req
+ count
);
889 if (bitmap
->DefaultBitmap
) {
892 GSM_ClearBitmap(bitmap
);
894 PHONE_GetBitmapWidthHeight(GSM_NokiaCallerLogo
, &Width
, &Height
);
899 string
[4] = PHONE_GetBitmapSize(GSM_NokiaCallerLogo
,0,0);
900 PHONE_EncodeBitmap(GSM_NokiaCallerLogo
, string
+ 5, bitmap
);
901 count
+= N71_65_PackPBKBlock(s
, N7110_ENTRYTYPE_GROUPLOGO
, PHONE_GetBitmapSize(GSM_NokiaCallerLogo
,0,0) + 5, block
++, string
, req
+ count
);
905 return GSM_WaitFor (s
, req
, count
, 0x03, 4, ID_SetBitmap
);
908 static GSM_Error
N7110_ReplySetPicture(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
910 smprintf(s
, "Picture Image written OK, folder %i, location %i\n",msg
.Buffer
[4],msg
.Buffer
[5]*256+msg
.Buffer
[6]);
914 static GSM_Error
N7110_SetPictureImage(GSM_StateMachine
*s
, GSM_Bitmap
*Bitmap
)
916 unsigned char folder
;
921 GSM_Phone_Bitmap_Types Type
= GSM_NokiaPictureImage
;
923 unsigned char req
[500] = {
924 N6110_FRAME_HEADER
, 0x50, 0x07,
926 0x00, 0x00, /* index */
929 error
=N7110_GetPictureImageLocation(s
, Bitmap
, &folder
, &location
);
933 req
[6] = location
/ 256;
934 req
[7] = location
% 256;
936 case GE_INVALIDLOCATION
:
937 req
[5] = 0x21; /* Save in Templates folder */
946 for (i
=0;i
<36;i
++) req
[i
+9]=0;
949 if (UnicodeLength(Bitmap
->Text
)==0) {
950 count
+=2 ;req
[count
]=0x0c;
951 count
+=2 ;req
[count
]=0x0d;
952 count
+=2 ;req
[count
]=0x0e;
953 count
+=2 ;req
[count
]=0x0f;
954 count
+=2 ;req
[count
]=0x10;
955 count
+=2 ;req
[count
]=0x11;
956 count
+=23;req
[count
]=0x02;
959 count
+=2 ;req
[count
]=0x54;
960 count
++ ;req
[count
]=0xd4;
961 count
++ ;req
[count
]=0x0d;
962 count
+=2 ;req
[count
]=0x0e;
963 count
+=2 ;req
[count
]=0x0f;
964 count
+=2 ;req
[count
]=0x10;
965 count
+=2 ;req
[count
]=0x11;
966 count
+=21;req
[count
]=0x01;
972 PHONE_GetBitmapWidthHeight(Type
, &Width
, &Height
);
973 req
[count
++] = Width
;
974 req
[count
++] = Height
;
975 req
[count
++] = PHONE_GetBitmapSize(Type
,0,0) / 256;
976 req
[count
++] = PHONE_GetBitmapSize(Type
,0,0) % 256;
977 PHONE_EncodeBitmap(Type
, req
+ count
, Bitmap
);
978 count
+= PHONE_GetBitmapSize(Type
,0,0);
979 if (UnicodeLength(Bitmap
->Text
)!=0)
981 req
[count
] = UnicodeLength(Bitmap
->Text
);
982 GSM_PackSevenBitsToEight(0, Bitmap
->Text
, req
+count
+1,strlen(Bitmap
->Text
));
983 count
= count
+ req
[count
];
988 smprintf(s
, "Setting Picture Image\n");
989 return GSM_WaitFor (s
, req
, count
, 0x14, 4, ID_SetBitmap
);
992 static GSM_Error
N7110_SetBitmap(GSM_StateMachine
*s
, GSM_Bitmap
*Bitmap
)
995 GSM_Phone_Bitmap_Types Type
;
996 int Width
, Height
, i
;
997 unsigned char reqStartup
[1000] = {
998 N7110_FRAME_HEADER
, 0xec,
999 0x15, /* Startup Logo setting */
1000 0x00, 0x00, 0x00, 0x04, 0xc0, 0x02, 0x00,
1001 0x00, /* Bitmap height */
1003 0x00, /* Bitmap width */
1004 0xc0, 0x04, 0x03, 0x00};
1005 unsigned char reqOp
[1000] = {
1006 N7110_FRAME_HEADER
, 0xa3, 0x01,
1007 0x00, /* logo disabled */
1008 0x00, 0xf0, 0x00, /* network code (000 00) */
1010 0x08, /* length of rest */
1011 0x00, 0x00, /* Bitmap width / height */
1013 0x00, /* Bitmap size */
1015 unsigned char reqClrOp
[] = {0x00, 0x01, 0x00, 0xaf, 0x00};
1016 unsigned char reqStartupText
[500] = {
1017 N7110_FRAME_HEADER
, 0xec,
1018 0x02}; /* Startup Text setting */
1020 switch (Bitmap
->Type
) {
1021 case GSM_StartupLogo
:
1022 if (Bitmap
->Location
!=1) return GE_NOTSUPPORTED
;
1023 Type
=GSM_Nokia6210StartupLogo
;
1024 if (strcmp(s
->Phone
.Data
.Model
,"NSE-5") == 0) Type
=GSM_Nokia7110StartupLogo
;
1025 PHONE_GetBitmapWidthHeight(Type
, &Width
, &Height
);
1026 reqStartup
[12] = Height
;
1027 reqStartup
[16] = Width
;
1028 PHONE_EncodeBitmap(Type
, reqStartup
+ 21, Bitmap
);
1029 smprintf(s
, "Setting startup logo\n");
1030 return GSM_WaitFor (s
, reqStartup
, 21+PHONE_GetBitmapSize(Type
,0,0), 0x7A, 4, ID_SetBitmap
);
1031 case GSM_WelcomeNoteText
:
1032 CopyUnicodeString(reqStartupText
+ 5, Bitmap
->Text
);
1033 i
= 6 + UnicodeLength(Bitmap
->Text
) * 2;
1034 reqStartupText
[i
++] = 0;
1035 reqStartupText
[i
++] = 0;
1036 return GSM_WaitFor (s
, reqStartupText
, i
, 0x7A, 4, ID_SetBitmap
);
1037 case GSM_DealerNoteText
:
1038 reqStartupText
[4] = 0x17;
1039 CopyUnicodeString(reqStartupText
+ 5, Bitmap
->Text
);
1040 i
= 6 + UnicodeLength(Bitmap
->Text
) * 2;
1041 reqStartupText
[i
++] = 0;
1042 reqStartupText
[i
++] = 0;
1043 return GSM_WaitFor (s
, reqStartupText
, i
, 0x7A, 4, ID_SetBitmap
);
1044 case GSM_OperatorLogo
:
1045 /* We want to set operator logo, not clear */
1046 if (strcmp(Bitmap
->NetworkCode
,"000 00")) {
1047 reqOp
[5] = 0x01; /* Logo enabled */
1048 NOKIA_EncodeNetworkCode(reqOp
+6, Bitmap
->NetworkCode
);
1049 Type
= GSM_Nokia7110OperatorLogo
;
1050 reqOp
[11] = 8 + PHONE_GetBitmapSize(Type
,0,0);
1051 PHONE_GetBitmapWidthHeight(Type
, &Width
, &Height
);
1054 reqOp
[15]=PHONE_GetBitmapSize(Type
,0,0);
1055 PHONE_EncodeBitmap(Type
, reqOp
+ 18, Bitmap
);
1056 smprintf(s
, "Setting operator logo\n");
1057 return GSM_WaitFor (s
, reqOp
, 18+PHONE_GetBitmapSize(Type
,0,0), 0x0A, 4, ID_SetBitmap
);
1059 smprintf(s
, "Clearing operator logo\n");
1062 error
=GSM_WaitFor (s
, reqClrOp
, 5, 0x0A, 4, ID_SetBitmap
);
1063 if (error
!=GE_NONE
) return error
;
1065 return GSM_WaitFor (s
, reqOp
, 18, 0x0A, 4, ID_SetBitmap
);
1067 case GSM_CallerLogo
:
1068 return N7110_SetCallerLogo(s
,Bitmap
);
1069 case GSM_PictureImage
:
1070 return N7110_SetPictureImage(s
,Bitmap
);
1074 return GE_NOTSUPPORTED
;
1077 static GSM_Error
N7110_ReplyDeleteMemory(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1079 smprintf(s
, "Phonebook entry deleted\n");
1083 static GSM_Error
N7110_DeleteMemory(GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
)
1085 unsigned char req
[] = {
1086 N7110_FRAME_HEADER
, 0x0f, 0x00, 0x01,
1087 0x04, 0x00, 0x00, 0x0c, 0x01, 0xff,
1088 0x00, 0x01, /* location */
1089 0x05, /* memory type */
1092 req
[12] = (entry
->Location
>> 8);
1093 req
[13] = entry
->Location
& 0xff;
1095 req
[14] = NOKIA_GetMemoryType(s
, entry
->MemoryType
,N71_65_MEMORY_TYPES
);
1096 if (req
[14]==0xff) return GE_NOTSUPPORTED
;
1098 smprintf(s
, "Deleting phonebook entry\n");
1099 return GSM_WaitFor (s
, req
, 18, 0x03, 4, ID_SetMemory
);
1102 static GSM_Error
N7110_SetMemory(GSM_StateMachine
*s
, GSM_MemoryEntry
*entry
)
1104 int count
= 18, blocks
;
1105 unsigned char req
[500] = {
1106 N7110_FRAME_HEADER
, 0x0b, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0c,
1107 0x00, 0x00, /* memory type */
1108 0x00, 0x00, /* location */
1111 if (entry
->Location
== 0) return GE_NOTSUPPORTED
;
1113 req
[11] = NOKIA_GetMemoryType(s
, entry
->MemoryType
,N71_65_MEMORY_TYPES
);
1114 if (req
[11]==0xff) return GE_NOTSUPPORTED
;
1116 req
[12] = (entry
->Location
>> 8);
1117 req
[13] = entry
->Location
& 0xff;
1119 count
= count
+ N71_65_EncodePhonebookFrame(s
, req
+18, *entry
, &blocks
, false, IsPhoneFeatureAvailable(s
->Phone
.Data
.ModelInfo
, F_VOICETAGS
));
1122 smprintf(s
, "Writing phonebook entry\n");
1123 return GSM_WaitFor (s
, req
, count
, 0x03, 4, ID_SetMemory
);
1126 static GSM_Error
N7110_DeleteSMS(GSM_StateMachine
*s
, GSM_SMSMessage
*sms
)
1128 unsigned char folderid
;
1130 unsigned char req
[] = {
1131 N7110_FRAME_HEADER
, 0x0a,
1133 0x00, 0x00, /* location */
1136 N7110_GetSMSLocation(s
, sms
, &folderid
, &location
);
1138 req
[5] = location
/ 256;
1141 smprintf(s
, "Deleting sms\n");
1142 return GSM_WaitFor (s
, req
, 8, 0x14, 4, ID_DeleteSMSMessage
);
1145 static GSM_Error
N7110_ReplyGetSMSStatus(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1147 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
1149 smprintf(s
, "SMS status received\n");
1150 switch (msg
.Buffer
[3]) {
1152 smprintf(s
, "Used in phone memory : %i\n",msg
.Buffer
[10]*256+msg
.Buffer
[11]);
1153 smprintf(s
, "Unread in phone memory : %i\n",msg
.Buffer
[12]*256+msg
.Buffer
[13]);
1154 smprintf(s
, "Used in SIM : %i\n",msg
.Buffer
[14]*256+msg
.Buffer
[15]);
1155 smprintf(s
, "Unread in SIM : %i\n",msg
.Buffer
[16]*256+msg
.Buffer
[17]);
1156 smprintf(s
, "SIM size : %i\n",msg
.Buffer
[8]*256+msg
.Buffer
[9]);
1157 Data
->SMSStatus
->SIMUsed
= msg
.Buffer
[14]*256+msg
.Buffer
[15];
1158 Data
->SMSStatus
->SIMUnRead
= msg
.Buffer
[16]*256+msg
.Buffer
[17];
1159 Data
->SMSStatus
->SIMSize
= msg
.Buffer
[8]*256+msg
.Buffer
[9];
1160 Data
->SMSStatus
->PhoneUsed
= msg
.Buffer
[10]*256+msg
.Buffer
[11];
1161 Data
->SMSStatus
->PhoneUnRead
= msg
.Buffer
[12]*256+msg
.Buffer
[13];
1162 Data
->SMSStatus
->PhoneSize
= 150;
1165 smprintf(s
, "Error. No PIN ?\n");
1166 return GE_SECURITYERROR
;
1168 return GE_UNKNOWNRESPONSE
;
1171 static GSM_Error
N7110_GetSMSStatus(GSM_StateMachine
*s
, GSM_SMSMemoryStatus
*status
)
1174 GSM_Phone_N7110Data
*Priv
= &s
->Phone
.Data
.Priv
.N7110
;
1176 error
= DCT3_GetSMSStatus(s
,status
);
1177 if (error
!= GE_NONE
) return error
;
1180 /* Nokia 6210 and family does not show not "fixed" messages from the
1181 * Templates folder, ie. when you save a message to the Templates folder,
1182 * SMSStatus does not change! Workaround: get Templates folder status, which
1183 * does show these messages.
1186 error
= N7110_GetSMSFolderStatus(s
, 0x20);
1187 if (error
!= GE_NONE
) return error
;
1188 status
->TemplatesUsed
= Priv
->LastSMSFolder
.Number
;
1193 static GSM_Error
N7110_ReplyGetProfileFeature(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1195 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
1197 switch (msg
.Buffer
[3]) {
1199 smprintf(s
, "Profile feature %02x with value %02x\n",msg
.Buffer
[6],msg
.Buffer
[10]);
1200 switch (msg
.Buffer
[6]) {
1202 smprintf(s
, "Ringtone ID\n");
1203 Data
->Profile
->FeatureID
[Data
->Profile
->FeaturesNumber
] = Profile_RingtoneID
;
1204 Data
->Profile
->FeatureValue
[Data
->Profile
->FeaturesNumber
] = msg
.Buffer
[10];
1205 Data
->Profile
->FeaturesNumber
++;
1207 case 0x08: /* Caller groups */
1208 NOKIA_FindFeatureValue(s
, Profile71_65
,msg
.Buffer
[6],msg
.Buffer
[10],Data
,true);
1210 case 0x09: /* Autoanswer */
1211 if (Data
->Profile
->CarKitProfile
|| Data
->Profile
->HeadSetProfile
) {
1212 NOKIA_FindFeatureValue(s
, Profile71_65
,msg
.Buffer
[6],msg
.Buffer
[10],Data
,false);
1216 CopyUnicodeString(Data
->Profile
->Name
, msg
.Buffer
+10);
1217 smprintf(s
, "profile Name: \"%s\"\n", DecodeUnicodeString(Data
->Profile
->Name
));
1218 Data
->Profile
->DefaultName
= false;
1221 NOKIA_FindFeatureValue(s
, Profile71_65
,msg
.Buffer
[6],msg
.Buffer
[10],Data
,false);
1225 return GE_UNKNOWNRESPONSE
;
1228 static GSM_Error
N7110_GetProfile(GSM_StateMachine
*s
, GSM_Profile
*Profile
)
1232 unsigned char Features
[12] = {
1233 0x00,0x02,0x03,0x04,0x05,0x06,
1234 0x07,0x08,0x09,0xff,
1236 unsigned char req
[] = {
1237 N6110_FRAME_HEADER
, 0x01, 0x01, 0x01, 0x01,
1238 0x00, /* Profile Location */
1239 0xff}; /* Feature number */
1241 if (Profile
->Location
> 7) return GE_INVALIDLOCATION
;
1243 Profile
->CarKitProfile
= false;
1244 Profile
->HeadSetProfile
= false;
1245 if (Profile
->Location
== 6) Profile
->CarKitProfile
= true;
1246 if (Profile
->Location
== 7) Profile
->HeadSetProfile
= true;
1248 Profile
->FeaturesNumber
= 0;
1250 s
->Phone
.Data
.Profile
=Profile
;
1251 for (i
= 0; i
< 10; i
++) {
1252 req
[7] = Profile
->Location
;
1253 req
[8] = Features
[i
];
1254 smprintf(s
, "Getting profile feature\n");
1255 error
= GSM_WaitFor (s
, req
, 9, 0x39, 4, ID_GetProfile
);
1256 if (error
!=GE_NONE
) return error
;
1258 NOKIA_GetDefaultProfileName(s
, Profile
);
1259 Profile
->Active
= false;
1263 static GSM_Error
N7110_ReplySetProfileFeature(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1265 smprintf(s
, "Profile feature set\n");
1269 static GSM_Error
N7110_SetProfile(GSM_StateMachine
*s
, GSM_Profile
*Profile
)
1273 unsigned char ID
,Value
;
1275 unsigned char req
[] = {
1276 N6110_FRAME_HEADER
, 0x03, 0x01, 0x01, 0x03,
1277 0x02, /* feature number */
1278 0x01, /* Profile Location */
1282 for (i
=0;i
<Profile
->FeaturesNumber
;i
++) {
1284 switch (Profile
->FeatureID
[i
]) {
1285 case Profile_RingtoneID
:
1287 Value
= Profile
->FeatureValue
[i
];
1291 found
=NOKIA_FindPhoneFeatureValue(
1294 Profile
->FeatureID
[i
],Profile
->FeatureValue
[i
],
1299 req
[8] = Profile
->Location
;
1301 smprintf(s
, "Setting profile feature\n");
1302 error
= GSM_WaitFor (s
, req
, 11, 0x39, 4, ID_SetProfile
);
1303 if (error
!=GE_NONE
) return error
;
1309 static GSM_Error
N7110_GetSpeedDial(GSM_StateMachine
*s
, GSM_SpeedDial
*SpeedDial
)
1311 GSM_MemoryEntry pbk
;
1314 pbk
.MemoryType
= GMT7110_SP
;
1315 pbk
.Location
= SpeedDial
->Location
;
1316 SpeedDial
->MemoryLocation
= 0;
1317 s
->Phone
.Data
.SpeedDial
= SpeedDial
;
1319 smprintf(s
, "Getting speed dial\n");
1320 error
=N7110_GetMemory(s
,&pbk
);
1322 case GE_NOTSUPPORTED
:
1323 smprintf(s
, "No speed dials set in phone\n");
1326 if (SpeedDial
->MemoryLocation
== 0) {
1327 smprintf(s
, "Speed dial not assigned or error in firmware\n");
1336 static GSM_Error
N7110_ReplyIncomingSMS(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1339 GSM_Phone_Data
*Data
= &s
->Phone
.Data
;
1342 smprintf(s
, "SMS message received\n");
1343 sms
.State
= GSM_UnRead
;
1344 sms
.InboxFolder
= true;
1345 DCT3_DecodeSMSFrame(s
, &sms
,msg
.Buffer
+8);
1347 if (Data
->EnableIncomingSMS
&& s
->User
.IncomingSMS
!=NULL
) {
1348 sms
.State
= GSM_UnRead
;
1349 sms
.InboxFolder
= true;
1350 DCT3_DecodeSMSFrame(s
, &sms
,msg
.Buffer
+8);
1352 s
->User
.IncomingSMS(s
->CurrentConfig
->Device
,sms
);
1357 static GSM_Error
N7110_Initialise (GSM_StateMachine
*s
)
1360 DCT3_SetIncomingCB(s
,true);
1362 #ifdef GSM_ENABLE_N71_92INCOMINGINFO
1363 /* Enables various things like incoming SMS, call info, etc. */
1364 return N71_65_EnableFunctions (s
, "\x01\x02\x06\x0A\x14\x17", 6);
1369 static GSM_Error
N7110_ReplyGetCalendarInfo(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1371 /* Old method 1 for accessing calendar */
1372 return N71_65_ReplyGetCalendarInfo1(msg
, s
, &s
->Phone
.Data
.Priv
.N7110
.LastCalendar
);
1376 static GSM_Error
N7110_ReplyGetCalendarNotePos(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1378 /* Old method 1 for accessing calendar */
1379 return N71_65_ReplyGetCalendarNotePos1(msg
, s
, &s
->Phone
.Data
.Priv
.N7110
.FirstCalendarPos
);
1383 static GSM_Error
N7110_GetNextCalendar(GSM_StateMachine
*s
, GSM_CalendarEntry
*Note
, bool start
)
1385 return N71_65_GetNextCalendar1(s
,Note
,start
,&s
->Phone
.Data
.Priv
.N7110
.LastCalendar
,&s
->Phone
.Data
.Priv
.N7110
.LastCalendarYear
,&s
->Phone
.Data
.Priv
.N7110
.LastCalendarPos
);
1386 // return N71_65_GetNextCalendar2(s,Note,start,&s->Phone.Data.Priv.N7110.LastCalendarYear,&s->Phone.Data.Priv.N7110.LastCalendarPos);
1389 static GSM_Error
N7110_GetCalendarStatus(GSM_StateMachine
*s
, GSM_CalendarStatus
*Status
)
1394 error
=N71_65_GetCalendarInfo1(s
, &s
->Phone
.Data
.Priv
.N7110
.LastCalendar
);
1395 if (error
!=GE_NONE
) return error
;
1396 Status
->Used
= s
->Phone
.Data
.Priv
.N6510
.LastCalendar
.Number
;
1400 // return GE_NOTSUPPORTED;
1403 static GSM_Error
N7110_AddCalendar(GSM_StateMachine
*s
, GSM_CalendarEntry
*Note
)
1405 // return N71_65_AddCalendar1(s, Note, NULL);
1406 return N71_65_AddCalendar2(s
,Note
);
1409 static GSM_Error
N7110_ReplyGetNetworkInfoError(GSM_Protocol_Message msg
, GSM_StateMachine
*s
)
1411 smprintf(s
, "Probably means no PIN\n");
1412 return GE_SECURITYERROR
;
1415 static GSM_Error
N7110_SetIncomingCall(GSM_StateMachine
*s
, bool enable
)
1417 #ifndef GSM_ENABLE_N71_92INCOMINGINFO
1418 return GE_SOURCENOTAVAILABLE
;
1420 return NOKIA_SetIncomingCall(s
,enable
);
1423 static GSM_Error
N7110_SetIncomingUSSD(GSM_StateMachine
*s
, bool enable
)
1425 #ifndef GSM_ENABLE_N71_92INCOMINGINFO
1426 return GE_SOURCENOTAVAILABLE
;
1428 return NOKIA_SetIncomingUSSD(s
,enable
);
1431 static GSM_Error
N7110_SetIncomingSMS(GSM_StateMachine
*s
, bool enable
)
1433 #ifndef GSM_ENABLE_N71_92INCOMINGINFO
1434 return GE_SOURCENOTAVAILABLE
;
1436 return NOKIA_SetIncomingSMS(s
,enable
);
1439 GSM_Error
N7110_AnswerCall(GSM_StateMachine
*s
, int ID
, bool all
)
1441 if (!all
) return DCT3DCT4_AnswerCall(s
,ID
);
1442 return DCT3_AnswerAllCalls(s
);
1445 GSM_Error
N7110_SetCallDivert(GSM_StateMachine
*s
, GSM_MultiCallDivert
*divert
)
1450 /* No answer from phone side */
1453 error
= DCT3DCT4_SetCallDivert(s
,divert
);
1458 GSM_Error
N7110_CancelAllDiverts(GSM_StateMachine
*s
)
1463 /* No answer from phone side */
1466 error
= DCT3DCT4_CancelAllDiverts(s
);
1471 static GSM_Reply_Function N7110ReplyFunctions
[] = {
1472 {N71_65_ReplyCallInfo
, "\x01",0x03,0x02,ID_IncomingFrame
},
1473 {N71_65_ReplyCallInfo
, "\x01",0x03,0x03,ID_IncomingFrame
},
1474 {N71_65_ReplyCallInfo
, "\x01",0x03,0x04,ID_IncomingFrame
},
1475 {N71_65_ReplyCallInfo
, "\x01",0x03,0x05,ID_IncomingFrame
},
1476 {N71_65_ReplyCallInfo
, "\x01",0x03,0x07,ID_AnswerCall
},
1477 {N71_65_ReplyCallInfo
, "\x01",0x03,0x07,ID_IncomingFrame
},
1478 {N71_65_ReplyCallInfo
, "\x01",0x03,0x09,ID_CancelCall
},
1479 {N71_65_ReplyCallInfo
, "\x01",0x03,0x09,ID_IncomingFrame
},
1480 {N71_65_ReplyCallInfo
, "\x01",0x03,0x0A,ID_IncomingFrame
},
1481 {N71_65_ReplyCallInfo
, "\x01",0x03,0x0B,ID_IncomingFrame
},
1482 {N71_65_ReplyCallInfo
, "\x01",0x03,0x0C,ID_IncomingFrame
},
1483 {N71_65_ReplySendDTMF
, "\x01",0x03,0x51,ID_SendDTMF
},
1484 {N71_65_ReplyCallInfo
, "\x01",0x03,0x53,ID_IncomingFrame
},
1485 {N71_65_ReplySendDTMF
, "\x01",0x03,0x59,ID_SendDTMF
},
1486 {N71_65_ReplySendDTMF
, "\x01",0x03,0x5E,ID_SendDTMF
},
1488 {DCT3_ReplySendSMSMessage
, "\x02",0x03,0x02,ID_IncomingFrame
},
1489 {DCT3_ReplySendSMSMessage
, "\x02",0x03,0x03,ID_IncomingFrame
},
1490 {N7110_ReplyIncomingSMS
, "\x02",0x03,0x10,ID_IncomingFrame
},
1491 #ifdef GSM_ENABLE_CELLBROADCAST
1492 {DCT3_ReplySetIncomingCB
, "\x02",0x03,0x21,ID_SetIncomingCB
},
1493 {DCT3_ReplySetIncomingCB
, "\x02",0x03,0x22,ID_SetIncomingCB
},
1494 {DCT3_ReplyIncomingCB
, "\x02",0x03,0x23,ID_IncomingFrame
},
1496 {DCT3_ReplySetSMSC
, "\x02",0x03,0x31,ID_SetSMSC
},
1497 {DCT3_ReplyGetSMSC
, "\x02",0x03,0x34,ID_GetSMSC
},
1498 {DCT3_ReplyGetSMSC
, "\x02",0x03,0x35,ID_GetSMSC
},
1499 #ifdef GSM_ENABLE_CELLBROADCAST
1500 {DCT3_ReplySetIncomingCB
, "\x02",0x03,0xCA,ID_SetIncomingCB
},
1503 {N7110_ReplyGetMemoryStatus
, "\x03",0x03,0x04,ID_GetMemoryStatus
},
1504 {N7110_ReplyGetMemory
, "\x03",0x03,0x08,ID_GetMemory
},
1505 {N7110_ReplyDeleteMemory
, "\x03",0x03,0x10,ID_SetMemory
},
1506 {N71_65_ReplyWritePhonebook
, "\x03",0x03,0x0C,ID_SetBitmap
},
1507 {N71_65_ReplyWritePhonebook
, "\x03",0x03,0x0C,ID_SetMemory
},
1509 {N71_65_ReplyUSSDInfo
, "\x06",0x03,0x03,ID_IncomingFrame
},
1510 {NoneReply
, "\x06",0x03,0x06,ID_IncomingFrame
},
1512 {DCT3_ReplySIMLogin
, "\x09",0x03,0x80,ID_IncomingFrame
},
1513 {DCT3_ReplySIMLogout
, "\x09",0x03,0x81,ID_IncomingFrame
},
1515 {DCT3_ReplyGetNetworkInfo
, "\x0A",0x03,0x71,ID_GetNetworkInfo
},
1516 {DCT3_ReplyGetNetworkInfo
, "\x0A",0x03,0x71,ID_GetBitmap
},
1517 {DCT3_ReplyGetNetworkInfo
, "\x0A",0x03,0x71,ID_IncomingFrame
},
1518 {N7110_ReplyGetNetworkInfoError
, "\x0A",0x03,0x72,ID_GetNetworkInfo
},
1519 {DCT3_ReplyGetNetworkInfo
, "\x0A",0x03,0x73,ID_IncomingFrame
},
1520 {N71_92_ReplyGetSignalQuality
, "\x0A",0x03,0x82,ID_GetSignalQuality
},
1521 {N7110_ReplySetOperatorLogo
, "\x0A",0x03,0xA4,ID_SetBitmap
},
1522 {N7110_ReplyClearOperatorLogo
, "\x0A",0x03,0xB0,ID_SetBitmap
},
1523 {NoneReply
, "\x0A",0x03,0xB5,ID_IncomingFrame
},
1526 {N71_65_ReplyAddCalendar1
, "\x13",0x03,0x02,ID_SetCalendarNote
},/*method 1*/
1527 {N71_65_ReplyAddCalendar1
, "\x13",0x03,0x04,ID_SetCalendarNote
},/*method 1*/
1528 {N71_65_ReplyAddCalendar1
, "\x13",0x03,0x06,ID_SetCalendarNote
},/*method 1*/
1529 {N71_65_ReplyAddCalendar1
, "\x13",0x03,0x08,ID_SetCalendarNote
},/*method 1*/
1531 {N71_65_ReplyDelCalendar
, "\x13",0x03,0x0C,ID_DeleteCalendarNote
},
1532 {N71_65_ReplyGetNextCalendar1
, "\x13",0x03,0x1A,ID_GetCalendarNote
},/*method 1*/
1534 {N7110_ReplyGetCalendarNotePos
, "\x13",0x03,0x32,ID_GetCalendarNotePos
},/*method 1*/
1536 {N7110_ReplyGetCalendarInfo
, "\x13",0x03,0x3B,ID_GetCalendarNotesInfo
},/*method 1*/
1538 {N71_65_ReplyGetNextCalendar2
, "\x13",0x03,0x3F,ID_GetCalendarNote
},/*method 2*/
1540 {N71_65_ReplyAddCalendar2
, "\x13",0x03,0x41,ID_SetCalendarNote
},/*method 2*/
1542 {N7110_ReplySaveSMSMessage
, "\x14",0x03,0x05,ID_SaveSMSMessage
},
1543 {N7110_ReplySaveSMSMessage
, "\x14",0x03,0x06,ID_SaveSMSMessage
},
1544 {N7110_ReplyGetSMSMessage
, "\x14",0x03,0x08,ID_GetSMSMessage
},
1545 {N7110_ReplyGetSMSMessage
, "\x14",0x03,0x08,ID_GetBitmap
},
1546 {N7110_ReplyGetSMSMessage
, "\x14",0x03,0x09,ID_GetSMSMessage
},
1547 {DCT3_ReplyDeleteSMSMessage
, "\x14",0x03,0x0B,ID_DeleteSMSMessage
},
1548 {DCT3_ReplyDeleteSMSMessage
, "\x14",0x03,0x0C,ID_DeleteSMSMessage
},
1549 {N7110_ReplyGetSMSStatus
, "\x14",0x03,0x37,ID_GetSMSStatus
},
1550 {N7110_ReplyGetSMSStatus
, "\x14",0x03,0x38,ID_GetSMSStatus
},
1551 {N7110_ReplySetPicture
, "\x14",0x03,0x51,ID_SetBitmap
},
1552 {N7110_ReplyGetSMSFolderStatus
, "\x14",0x03,0x6C,ID_GetSMSFolderStatus
},
1553 {N7110_ReplyGetSMSMessage
, "\x14",0x03,0x6F,ID_GetSMSMessage
},
1554 {N7110_ReplyGetSMSFolders
, "\x14",0x03,0x7B,ID_GetSMSFolders
},
1555 {N7110_ReplyGetSMSFolders
, "\x14",0x03,0x7C,ID_GetSMSFolders
},
1556 {N7110_ReplySaveSMSMessage
, "\x14",0x03,0x84,ID_SaveSMSMessage
},
1557 {N7110_ReplyGetPictureImageInfo
, "\x14",0x03,0x97,ID_GetBitmap
},
1558 {N7110_ReplyGetSMSFolders
, "\x14",0x03,0xCA,ID_GetSMSFolders
},
1560 {N71_92_ReplyGetBatteryCharge
, "\x17",0x03,0x03,ID_GetBatteryCharge
},
1562 {DCT3_ReplySetDateTime
, "\x19",0x03,0x61,ID_SetDateTime
},
1563 {DCT3_ReplyGetDateTime
, "\x19",0x03,0x63,ID_GetDateTime
},
1564 {DCT3_ReplySetAlarm
, "\x19",0x03,0x6C,ID_SetAlarm
},
1565 {DCT3_ReplyGetAlarm
, "\x19",0x03,0x6E,ID_GetAlarm
},
1567 {N7110_ReplyGetRingtone
, "\x1f",0x03,0x23,ID_GetRingtone
},
1568 {N7110_ReplyGetRingtone
, "\x1f",0x03,0x24,ID_GetRingtone
},
1570 {DCT3DCT4_ReplyEnableWAP
, "\x3f",0x03,0x01,ID_EnableWAP
},
1571 {DCT3DCT4_ReplyEnableWAP
, "\x3f",0x03,0x02,ID_EnableWAP
},
1572 {DCT3_ReplyGetWAPBookmark
, "\x3f",0x03,0x07,ID_GetWAPBookmark
},
1573 {DCT3_ReplyGetWAPBookmark
, "\x3f",0x03,0x08,ID_GetWAPBookmark
},
1574 {DCT3DCT4_ReplySetWAPBookmark
, "\x3f",0x03,0x0A,ID_SetWAPBookmark
},
1575 {DCT3DCT4_ReplySetWAPBookmark
, "\x3f",0x03,0x0B,ID_SetWAPBookmark
},
1576 {DCT3DCT4_ReplyDelWAPBookmark
, "\x3f",0x03,0x0D,ID_DeleteWAPBookmark
},
1577 {DCT3DCT4_ReplyDelWAPBookmark
, "\x3f",0x03,0x0E,ID_DeleteWAPBookmark
},
1578 {DCT3DCT4_ReplyGetActiveWAPMMSSet
,"\x3f",0x03,0x10,ID_GetWAPSettings
},
1579 {DCT3DCT4_ReplySetActiveWAPMMSSet
,"\x3f",0x03,0x13,ID_SetWAPSettings
},
1580 {DCT3_ReplyGetWAPSettings
, "\x3f",0x03,0x16,ID_GetWAPSettings
},
1581 {DCT3_ReplyGetWAPSettings
, "\x3f",0x03,0x17,ID_GetWAPSettings
},
1582 {DCT3_ReplySetWAPSettings
, "\x3f",0x03,0x19,ID_SetWAPSettings
},
1583 {DCT3_ReplySetWAPSettings
, "\x3f",0x03,0x1A,ID_SetWAPSettings
},
1584 {DCT3_ReplyGetWAPSettings
, "\x3f",0x03,0x1C,ID_GetWAPSettings
},
1585 {DCT3_ReplyGetWAPSettings
, "\x3f",0x03,0x1D,ID_GetWAPSettings
},
1586 {DCT3_ReplySetWAPSettings
, "\x3f",0x03,0x1F,ID_SetWAPSettings
},
1588 {N7110_ReplyGetProfileFeature
, "\x39",0x03,0x02,ID_GetProfile
},
1589 {N7110_ReplySetProfileFeature
, "\x39",0x03,0x04,ID_SetProfile
},
1591 {DCT3_ReplyEnableSecurity
, "\x40",0x02,0x64,ID_EnableSecurity
},
1592 {N61_71_ReplyResetPhoneSettings
, "\x40",0x02,0x65,ID_ResetPhoneSettings
},
1593 {DCT3_ReplyGetIMEI
, "\x40",0x02,0x66,ID_GetIMEI
},
1594 {DCT3_ReplyDialCommand
, "\x40",0x02,0x7C,ID_DialVoice
},
1595 {DCT3_ReplyDialCommand
, "\x40",0x02,0x7C,ID_CancelCall
},
1596 {DCT3_ReplyDialCommand
, "\x40",0x02,0x7C,ID_AnswerCall
},
1597 {DCT3_ReplyNetmonitor
, "\x40",0x02,0x7E,ID_Netmonitor
},
1598 {DCT3_ReplyPlayTone
, "\x40",0x02,0x8F,ID_PlayTone
},
1599 {NOKIA_ReplyGetPhoneString
, "\x40",0x02,0xC8,ID_GetHardware
},
1600 {NOKIA_ReplyGetPhoneString
, "\x40",0x02,0xC8,ID_GetPPM
},
1601 {NOKIA_ReplyGetPhoneString
, "\x40",0x02,0xCA,ID_GetProductCode
},
1602 {NOKIA_ReplyGetPhoneString
, "\x40",0x02,0xCC,ID_GetManufactureMonth
},
1603 {NOKIA_ReplyGetPhoneString
, "\x40",0x02,0xCC,ID_GetOriginalIMEI
},
1604 {NoneReply
, "\x40",0x02,0xFF,ID_IncomingFrame
},
1606 {N71_92_ReplyPhoneSetting
, "\x7a",0x04,0x02,ID_GetBitmap
},
1607 {N71_92_ReplyPhoneSetting
, "\x7a",0x04,0x02,ID_SetBitmap
},
1608 {N71_92_ReplyPhoneSetting
, "\x7a",0x04,0x15,ID_GetBitmap
},
1609 {N71_92_ReplyPhoneSetting
, "\x7a",0x04,0x15,ID_SetBitmap
},
1610 {N71_92_ReplyPhoneSetting
, "\x7a",0x04,0x17,ID_GetBitmap
},
1611 {N71_92_ReplyPhoneSetting
, "\x7a",0x04,0x17,ID_SetBitmap
},
1613 {DCT3DCT4_ReplyGetModelFirmware
, "\xD2",0x02,0x00,ID_GetModel
},
1614 {DCT3DCT4_ReplyGetModelFirmware
, "\xD2",0x02,0x00,ID_GetFirmware
},
1615 {DCT3_ReplyPressKey
, "\xD2",0x02,0x46,ID_PressKey
},
1616 {DCT3_ReplyPressKey
, "\xD2",0x02,0x47,ID_PressKey
},
1618 {NULL
, "\x00",0x00,0x00,ID_None
}
1621 GSM_Phone_Functions N7110Phone
= {
1622 "6210|6250|7110|7190",
1623 N7110ReplyFunctions
,
1626 GSM_DispatchMessage
,
1627 NOTSUPPORTED
, /* ShowStartInfo */
1628 NOKIA_GetManufacturer
,
1630 DCT3DCT4_GetFirmware
,
1632 DCT3_GetOriginalIMEI
,
1633 DCT3_GetManufactureMonth
,
1634 DCT3_GetProductCode
,
1637 NOTSUPPORTED
, /* GetSIMIMSI */
1642 NOTSUPPORTED
, /* GetLocale */
1643 NOTSUPPORTED
, /* SetLocale */
1646 N61_71_ResetPhoneSettings
,
1647 NOTSUPPORTED
, /* EnterSecurityCode */
1648 NOTSUPPORTED
, /* GetSecurityStatus */
1649 NOTSUPPORTED
, /* GetDisplayStatus */
1650 NOTIMPLEMENTED
, /* SetAutoNetworkLogin */
1651 N71_92_GetBatteryCharge
,
1652 N71_92_GetSignalQuality
,
1653 DCT3_GetNetworkInfo
,
1654 NOTSUPPORTED
, /* GetCategory */
1655 NOTSUPPORTED
, /* GetCategoryStatus */
1656 N7110_GetMemoryStatus
,
1658 NOTIMPLEMENTED
, /* GetNextMemory */
1660 NOTIMPLEMENTED
, /* AddMemory */
1662 NOTIMPLEMENTED
, /* DeleteAllMemory */
1664 NOTIMPLEMENTED
, /* SetSpeedDial */
1668 N7110_GetSMSMessage
,
1669 N7110_GetNextSMSMessage
,
1673 DCT3_SendSMSMessage
,
1674 N7110_SetIncomingSMS
,
1676 N7110_GetSMSFolders
,
1677 NOTIMPLEMENTED
, /* AddSMSFolder */
1678 NOTIMPLEMENTED
, /* DeleteSMSFolder */
1682 NOTIMPLEMENTED
, /* HoldCall */
1683 NOTIMPLEMENTED
, /* UnholdCall */
1684 NOTIMPLEMENTED
, /* ConferenceCall */
1685 NOTIMPLEMENTED
, /* SplitCall */
1686 NOTIMPLEMENTED
, /* TransferCall */
1687 NOTIMPLEMENTED
, /* SwitchCall */
1688 NOTSUPPORTED
, /* GetCallDivert */
1689 N7110_SetCallDivert
,
1690 N7110_CancelAllDiverts
,
1691 N7110_SetIncomingCall
,
1692 N7110_SetIncomingUSSD
,
1696 NOTSUPPORTED
, /* GetRingtonesInfo */
1697 NOTSUPPORTED
, /* DeleteUserRingtones */
1699 DCT3DCT4_GetWAPBookmark
,
1700 DCT3_SetWAPBookmark
,
1701 DCT3DCT4_DeleteWAPBookmark
,
1702 DCT3_GetWAPSettings
,
1703 DCT3_SetWAPSettings
,
1704 NOTSUPPORTED
, /* GetMMSSettings */
1705 NOTSUPPORTED
, /* SetMMSSettings */
1708 NOTSUPPORTED
, /* GetToDoStatus */
1709 NOTSUPPORTED
, /* GetToDo */
1710 NOTSUPPORTED
, /* GetNextToDo */
1711 NOTSUPPORTED
, /* SetToDo */
1712 NOTSUPPORTED
, /* AddToDo */
1713 NOTSUPPORTED
, /* DeleteToDo */
1714 NOTSUPPORTED
, /* DeleteAllToDo */
1715 N7110_GetCalendarStatus
,
1716 NOTIMPLEMENTED
, /* GetCalendar */
1717 N7110_GetNextCalendar
,
1718 NOTIMPLEMENTED
, /* SetCalendar */
1721 NOTIMPLEMENTED
, /* DeleteAllCalendar */
1722 NOTSUPPORTED
, /* GetCalendarSettings */
1723 NOTSUPPORTED
, /* SetCalendarSettings */
1724 NOTSUPPORTED
, /* GetNote */
1727 NOTSUPPORTED
, /* GetFMStation */
1728 NOTSUPPORTED
, /* SetFMStation */
1729 NOTSUPPORTED
, /* ClearFMStations */
1730 NOTSUPPORTED
, /* GetNextFileFolder */
1731 NOTSUPPORTED
, /* GetFilePart */
1732 NOTSUPPORTED
, /* AddFile */
1733 NOTSUPPORTED
, /* GetFileSystemStatus */
1734 NOTSUPPORTED
, /* DeleteFile */
1735 NOTSUPPORTED
, /* AddFolder */
1736 NOTSUPPORTED
, /* GetGPRSAccessPoint */
1737 NOTSUPPORTED
/* SetGPRSAccessPoint */
1742 /* How should editor hadle tabs in this file? Add editor commands here.
1743 * vim: noexpandtab sw=8 ts=8 sts=8: