Diffstat (limited to 'gammu/emb/common/phone/nokia/dct3/n6110.c') (more/less context) (ignore whitespace changes)
-rw-r--r-- | gammu/emb/common/phone/nokia/dct3/n6110.c | 17 |
1 files changed, 12 insertions, 5 deletions
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,225 +1,228 @@ | |||
1 | /* (c) 2001-2004 by Marcin Wiacek */ | 1 | /* (c) 2001-2004 by Marcin Wiacek */ |
2 | /* based on some work from Markus Plail and Gnokii */ | ||
3 | /* Authentication function (c) 1999 or earlier by Pavel Janik */ | ||
4 | /* 5210 calendar IDs by Frederick Ros */ | 2 | /* 5210 calendar IDs by Frederick Ros */ |
3 | /* based on some Markus Plail, Pavel Janik & others work from Gnokii (www.gnokii.org) | ||
4 | * (C) 1999-2000 Hugh Blemings & Pavel Janik ml. (C) 2001-2004 Pawel Kot | ||
5 | * GNU GPL version 2 or later | ||
6 | */ | ||
5 | 7 | ||
6 | #include "../../../gsmstate.h" | 8 | #include "../../../gsmstate.h" |
7 | 9 | ||
8 | #ifdef GSM_ENABLE_NOKIA6110 | 10 | #ifdef GSM_ENABLE_NOKIA6110 |
9 | 11 | ||
10 | #include <string.h> | 12 | #include <string.h> |
11 | 13 | ||
12 | #include "../../../../cfg/config.h" | 14 | #include "../../../../cfg/config.h" |
13 | #include "../../../misc/coding/coding.h" | 15 | #include "../../../misc/coding/coding.h" |
14 | #include "../../../service/sms/gsmsms.h" | 16 | #include "../../../service/sms/gsmsms.h" |
15 | #include "../../../gsmcomon.h" | 17 | #include "../../../gsmcomon.h" |
16 | #include "../../pfunc.h" | 18 | #include "../../pfunc.h" |
17 | #include "../nfunc.h" | 19 | #include "../nfunc.h" |
18 | #include "n6110.h" | 20 | #include "n6110.h" |
19 | #include "dct3func.h" | 21 | #include "dct3func.h" |
20 | 22 | ||
21 | static unsigned char N6110_MEMORY_TYPES[] = { | 23 | static unsigned char N6110_MEMORY_TYPES[] = { |
22 | MEM_ME, 0x02, | 24 | MEM_ME, 0x02, |
23 | MEM_SM, 0x03, | 25 | MEM_SM, 0x03, |
24 | MEM_ON, 0x05, | 26 | MEM_ON, 0x05, |
25 | MEM_DC, 0x07, | 27 | MEM_DC, 0x07, |
26 | MEM_RC, 0x08, | 28 | MEM_RC, 0x08, |
27 | MEM_MC, 0x09, | 29 | MEM_MC, 0x09, |
28 | MEM_VM, 0x0b, | 30 | MEM_VM, 0x0b, |
29 | 0x00, 0x00 | 31 | 0x00, 0x00 |
30 | }; | 32 | }; |
31 | 33 | ||
32 | static GSM_Error N6110_ReplyGetPhoneLanguage(GSM_Protocol_Message msg, GSM_StateMachine *s) | 34 | static GSM_Error N6110_ReplyGetPhoneLanguage(GSM_Protocol_Message msg, GSM_StateMachine *s) |
33 | { | 35 | { |
34 | N6110_Language lang = N6110_Auto; | 36 | N6110_Language lang = N6110_Auto; |
35 | 37 | ||
36 | if (msg.Buffer[3] == 0x15) return ERR_NONE; | 38 | if (msg.Buffer[3] == 0x15) return ERR_NONE; |
37 | 39 | ||
38 | smprintf(s, "Phone language is %02x\n",msg.Buffer[6]); | 40 | smprintf(s, "Phone language is %02x\n",msg.Buffer[6]); |
39 | switch (msg.Buffer[6]) { | 41 | switch (msg.Buffer[6]) { |
40 | case 0x21: lang = N6110_Europe; break; //Polish | 42 | case 0x21: lang = N6110_Europe; break; //Polish |
41 | } | 43 | } |
42 | s->Phone.Data.Priv.N6110.PhoneLanguage = lang; | 44 | s->Phone.Data.Priv.N6110.PhoneLanguage = lang; |
43 | return ERR_NONE; | 45 | return ERR_NONE; |
44 | } | 46 | } |
45 | 47 | ||
46 | static GSM_Error N6110_GetPhoneLanguage(GSM_StateMachine *s) | 48 | static GSM_Error N6110_GetPhoneLanguage(GSM_StateMachine *s) |
47 | { | 49 | { |
48 | unsigned char feat_req[] = {N6110_FRAME_HEADER, 0x13, 0x01, | 50 | unsigned char feat_req[] = {N6110_FRAME_HEADER, 0x13, 0x01, |
49 | 0x00, /* Profile location */ | 51 | 0x00, /* Profile location */ |
50 | 0x00}; /* Feature number */ | 52 | 0x00}; /* Feature number */ |
51 | 53 | ||
52 | s->Phone.Data.Priv.N6110.PhoneLanguage = N6110_Auto; | 54 | s->Phone.Data.Priv.N6110.PhoneLanguage = N6110_Auto; |
53 | 55 | ||
54 | feat_req[5] = 0; | 56 | feat_req[5] = 0; |
55 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_PROFILES33)) { | 57 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_PROFILES33)) { |
56 | feat_req[6] = 0x1E; | 58 | feat_req[6] = 0x1E; |
57 | } else { | 59 | } else { |
58 | feat_req[6] = 0x21; | 60 | feat_req[6] = 0x21; |
59 | } | 61 | } |
60 | smprintf(s, "Getting profile feature\n"); | 62 | smprintf(s, "Getting profile feature\n"); |
61 | return GSM_WaitFor (s, feat_req, 7, 0x05, 4, ID_GetLanguage); | 63 | return GSM_WaitFor (s, feat_req, 7, 0x05, 4, ID_GetLanguage); |
62 | } | 64 | } |
63 | 65 | ||
64 | struct N6110_Lang_Char { | 66 | struct N6110_Lang_Char { |
65 | N6110_Language Lang; | 67 | N6110_Language Lang; |
66 | unsigned char Phone; | 68 | unsigned char Phone; |
67 | unsigned char Unicode1; | 69 | unsigned char Unicode1; |
68 | unsigned char Unicode2; | 70 | unsigned char Unicode2; |
69 | }; | 71 | }; |
70 | 72 | ||
71 | static struct N6110_Lang_Char N6110_Lang_Table[] = { | 73 | static struct N6110_Lang_Char N6110_Lang_Table[] = { |
72 | {N6110_Europe,0x13,0x01,0x04},//Latin capital letter a with ogonek | 74 | {N6110_Europe,0x13,0x01,0x04},//Latin capital letter a with ogonek |
73 | {N6110_Europe,0x14,0x01,0x05},//Latin small letter a with ogonek | 75 | {N6110_Europe,0x14,0x01,0x05},//Latin small letter a with ogonek |
74 | {N6110_Europe,0x15,0x01,0x06},//Latin capital letter c with acute | 76 | {N6110_Europe,0x15,0x01,0x06},//Latin capital letter c with acute |
75 | {N6110_Europe,0x17,0x01,0x07},//Latin small letter c with acute | 77 | {N6110_Europe,0x17,0x01,0x07},//Latin small letter c with acute |
76 | {N6110_Europe,0x1D,0x01,0x18},//Latin capital letter e with ogonek | 78 | {N6110_Europe,0x1D,0x01,0x18},//Latin capital letter e with ogonek |
77 | {N6110_Europe,0x1E,0x01,0x19},//Latin small letter e with ogonek | 79 | {N6110_Europe,0x1E,0x01,0x19},//Latin small letter e with ogonek |
78 | {N6110_Europe,0x83,0x00,0xD3},//Latin capital letter o with acute | 80 | {N6110_Europe,0x83,0x00,0xD3},//Latin capital letter o with acute |
79 | {N6110_Europe,0x8E,0x01,0x41},//Latin capital letter l with stroke | 81 | {N6110_Europe,0x8E,0x01,0x41},//Latin capital letter l with stroke |
80 | {N6110_Europe,0x90,0x01,0x42},//Latin small letter l with stroke | 82 | {N6110_Europe,0x90,0x01,0x42},//Latin small letter l with stroke |
81 | {N6110_Europe,0x92,0x01,0x43},//Latin capital letter n with acute | 83 | {N6110_Europe,0x92,0x01,0x43},//Latin capital letter n with acute |
82 | {N6110_Europe,0x93,0x01,0x44},//Latin small letter n with acute | 84 | {N6110_Europe,0x93,0x01,0x44},//Latin small letter n with acute |
83 | {N6110_Europe,0x9A,0x00,0xF3},//Latin small letter o with acute | 85 | {N6110_Europe,0x9A,0x00,0xF3},//Latin small letter o with acute |
84 | {N6110_Europe,0xB2,0x20,0xAC},//euro | 86 | {N6110_Europe,0xB2,0x20,0xAC},//euro |
85 | {N6110_Europe,0xB5,0x01,0x5A},//Latin capital letter s with acute | 87 | {N6110_Europe,0xB5,0x01,0x5A},//Latin capital letter s with acute |
86 | {N6110_Europe,0xB6,0x01,0x5B},//Latin small letter s with acute | 88 | {N6110_Europe,0xB6,0x01,0x5B},//Latin small letter s with acute |
87 | {N6110_Europe,0xE7,0x01,0x79},//Latin capital letter z with acute | 89 | {N6110_Europe,0xE7,0x01,0x79},//Latin capital letter z with acute |
88 | {N6110_Europe,0xEE,0x01,0x7A},//Latin small letter z with acute | 90 | {N6110_Europe,0xEE,0x01,0x7A},//Latin small letter z with acute |
89 | {N6110_Europe,0xF4,0x01,0x7C},//Latin small letter z with dot above | 91 | {N6110_Europe,0xF4,0x01,0x7C},//Latin small letter z with dot above |
90 | {N6110_Europe,0xF0,0x01,0x7B},//Latin capital letter z with dot above | 92 | {N6110_Europe,0xF0,0x01,0x7B},//Latin capital letter z with dot above |
91 | {0,0,0,0} | 93 | {0,0,0,0} |
92 | }; | 94 | }; |
93 | 95 | ||
94 | static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const unsigned char *src, int len) | 96 | static void N6110_EncodeUnicode(GSM_StateMachine *s, unsigned char *dest, const unsigned char *src, int len) |
95 | { | 97 | { |
96 | int i_len = 0, o_len, i; | 98 | int i_len = 0, o_len, i; |
97 | wchar_t wc; | 99 | wchar_t wc; |
98 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; | 100 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; |
99 | bool found; | 101 | bool found; |
100 | 102 | ||
101 | for (o_len = 0; i_len < len; o_len++) { | 103 | for (o_len = 0; i_len < len; o_len++) { |
102 | found = false; | 104 | found = false; |
103 | if (Priv->PhoneLanguage != N6110_Auto) { | 105 | if (Priv->PhoneLanguage != N6110_Auto) { |
104 | i = 0; | 106 | i = 0; |
105 | while(1) { | 107 | while(1) { |
106 | if (N6110_Lang_Table[i].Lang == 0) break; | 108 | if (N6110_Lang_Table[i].Lang == 0) break; |
107 | if (N6110_Lang_Table[i].Lang == Priv->PhoneLanguage && | 109 | if (N6110_Lang_Table[i].Lang == Priv->PhoneLanguage && |
108 | N6110_Lang_Table[i].Phone == src[i_len]) { | 110 | N6110_Lang_Table[i].Phone == src[i_len]) { |
109 | dest[o_len*2] = N6110_Lang_Table[i].Unicode1; | 111 | dest[o_len*2] = N6110_Lang_Table[i].Unicode1; |
110 | dest[(o_len*2)+1] = N6110_Lang_Table[i].Unicode2; | 112 | dest[(o_len*2)+1] = N6110_Lang_Table[i].Unicode2; |
111 | i_len++; | 113 | i_len++; |
112 | found = true; | 114 | found = true; |
113 | break; | 115 | break; |
114 | } | 116 | } |
115 | i++; | 117 | i++; |
116 | } | 118 | } |
117 | } | 119 | } |
118 | if (!found) { | 120 | if (!found) { |
119 | i_len += EncodeWithUnicodeAlphabet(&src[i_len], &wc); | 121 | i_len += EncodeWithUnicodeAlphabet(&src[i_len], &wc); |
120 | dest[o_len*2] = (wc >> 8) & 0xff; | 122 | dest[o_len*2] = (wc >> 8) & 0xff; |
121 | dest[(o_len*2)+1] = wc & 0xff; | 123 | dest[(o_len*2)+1] = wc & 0xff; |
122 | } | 124 | } |
123 | } | 125 | } |
124 | dest[o_len*2] = 0; | 126 | dest[o_len*2] = 0; |
125 | dest[(o_len*2)+1] = 0; | 127 | dest[(o_len*2)+1] = 0; |
126 | } | 128 | } |
127 | 129 | ||
128 | #ifndef ENABLE_LGPL | 130 | #ifndef ENABLE_LGPL |
129 | 131 | ||
132 | /* Pavel Janik */ | ||
130 | /* This function provides Nokia authentication protocol. | 133 | /* This function provides Nokia authentication protocol. |
131 | * Nokia authentication protocol is used in the communication between Nokia | 134 | * Nokia authentication protocol is used in the communication between Nokia |
132 | * mobile phones (e.g. Nokia 6110) and Nokia Cellular Data Suite software, | 135 | * mobile phones (e.g. Nokia 6110) and Nokia Cellular Data Suite software, |
133 | * commercially sold by Nokia Corp. | 136 | * commercially sold by Nokia Corp. |
134 | * The authentication scheme is based on the token send by the phone to the | 137 | * The authentication scheme is based on the token send by the phone to the |
135 | * software. The software does it's magic (see the function | 138 | * software. The software does it's magic (see the function |
136 | * N6110_GetNokiaAuthentication) and returns the result back to the phone. | 139 | * N6110_GetNokiaAuthentication) and returns the result back to the phone. |
137 | * If the result is correct the phone responds with the message "Accessory | 140 | * If the result is correct the phone responds with the message "Accessory |
138 | * connected!" displayed on the LCD. Otherwise it will display "Accessory not | 141 | * connected!" displayed on the LCD. Otherwise it will display "Accessory not |
139 | * supported" and some functions will not be available for use (?). | 142 | * supported" and some functions will not be available for use (?). |
140 | * The specification of the protocol is not publicly available, no comment. | 143 | * The specification of the protocol is not publicly available, no comment. |
141 | */ | 144 | */ |
142 | static void N6110_GetNokiaAuthentication(unsigned char *Imei, unsigned char *MagicBytes, unsigned char *MagicResponse) | 145 | static void N6110_GetNokiaAuthentication(unsigned char *Imei, unsigned char *MagicBytes, unsigned char *MagicResponse) |
143 | { | 146 | { |
144 | int i, j, CRC=0; | 147 | int i, j, CRC=0; |
145 | unsigned char Temp[16]; /* This is our temporary working area. */ | 148 | unsigned char Temp[16]; /* This is our temporary working area. */ |
146 | 149 | ||
147 | /* Here we put FAC (Final Assembly Code) and serial number into our area. */ | 150 | /* Here we put FAC (Final Assembly Code) and serial number into our area. */ |
148 | Temp[0] = Imei[6]; Temp[1] = Imei[7]; | 151 | Temp[0] = Imei[6]; Temp[1] = Imei[7]; |
149 | Temp[2] = Imei[8]; Temp[3] = Imei[9]; | 152 | Temp[2] = Imei[8]; Temp[3] = Imei[9]; |
150 | Temp[4] = Imei[10]; Temp[5] = Imei[11]; | 153 | Temp[4] = Imei[10]; Temp[5] = Imei[11]; |
151 | Temp[6] = Imei[12]; Temp[7] = Imei[13]; | 154 | Temp[6] = Imei[12]; Temp[7] = Imei[13]; |
152 | 155 | ||
153 | /* And now the TAC (Type Approval Code). */ | 156 | /* And now the TAC (Type Approval Code). */ |
154 | Temp[8] = Imei[2]; Temp[9] = Imei[3]; | 157 | Temp[8] = Imei[2]; Temp[9] = Imei[3]; |
155 | Temp[10] = Imei[4]; Temp[11] = Imei[5]; | 158 | Temp[10] = Imei[4]; Temp[11] = Imei[5]; |
156 | 159 | ||
157 | /* And now we pack magic bytes from the phone. */ | 160 | /* And now we pack magic bytes from the phone. */ |
158 | Temp[12] = MagicBytes[0]; Temp[13] = MagicBytes[1]; | 161 | Temp[12] = MagicBytes[0]; Temp[13] = MagicBytes[1]; |
159 | Temp[14] = MagicBytes[2]; Temp[15] = MagicBytes[3]; | 162 | Temp[14] = MagicBytes[2]; Temp[15] = MagicBytes[3]; |
160 | 163 | ||
161 | for (i=0; i<=11; i++) if (Temp[i + 1]& 1) Temp[i]<<=1; | 164 | for (i=0; i<=11; i++) if (Temp[i + 1]& 1) Temp[i]<<=1; |
162 | switch (Temp[15] & 0x03) { | 165 | switch (Temp[15] & 0x03) { |
163 | case 1: | 166 | case 1: |
164 | case 2: j = Temp[13] & 0x07; | 167 | case 2: j = Temp[13] & 0x07; |
165 | for (i=0; i<=3; i++) Temp[i+j] ^= Temp[i+12]; | 168 | for (i=0; i<=3; i++) Temp[i+j] ^= Temp[i+12]; |
166 | break; | 169 | break; |
167 | default: j = Temp[14] & 0x07; | 170 | default: j = Temp[14] & 0x07; |
168 | for (i=0; i<=3; i++) Temp[i + j] |= Temp[i + 12]; | 171 | for (i=0; i<=3; i++) Temp[i + j] |= Temp[i + 12]; |
169 | } | 172 | } |
170 | for (i=0; i<=15; i++) CRC ^= Temp[i]; | 173 | for (i=0; i<=15; i++) CRC ^= Temp[i]; |
171 | for (i=0; i<=15; i++) { | 174 | for (i=0; i<=15; i++) { |
172 | switch (Temp[15 - i] & 0x06) { | 175 | switch (Temp[15 - i] & 0x06) { |
173 | case 0: j = Temp[i] | CRC; break; | 176 | case 0: j = Temp[i] | CRC; break; |
174 | case 2: | 177 | case 2: |
175 | case 4: j = Temp[i] ^ CRC; break; | 178 | case 4: j = Temp[i] ^ CRC; break; |
176 | case 6: j = Temp[i] & CRC; break; | 179 | case 6: j = Temp[i] & CRC; break; |
177 | } | 180 | } |
178 | if (j == CRC) j = 0x2c; | 181 | if (j == CRC) j = 0x2c; |
179 | if (Temp[i] == 0) j = 0; | 182 | if (Temp[i] == 0) j = 0; |
180 | MagicResponse[i] = j; | 183 | MagicResponse[i] = j; |
181 | } | 184 | } |
182 | } | 185 | } |
183 | 186 | ||
184 | static GSM_Error N6110_ReplyGetMagicBytes(GSM_Protocol_Message msg, GSM_StateMachine *s) | 187 | static GSM_Error N6110_ReplyGetMagicBytes(GSM_Protocol_Message msg, GSM_StateMachine *s) |
185 | { | 188 | { |
186 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; | 189 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; |
187 | GSM_Phone_Data *Data = &s->Phone.Data; | 190 | GSM_Phone_Data *Data = &s->Phone.Data; |
188 | 191 | ||
189 | sprintf(Data->IMEI, "%s", msg.Buffer+9); | 192 | sprintf(Data->IMEI, "%s", msg.Buffer+9); |
190 | sprintf(Data->HardwareCache, "%s", msg.Buffer+39); | 193 | sprintf(Data->HardwareCache, "%s", msg.Buffer+39); |
191 | sprintf(Data->ProductCodeCache, "%s", msg.Buffer+31); | 194 | sprintf(Data->ProductCodeCache, "%s", msg.Buffer+31); |
192 | 195 | ||
193 | smprintf(s, "Message: Mobile phone identification received:\n"); | 196 | smprintf(s, "Message: Mobile phone identification received:\n"); |
194 | smprintf(s, "IMEI : %s\n", msg.Buffer+9); | 197 | smprintf(s, "IMEI : %s\n", msg.Buffer+9); |
195 | smprintf(s, "Model : %s\n", msg.Buffer+25); | 198 | smprintf(s, "Model : %s\n", msg.Buffer+25); |
196 | smprintf(s, "Production Code : %s\n", msg.Buffer+31); | 199 | smprintf(s, "Production Code : %s\n", msg.Buffer+31); |
197 | smprintf(s, "HW : %s\n", msg.Buffer+39); | 200 | smprintf(s, "HW : %s\n", msg.Buffer+39); |
198 | smprintf(s, "Firmware : %s\n", msg.Buffer+44); | 201 | smprintf(s, "Firmware : %s\n", msg.Buffer+44); |
199 | 202 | ||
200 | /* These bytes are probably the source of the "Accessory not connected" | 203 | /* These bytes are probably the source of the "Accessory not connected" |
201 | * messages on the phone when trying to emulate NCDS... I hope.... | 204 | * messages on the phone when trying to emulate NCDS... I hope.... |
202 | * UPDATE: of course, now we have the authentication algorithm. | 205 | * UPDATE: of course, now we have the authentication algorithm. |
203 | */ | 206 | */ |
204 | smprintf(s, " Magic bytes : %02x %02x %02x %02x\n", msg.Buffer[50], msg.Buffer[51], msg.Buffer[52], msg.Buffer[53]); | 207 | smprintf(s, " Magic bytes : %02x %02x %02x %02x\n", msg.Buffer[50], msg.Buffer[51], msg.Buffer[52], msg.Buffer[53]); |
205 | 208 | ||
206 | Priv->MagicBytes[0]=msg.Buffer[50]; | 209 | Priv->MagicBytes[0]=msg.Buffer[50]; |
207 | Priv->MagicBytes[1]=msg.Buffer[51]; | 210 | Priv->MagicBytes[1]=msg.Buffer[51]; |
208 | Priv->MagicBytes[2]=msg.Buffer[52]; | 211 | Priv->MagicBytes[2]=msg.Buffer[52]; |
209 | Priv->MagicBytes[3]=msg.Buffer[53]; | 212 | Priv->MagicBytes[3]=msg.Buffer[53]; |
210 | 213 | ||
211 | return ERR_NONE; | 214 | return ERR_NONE; |
212 | } | 215 | } |
213 | 216 | ||
214 | static GSM_Error N6110_MakeAuthentication(GSM_StateMachine *s) | 217 | static GSM_Error N6110_MakeAuthentication(GSM_StateMachine *s) |
215 | { | 218 | { |
216 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; | 219 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; |
217 | GSM_Error error; | 220 | GSM_Error error; |
218 | unsigned char connect4[] = {N6110_FRAME_HEADER, 0x10}; | 221 | unsigned char connect4[] = {N6110_FRAME_HEADER, 0x10}; |
219 | unsigned char magic_connect[] = { | 222 | unsigned char magic_connect[] = { |
220 | N6110_FRAME_HEADER, 0x12, | 223 | N6110_FRAME_HEADER, 0x12, |
221 | /* The real magic goes here ... These bytes are filled in | 224 | /* The real magic goes here ... These bytes are filled in |
222 | * with the function N6110_GetNokiaAuthentication. */ | 225 | * with the function N6110_GetNokiaAuthentication. */ |
223 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 226 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
224 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | 227 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
225 | /* NOKIA&GNOKII Accessory */ | 228 | /* NOKIA&GNOKII Accessory */ |
@@ -731,192 +734,193 @@ static GSM_Error N6110_SetSMS(GSM_StateMachine *s, GSM_SMSMessage *sms) | |||
731 | } | 734 | } |
732 | 735 | ||
733 | static GSM_Error N6110_AddSMS(GSM_StateMachine *s, GSM_SMSMessage *sms) | 736 | static GSM_Error N6110_AddSMS(GSM_StateMachine *s, GSM_SMSMessage *sms) |
734 | { | 737 | { |
735 | sms->Location = 0; | 738 | sms->Location = 0; |
736 | return N6110_PrivSetSMSMessage(s, sms); | 739 | return N6110_PrivSetSMSMessage(s, sms); |
737 | } | 740 | } |
738 | 741 | ||
739 | static GSM_Error N6110_ReplySetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) | 742 | static GSM_Error N6110_ReplySetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) |
740 | { | 743 | { |
741 | switch (msg.Buffer[3]) { | 744 | switch (msg.Buffer[3]) { |
742 | case 0x37: | 745 | case 0x37: |
743 | smprintf(s, "Ringtone set OK\n"); | 746 | smprintf(s, "Ringtone set OK\n"); |
744 | return ERR_NONE; | 747 | return ERR_NONE; |
745 | break; | 748 | break; |
746 | case 0x38: | 749 | case 0x38: |
747 | smprintf(s, "Error setting ringtone\n"); | 750 | smprintf(s, "Error setting ringtone\n"); |
748 | switch (msg.Buffer[4]) { | 751 | switch (msg.Buffer[4]) { |
749 | case 0x7d: | 752 | case 0x7d: |
750 | smprintf(s, "Too high location ?\n"); | 753 | smprintf(s, "Too high location ?\n"); |
751 | return ERR_INVALIDLOCATION; | 754 | return ERR_INVALIDLOCATION; |
752 | default: | 755 | default: |
753 | smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); | 756 | smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); |
754 | } | 757 | } |
755 | } | 758 | } |
756 | return ERR_UNKNOWNRESPONSE; | 759 | return ERR_UNKNOWNRESPONSE; |
757 | } | 760 | } |
758 | 761 | ||
759 | static GSM_Error N6110_ReplySetBinRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) | 762 | static GSM_Error N6110_ReplySetBinRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) |
760 | { | 763 | { |
761 | switch (msg.Buffer[4]) { | 764 | switch (msg.Buffer[4]) { |
762 | case 0x00: | 765 | case 0x00: |
763 | smprintf(s, "Set at location %i\n",msg.Buffer[3]+1); | 766 | smprintf(s, "Set at location %i\n",msg.Buffer[3]+1); |
764 | return ERR_NONE; | 767 | return ERR_NONE; |
765 | default: | 768 | default: |
766 | smprintf(s, "Invalid location. Too high ?\n"); | 769 | smprintf(s, "Invalid location. Too high ?\n"); |
767 | return ERR_INVALIDLOCATION; | 770 | return ERR_INVALIDLOCATION; |
768 | } | 771 | } |
769 | } | 772 | } |
770 | 773 | ||
771 | static GSM_Error N6110_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength) | 774 | static GSM_Error N6110_SetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, int *maxlength) |
772 | { | 775 | { |
773 | GSM_NetworkInfo NetInfo; | 776 | GSM_NetworkInfo NetInfo; |
774 | GSM_Error error; | 777 | GSM_Error error; |
775 | int size=200,current=8; | 778 | int size=200,current=8; |
776 | GSM_UDHHeader UDHHeader; | 779 | GSM_UDHHeader UDHHeader; |
777 | unsigned char req[1000] = {N6110_FRAME_HEADER, 0x36, | 780 | unsigned char req[1000] = {N6110_FRAME_HEADER, 0x36, |
778 | 0x00, /* Location */ | 781 | 0x00, /* Location */ |
779 | 0x00,0x78}; | 782 | 0x00,0x78}; |
780 | unsigned char reqBin[1000] = {0x00,0x01,0xa0,0x00,0x00,0x0c,0x01,0x2c}; | 783 | unsigned char reqBin[1000] = {0x00,0x01,0xa0,0x00,0x00,0x0c,0x01,0x2c}; |
781 | 784 | ||
782 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NORING)) return ERR_NOTSUPPORTED; | 785 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NORING)) return ERR_NOTSUPPORTED; |
783 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; | 786 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; |
784 | 787 | ||
785 | switch (Ringtone->Format) { | 788 | switch (Ringtone->Format) { |
786 | case RING_NOTETONE: | 789 | case RING_NOTETONE: |
787 | if (Ringtone->Location==255) { | 790 | if (Ringtone->Location==255) { |
788 | /* Only 6110, 6130 and 6150 support it */ | 791 | /* Only 6110, 6130 and 6150 support it */ |
789 | if (strcmp(s->Phone.Data.Model,"NSE-3") == 0 || strcmp(s->Phone.Data.Model,"NSK-3") == 0 || | 792 | if (strcmp(s->Phone.Data.Model,"NSE-3") == 0 || strcmp(s->Phone.Data.Model,"NSK-3") == 0 || |
790 | strcmp(s->Phone.Data.Model,"NSM-1") == 0) { | 793 | strcmp(s->Phone.Data.Model,"NSM-1") == 0) { |
791 | req[0] = 0x0c; | 794 | req[0] = 0x0c; |
792 | req[1] = 0x01; | 795 | req[1] = 0x01; |
793 | UDHHeader.Type = UDH_NokiaRingtone; | 796 | UDHHeader.Type = UDH_NokiaRingtone; |
794 | GSM_EncodeUDHHeader(&UDHHeader); | 797 | GSM_EncodeUDHHeader(&UDHHeader); |
795 | /* We copy UDH now */ | 798 | /* We copy UDH now */ |
796 | memcpy(req+2,UDHHeader.Text,UDHHeader.Length); | 799 | memcpy(req+2,UDHHeader.Text,UDHHeader.Length); |
797 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+2+UDHHeader.Length, &size); | 800 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+2+UDHHeader.Length, &size); |
798 | error = s->Protocol.Functions->WriteMessage(s, req, 2+UDHHeader.Length+size, 0x12); | 801 | error = s->Protocol.Functions->WriteMessage(s, req, 2+UDHHeader.Length+size, 0x12); |
799 | if (error!=ERR_NONE) return error; | 802 | if (error!=ERR_NONE) return error; |
800 | my_sleep(1000); | 803 | my_sleep(1000); |
801 | /* We have to make something (not important, what) now */ | 804 | /* We have to make something (not important, what) now */ |
802 | /* no answer from phone*/ | 805 | /* no answer from phone*/ |
803 | return DCT3_GetNetworkInfo(s,&NetInfo); | 806 | return DCT3_GetNetworkInfo(s,&NetInfo); |
804 | } else { | 807 | } else { |
805 | return ERR_NOTSUPPORTED; | 808 | return ERR_NOTSUPPORTED; |
806 | } | 809 | } |
807 | } | 810 | } |
808 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+7, &size); | 811 | *maxlength=GSM_EncodeNokiaRTTLRingtone(*Ringtone, req+7, &size); |
809 | req[4] = Ringtone->Location - 1; | 812 | req[4] = Ringtone->Location - 1; |
810 | smprintf(s, "Setting ringtone\n"); | 813 | smprintf(s, "Setting ringtone\n"); |
811 | return GSM_WaitFor (s, req, 7 + size, 0x05, 4, ID_SetRingtone); | 814 | return GSM_WaitFor (s, req, 7 + size, 0x05, 4, ID_SetRingtone); |
812 | case RING_NOKIABINARY: | 815 | case RING_NOKIABINARY: |
813 | error=DCT3_EnableSecurity (s, 0x01); | 816 | error=DCT3_EnableSecurity (s, 0x01); |
814 | if (error!=ERR_NONE) return error; | 817 | if (error!=ERR_NONE) return error; |
815 | memcpy(reqBin+current,DecodeUnicodeString(Ringtone->Name),UnicodeLength(Ringtone->Name)); | 818 | memcpy(reqBin+current,DecodeUnicodeString(Ringtone->Name),UnicodeLength(Ringtone->Name)); |
816 | current += UnicodeLength(Ringtone->Name); | 819 | current += UnicodeLength(Ringtone->Name); |
817 | reqBin[current++] = 0x00; | 820 | reqBin[current++] = 0x00; |
818 | reqBin[current++] = 0x00; | 821 | reqBin[current++] = 0x00; |
819 | reqBin[current++] = 0x00;/*xxx*/ | 822 | reqBin[current++] = 0x00;/*xxx*/ |
820 | memcpy(reqBin+current,Ringtone->NokiaBinary.Frame,Ringtone->NokiaBinary.Length); | 823 | memcpy(reqBin+current,Ringtone->NokiaBinary.Frame,Ringtone->NokiaBinary.Length); |
821 | current=current+Ringtone->NokiaBinary.Length; | 824 | current=current+Ringtone->NokiaBinary.Length; |
822 | reqBin[3]=Ringtone->Location-1; | 825 | reqBin[3]=Ringtone->Location-1; |
823 | if (!strcmp(s->Phone.Data.ModelInfo->model,"3210")) reqBin[5]=0x10; | 826 | if (!strcmp(s->Phone.Data.ModelInfo->model,"3210")) reqBin[5]=0x10; |
824 | smprintf(s, "Setting binary ringtone\n"); | 827 | smprintf(s, "Setting binary ringtone\n"); |
825 | return GSM_WaitFor (s, reqBin, current, 0x40, 4, ID_SetRingtone); | 828 | return GSM_WaitFor (s, reqBin, current, 0x40, 4, ID_SetRingtone); |
826 | case RING_MIDI: | 829 | case RING_MIDI: |
830 | case RING_MMF: | ||
827 | return ERR_NOTSUPPORTED; | 831 | return ERR_NOTSUPPORTED; |
828 | } | 832 | } |
829 | return ERR_NOTSUPPORTED; | 833 | return ERR_NOTSUPPORTED; |
830 | } | 834 | } |
831 | 835 | ||
832 | static GSM_Error N6110_ReplyGetOpLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 836 | static GSM_Error N6110_ReplyGetOpLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
833 | { | 837 | { |
834 | int count=5; | 838 | int count=5; |
835 | GSM_Phone_Data *Data = &s->Phone.Data; | 839 | GSM_Phone_Data *Data = &s->Phone.Data; |
836 | 840 | ||
837 | smprintf(s, "Operator logo received\n"); | 841 | smprintf(s, "Operator logo received\n"); |
838 | NOKIA_DecodeNetworkCode(msg.Buffer+count,Data->Bitmap->NetworkCode); | 842 | NOKIA_DecodeNetworkCode(msg.Buffer+count,Data->Bitmap->NetworkCode); |
839 | count = count + 3; | 843 | count = count + 3; |
840 | smprintf(s, "Network code : %s\n", Data->Bitmap->NetworkCode); | 844 | smprintf(s, "Network code : %s\n", Data->Bitmap->NetworkCode); |
841 | smprintf(s, "Network name for Gammu : %s ", | 845 | smprintf(s, "Network name for Gammu : %s ", |
842 | DecodeUnicodeString(GSM_GetNetworkName(Data->Bitmap->NetworkCode))); | 846 | DecodeUnicodeString(GSM_GetNetworkName(Data->Bitmap->NetworkCode))); |
843 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(Data->Bitmap->NetworkCode))); | 847 | smprintf(s, "(%s)\n",DecodeUnicodeString(GSM_GetCountryName(Data->Bitmap->NetworkCode))); |
844 | 848 | ||
845 | count = count + 3; /* We ignore size */ | 849 | count = count + 3; /* We ignore size */ |
846 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; | 850 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; |
847 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; | 851 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; |
848 | count++; | 852 | count++; |
849 | PHONE_DecodeBitmap(GSM_NokiaOperatorLogo,msg.Buffer+count,Data->Bitmap); | 853 | PHONE_DecodeBitmap(GSM_NokiaOperatorLogo,msg.Buffer+count,Data->Bitmap); |
850 | return ERR_NONE; | 854 | return ERR_NONE; |
851 | } | 855 | } |
852 | 856 | ||
853 | static GSM_Error N6110_ReplyGetStartup(GSM_Protocol_Message msg, GSM_StateMachine *s) | 857 | static GSM_Error N6110_ReplyGetStartup(GSM_Protocol_Message msg, GSM_StateMachine *s) |
854 | { | 858 | { |
855 | int i, count = 5; | 859 | int i, count = 5; |
856 | GSM_Phone_Data *Data = &s->Phone.Data; | 860 | GSM_Phone_Data *Data = &s->Phone.Data; |
857 | 861 | ||
858 | smprintf(s, "Startup logo & notes received\n"); | 862 | smprintf(s, "Startup logo & notes received\n"); |
859 | for (i=0;i<msg.Buffer[4];i++) { | 863 | for (i=0;i<msg.Buffer[4];i++) { |
860 | switch (msg.Buffer[count++]) { | 864 | switch (msg.Buffer[count++]) { |
861 | case 0x01: | 865 | case 0x01: |
862 | smprintf(s, "Startup logo\n"); | 866 | smprintf(s, "Startup logo\n"); |
863 | if (Data->Bitmap->Type == GSM_StartupLogo) { | 867 | if (Data->Bitmap->Type == GSM_StartupLogo) { |
864 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; | 868 | Data->Bitmap->BitmapHeight = msg.Buffer[count++]; |
865 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; | 869 | Data->Bitmap->BitmapWidth = msg.Buffer[count++]; |
866 | PHONE_DecodeBitmap(GSM_NokiaStartupLogo, msg.Buffer + count, Data->Bitmap); | 870 | PHONE_DecodeBitmap(GSM_NokiaStartupLogo, msg.Buffer + count, Data->Bitmap); |
867 | } else { | 871 | } else { |
868 | count = count + 2; | 872 | count = count + 2; |
869 | } | 873 | } |
870 | count = count + PHONE_GetBitmapSize(GSM_NokiaStartupLogo,0,0); | 874 | count = count + PHONE_GetBitmapSize(GSM_NokiaStartupLogo,0,0); |
871 | break; | 875 | break; |
872 | case 0x02: | 876 | case 0x02: |
873 | smprintf(s, "Welcome note\n"); | 877 | smprintf(s, "Welcome note\n"); |
874 | if (Data->Bitmap->Type == GSM_WelcomeNote_Text) { | 878 | if (Data->Bitmap->Type == GSM_WelcomeNote_Text) { |
875 | EncodeUnicode(Data->Bitmap->Text,msg.Buffer+count, msg.Buffer[count]); | 879 | EncodeUnicode(Data->Bitmap->Text,msg.Buffer+count, msg.Buffer[count]); |
876 | smprintf(s, "Text is \"%s\"\n",Data->Bitmap->Text); | 880 | smprintf(s, "Text is \"%s\"\n",Data->Bitmap->Text); |
877 | } | 881 | } |
878 | count = count + msg.Buffer[count] + 1; | 882 | count = count + msg.Buffer[count] + 1; |
879 | break; | 883 | break; |
880 | case 0x03: | 884 | case 0x03: |
881 | smprintf(s, "Dealer welcome note\n"); | 885 | smprintf(s, "Dealer welcome note\n"); |
882 | if (Data->Bitmap->Type == GSM_DealerNote_Text) { | 886 | if (Data->Bitmap->Type == GSM_DealerNote_Text) { |
883 | EncodeUnicode(Data->Bitmap->Text,msg.Buffer+count, msg.Buffer[count]); | 887 | EncodeUnicode(Data->Bitmap->Text,msg.Buffer+count, msg.Buffer[count]); |
884 | smprintf(s, "Text is \"%s\"\n",Data->Bitmap->Text); | 888 | smprintf(s, "Text is \"%s\"\n",Data->Bitmap->Text); |
885 | } | 889 | } |
886 | count = count + msg.Buffer[count] + 1; | 890 | count = count + msg.Buffer[count] + 1; |
887 | break; | 891 | break; |
888 | default: | 892 | default: |
889 | smprintf(s, "Unknown block\n"); | 893 | smprintf(s, "Unknown block\n"); |
890 | return ERR_UNKNOWNRESPONSE; | 894 | return ERR_UNKNOWNRESPONSE; |
891 | break; | 895 | break; |
892 | } | 896 | } |
893 | } | 897 | } |
894 | return ERR_NONE; | 898 | return ERR_NONE; |
895 | } | 899 | } |
896 | 900 | ||
897 | static GSM_Error N6110_ReplyGetCallerLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 901 | static GSM_Error N6110_ReplyGetCallerLogo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
898 | { | 902 | { |
899 | int count; | 903 | int count; |
900 | GSM_Phone_Data *Data = &s->Phone.Data; | 904 | GSM_Phone_Data *Data = &s->Phone.Data; |
901 | 905 | ||
902 | switch (msg.Buffer[3]) { | 906 | switch (msg.Buffer[3]) { |
903 | case 0x11: | 907 | case 0x11: |
904 | smprintf(s, "Caller group info received\n"); | 908 | smprintf(s, "Caller group info received\n"); |
905 | EncodeUnicode(Data->Bitmap->Text,msg.Buffer+6,msg.Buffer[5]); | 909 | EncodeUnicode(Data->Bitmap->Text,msg.Buffer+6,msg.Buffer[5]); |
906 | smprintf(s, "Name : \"%s\"\n",DecodeUnicodeString(Data->Bitmap->Text)); | 910 | smprintf(s, "Name : \"%s\"\n",DecodeUnicodeString(Data->Bitmap->Text)); |
907 | Data->Bitmap->DefaultName = false; | 911 | Data->Bitmap->DefaultName = false; |
908 | if (msg.Buffer[5] == 0x00) Data->Bitmap->DefaultName = true; | 912 | if (msg.Buffer[5] == 0x00) Data->Bitmap->DefaultName = true; |
909 | count = msg.Buffer[5] + 6; | 913 | count = msg.Buffer[5] + 6; |
910 | Data->Bitmap->RingtoneID = msg.Buffer[count++]; | 914 | Data->Bitmap->RingtoneID = msg.Buffer[count++]; |
911 | Data->Bitmap->DefaultRingtone = false; | 915 | Data->Bitmap->DefaultRingtone = false; |
912 | Data->Bitmap->FileSystemRingtone = false; | 916 | Data->Bitmap->FileSystemRingtone = false; |
913 | if (Data->Bitmap->RingtoneID == 16) Data->Bitmap->DefaultRingtone = true; | 917 | if (Data->Bitmap->RingtoneID == 16) Data->Bitmap->DefaultRingtone = true; |
914 | smprintf(s, "Ringtone ID: %02x\n",Data->Bitmap->RingtoneID); | 918 | smprintf(s, "Ringtone ID: %02x\n",Data->Bitmap->RingtoneID); |
915 | Data->Bitmap->BitmapEnabled=(msg.Buffer[count++]==1); | 919 | Data->Bitmap->BitmapEnabled=(msg.Buffer[count++]==1); |
916 | #ifdef DEBUG | 920 | #ifdef DEBUG |
917 | smprintf(s, "Caller group logo "); | 921 | smprintf(s, "Caller group logo "); |
918 | if (Data->Bitmap->BitmapEnabled) { | 922 | if (Data->Bitmap->BitmapEnabled) { |
919 | smprintf(s, "enabled\n"); | 923 | smprintf(s, "enabled\n"); |
920 | } else { | 924 | } else { |
921 | smprintf(s, "disabled\n"); | 925 | smprintf(s, "disabled\n"); |
922 | } | 926 | } |
@@ -1431,229 +1435,231 @@ static GSM_Error N6110_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry) | |||
1431 | req[6] = UnicodeLength(entry->Entries[Name].Text); | 1435 | req[6] = UnicodeLength(entry->Entries[Name].Text); |
1432 | memcpy(req+current,DecodeUnicodeString(entry->Entries[Name].Text),UnicodeLength(entry->Entries[Name].Text)); | 1436 | memcpy(req+current,DecodeUnicodeString(entry->Entries[Name].Text),UnicodeLength(entry->Entries[Name].Text)); |
1433 | current += UnicodeLength(entry->Entries[Name].Text); | 1437 | current += UnicodeLength(entry->Entries[Name].Text); |
1434 | } else req[6] = 0; | 1438 | } else req[6] = 0; |
1435 | } else { | 1439 | } else { |
1436 | if (Name != -1) { | 1440 | if (Name != -1) { |
1437 | req[6] = UnicodeLength(entry->Entries[Name].Text)*2+2; | 1441 | req[6] = UnicodeLength(entry->Entries[Name].Text)*2+2; |
1438 | memcpy(req+current,entry->Entries[Name].Text,UnicodeLength(entry->Entries[Name].Text)*2); | 1442 | memcpy(req+current,entry->Entries[Name].Text,UnicodeLength(entry->Entries[Name].Text)*2); |
1439 | current += UnicodeLength(entry->Entries[Name].Text)*2; | 1443 | current += UnicodeLength(entry->Entries[Name].Text)*2; |
1440 | } else req[6] = 0; | 1444 | } else req[6] = 0; |
1441 | req[current++]=0x00; | 1445 | req[current++]=0x00; |
1442 | req[current++]=0x00; | 1446 | req[current++]=0x00; |
1443 | } | 1447 | } |
1444 | 1448 | ||
1445 | if (Number != -1) { | 1449 | if (Number != -1) { |
1446 | req[current++]=UnicodeLength(entry->Entries[Number].Text); | 1450 | req[current++]=UnicodeLength(entry->Entries[Number].Text); |
1447 | memcpy(req+current,DecodeUnicodeString(entry->Entries[Number].Text),UnicodeLength(entry->Entries[Number].Text)); | 1451 | memcpy(req+current,DecodeUnicodeString(entry->Entries[Number].Text),UnicodeLength(entry->Entries[Number].Text)); |
1448 | current += UnicodeLength(entry->Entries[Number].Text); | 1452 | current += UnicodeLength(entry->Entries[Number].Text); |
1449 | } else req[current++] = 0; | 1453 | } else req[current++] = 0; |
1450 | 1454 | ||
1451 | /* This allow to save 14 characters name into SIM memory, when | 1455 | /* This allow to save 14 characters name into SIM memory, when |
1452 | * no caller group is selected. */ | 1456 | * no caller group is selected. */ |
1453 | if (Group == -1) { | 1457 | if (Group == -1) { |
1454 | req[current++] = 0xff; | 1458 | req[current++] = 0xff; |
1455 | } else { | 1459 | } else { |
1456 | req[current++] = entry->Entries[Group].Number-1; | 1460 | req[current++] = entry->Entries[Group].Number-1; |
1457 | } | 1461 | } |
1458 | 1462 | ||
1459 | smprintf(s, "Writing phonebook entry\n"); | 1463 | smprintf(s, "Writing phonebook entry\n"); |
1460 | return GSM_WaitFor (s, req, current, 0x03, 4, ID_SetMemory); | 1464 | return GSM_WaitFor (s, req, current, 0x03, 4, ID_SetMemory); |
1461 | } | 1465 | } |
1462 | 1466 | ||
1463 | static GSM_Error N6110_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry) | 1467 | static GSM_Error N6110_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry) |
1464 | { | 1468 | { |
1465 | GSM_MemoryEntry dwa; | 1469 | GSM_MemoryEntry dwa; |
1466 | 1470 | ||
1467 | dwa.Location = entry->Location; | 1471 | dwa.Location = entry->Location; |
1468 | dwa.MemoryType = entry->MemoryType; | 1472 | dwa.MemoryType = entry->MemoryType; |
1469 | dwa.EntriesNum = 0; | 1473 | dwa.EntriesNum = 0; |
1470 | 1474 | ||
1471 | return N6110_SetMemory(s, &dwa); | 1475 | return N6110_SetMemory(s, &dwa); |
1472 | } | 1476 | } |
1473 | 1477 | ||
1474 | static GSM_Error N6110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1478 | static GSM_Error N6110_ReplyGetRingtone(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1475 | { | 1479 | { |
1476 | GSM_Phone_Data *Data = &s->Phone.Data; | 1480 | GSM_Phone_Data *Data = &s->Phone.Data; |
1477 | char buffer[2000]; | 1481 | char buffer[2000]; |
1478 | GSM_Error error; | 1482 | GSM_Error error; |
1479 | int i,end,start; | 1483 | int i,end,start; |
1480 | 1484 | ||
1481 | smprintf(s, "Ringtone received\n"); | 1485 | smprintf(s, "Ringtone received\n"); |
1482 | switch (msg.Buffer[4]) { | 1486 | switch (msg.Buffer[4]) { |
1483 | case 0x00: | 1487 | case 0x00: |
1484 | switch (Data->Ringtone->Format) { | 1488 | switch (Data->Ringtone->Format) { |
1485 | case RING_NOTETONE: | 1489 | case RING_NOTETONE: |
1486 | memcpy(buffer,msg.Buffer,msg.Length); | 1490 | memcpy(buffer,msg.Buffer,msg.Length); |
1487 | i=7; | 1491 | i=7; |
1488 | if (buffer[9]==0x4a && buffer[10]==0x3a) i=8; | 1492 | if (buffer[9]==0x4a && buffer[10]==0x3a) i=8; |
1489 | buffer[i]=0x02; | 1493 | buffer[i]=0x02; |
1490 | error=GSM_DecodeNokiaRTTLRingtone(Data->Ringtone, buffer+i, msg.Length-i); | 1494 | error=GSM_DecodeNokiaRTTLRingtone(Data->Ringtone, buffer+i, msg.Length-i); |
1491 | if (error!=ERR_NONE) return ERR_EMPTY; | 1495 | if (error!=ERR_NONE) return ERR_EMPTY; |
1492 | return ERR_NONE; | 1496 | return ERR_NONE; |
1493 | case RING_NOKIABINARY: | 1497 | case RING_NOKIABINARY: |
1494 | i=8; | 1498 | i=8; |
1495 | while (msg.Buffer[i]!=0) { | 1499 | while (msg.Buffer[i]!=0) { |
1496 | i++; | 1500 | i++; |
1497 | if (i>msg.Length) return ERR_EMPTY; | 1501 | if (i>msg.Length) return ERR_EMPTY; |
1498 | } | 1502 | } |
1499 | EncodeUnicode(Data->Ringtone->Name,msg.Buffer+8,i-8); | 1503 | EncodeUnicode(Data->Ringtone->Name,msg.Buffer+8,i-8); |
1500 | smprintf(s, "Name \"%s\"\n",DecodeUnicodeString(Data->Ringtone->Name)); | 1504 | smprintf(s, "Name \"%s\"\n",DecodeUnicodeString(Data->Ringtone->Name)); |
1501 | /* Looking for start && end */ | 1505 | /* Looking for start && end */ |
1502 | end=0;start=0;i=0; | 1506 | end=0;start=0;i=0; |
1503 | while (true) { | 1507 | while (true) { |
1504 | if (start!=0) { | 1508 | if (start!=0) { |
1505 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { | 1509 | if (msg.Buffer[i]==0x07 && msg.Buffer[i+1]==0x0b) { |
1506 | end=i+2; break; | 1510 | end=i+2; break; |
1507 | } | 1511 | } |
1508 | if (msg.Buffer[i]==0x0e && msg.Buffer[i+1]==0x0b) { | 1512 | if (msg.Buffer[i]==0x0e && msg.Buffer[i+1]==0x0b) { |
1509 | end=i+2; break; | 1513 | end=i+2; break; |
1510 | } | 1514 | } |
1511 | } else { | 1515 | } else { |
1512 | if (msg.Buffer[i]==0x02 && msg.Buffer[i+1]==0xfc && msg.Buffer[i+2]==0x09) { | 1516 | if (msg.Buffer[i]==0x02 && msg.Buffer[i+1]==0xfc && msg.Buffer[i+2]==0x09) { |
1513 | start = i; | 1517 | start = i; |
1514 | } | 1518 | } |
1515 | } | 1519 | } |
1516 | i++; | 1520 | i++; |
1517 | if (i==msg.Length-3) return ERR_EMPTY; | 1521 | if (i==msg.Length-3) return ERR_EMPTY; |
1518 | } | 1522 | } |
1519 | /* Copying frame */ | 1523 | /* Copying frame */ |
1520 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+start,end-start); | 1524 | memcpy(Data->Ringtone->NokiaBinary.Frame,msg.Buffer+start,end-start); |
1521 | Data->Ringtone->NokiaBinary.Length=end-start; | 1525 | Data->Ringtone->NokiaBinary.Length=end-start; |
1522 | #ifdef DEBUG | 1526 | #ifdef DEBUG |
1523 | if (di.dl == DL_TEXTALL || di.dl == DL_TEXTALLDATE) DumpMessage(di.df, di.dl, Data->Ringtone->NokiaBinary.Frame, Data->Ringtone->NokiaBinary.Length); | 1527 | if (di.dl == DL_TEXTALL || di.dl == DL_TEXTALLDATE) DumpMessage(di.df, di.dl, Data->Ringtone->NokiaBinary.Frame, Data->Ringtone->NokiaBinary.Length); |
1524 | #endif | 1528 | #endif |
1525 | return ERR_NONE; | 1529 | return ERR_NONE; |
1526 | case RING_MIDI: | 1530 | case RING_MIDI: |
1531 | case RING_MMF: | ||
1527 | return ERR_NOTSUPPORTED; | 1532 | return ERR_NOTSUPPORTED; |
1528 | } | 1533 | } |
1529 | smprintf(s, "Ringtone format is %i\n",Data->Ringtone->Format); | 1534 | smprintf(s, "Ringtone format is %i\n",Data->Ringtone->Format); |
1530 | break; | 1535 | break; |
1531 | default: | 1536 | default: |
1532 | smprintf(s, "Invalid location. Too high ?\n"); | 1537 | smprintf(s, "Invalid location. Too high ?\n"); |
1533 | return ERR_INVALIDLOCATION; | 1538 | return ERR_INVALIDLOCATION; |
1534 | } | 1539 | } |
1535 | return ERR_UNKNOWNRESPONSE; | 1540 | return ERR_UNKNOWNRESPONSE; |
1536 | } | 1541 | } |
1537 | 1542 | ||
1538 | static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) | 1543 | static GSM_Error N6110_GetRingtone(GSM_StateMachine *s, GSM_Ringtone *Ringtone, bool PhoneRingtone) |
1539 | { | 1544 | { |
1540 | GSM_Error error; | 1545 | GSM_Error error; |
1541 | unsigned char req[] = {0x00, 0x01, 0x9e, | 1546 | unsigned char req[] = {0x00, 0x01, 0x9e, |
1542 | 0x00}; /* location */ | 1547 | 0x00}; /* location */ |
1543 | 1548 | ||
1544 | if (PhoneRingtone) return ERR_NOTSUPPORTED; | 1549 | if (PhoneRingtone) return ERR_NOTSUPPORTED; |
1545 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_NORING)) return ERR_NOTSUPPORTED; | 1550 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_NORING)) return ERR_NOTSUPPORTED; |
1546 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; | 1551 | if (Ringtone->Location == 0) return ERR_INVALIDLOCATION; |
1547 | 1552 | ||
1548 | if (Ringtone->Format == 0x00) { | 1553 | if (Ringtone->Format == 0x00) { |
1549 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) { | 1554 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) { |
1550 | Ringtone->Format = RING_NOTETONE; | 1555 | Ringtone->Format = RING_NOTETONE; |
1551 | } else { | 1556 | } else { |
1552 | Ringtone->Format = RING_NOKIABINARY; | 1557 | Ringtone->Format = RING_NOKIABINARY; |
1553 | } | 1558 | } |
1554 | } | 1559 | } |
1555 | 1560 | ||
1556 | switch (Ringtone->Format) { | 1561 | switch (Ringtone->Format) { |
1557 | case RING_NOTETONE: | 1562 | case RING_NOTETONE: |
1558 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; | 1563 | if (!IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; |
1559 | break; | 1564 | break; |
1560 | case RING_NOKIABINARY: | 1565 | case RING_NOKIABINARY: |
1561 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; | 1566 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_RING_SM)) return ERR_NOTSUPPORTED; |
1562 | break; | 1567 | break; |
1563 | case RING_MIDI: | 1568 | case RING_MIDI: |
1569 | case RING_MMF: | ||
1564 | return ERR_NOTSUPPORTED; | 1570 | return ERR_NOTSUPPORTED; |
1565 | } | 1571 | } |
1566 | 1572 | ||
1567 | error=DCT3_EnableSecurity (s, 0x01); | 1573 | error=DCT3_EnableSecurity (s, 0x01); |
1568 | if (error!=ERR_NONE) return error; | 1574 | if (error!=ERR_NONE) return error; |
1569 | 1575 | ||
1570 | req[3]=Ringtone->Location-1; | 1576 | req[3]=Ringtone->Location-1; |
1571 | s->Phone.Data.Ringtone=Ringtone; | 1577 | s->Phone.Data.Ringtone=Ringtone; |
1572 | smprintf(s, "Getting (binary) ringtone\n"); | 1578 | smprintf(s, "Getting (binary) ringtone\n"); |
1573 | return GSM_WaitFor (s, req, 4, 0x40, 4, ID_GetRingtone); | 1579 | return GSM_WaitFor (s, req, 4, 0x40, 4, ID_GetRingtone); |
1574 | } | 1580 | } |
1575 | 1581 | ||
1576 | static GSM_Error N6110_ReplyGetSecurityStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1582 | static GSM_Error N6110_ReplyGetSecurityStatus(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1577 | { | 1583 | { |
1578 | *s->Phone.Data.SecurityStatus = msg.Buffer[4]; | 1584 | *s->Phone.Data.SecurityStatus = msg.Buffer[4]; |
1579 | 1585 | ||
1580 | #ifdef DEBUG | 1586 | #ifdef DEBUG |
1581 | smprintf(s, "Security code status\n"); | 1587 | smprintf(s, "Security code status\n"); |
1582 | switch(msg.Buffer[4]) { | 1588 | switch(msg.Buffer[4]) { |
1583 | case SEC_SecurityCode: smprintf(s, "waiting for Security Code.\n"); break; | 1589 | case SEC_SecurityCode: smprintf(s, "waiting for Security Code.\n"); break; |
1584 | case SEC_Pin : smprintf(s, "waiting for PIN.\n"); break; | 1590 | case SEC_Pin : smprintf(s, "waiting for PIN.\n"); break; |
1585 | case SEC_Pin2 : smprintf(s, "waiting for PIN2.\n"); break; | 1591 | case SEC_Pin2 : smprintf(s, "waiting for PIN2.\n"); break; |
1586 | case SEC_Puk : smprintf(s, "waiting for PUK.\n"); break; | 1592 | case SEC_Puk : smprintf(s, "waiting for PUK.\n"); break; |
1587 | case SEC_Puk2 : smprintf(s, "waiting for PUK2.\n"); break; | 1593 | case SEC_Puk2 : smprintf(s, "waiting for PUK2.\n"); break; |
1588 | case SEC_None : smprintf(s, "nothing to enter.\n"); break; | 1594 | case SEC_None : smprintf(s, "nothing to enter.\n"); break; |
1589 | default : smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); | 1595 | default : smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); |
1590 | return ERR_UNKNOWNRESPONSE; | 1596 | return ERR_UNKNOWNRESPONSE; |
1591 | } | 1597 | } |
1592 | #endif | 1598 | #endif |
1593 | return ERR_NONE; | 1599 | return ERR_NONE; |
1594 | } | 1600 | } |
1595 | 1601 | ||
1596 | static GSM_Error N6110_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status) | 1602 | static GSM_Error N6110_GetSecurityStatus(GSM_StateMachine *s, GSM_SecurityCodeType *Status) |
1597 | { | 1603 | { |
1598 | unsigned char req[4] = {N6110_FRAME_HEADER, 0x07}; | 1604 | unsigned char req[4] = {N6110_FRAME_HEADER, 0x07}; |
1599 | 1605 | ||
1600 | s->Phone.Data.SecurityStatus=Status; | 1606 | s->Phone.Data.SecurityStatus=Status; |
1601 | smprintf(s, "Getting security code status\n"); | 1607 | smprintf(s, "Getting security code status\n"); |
1602 | return GSM_WaitFor (s, req, 4, 0x08, 2, ID_GetSecurityStatus); | 1608 | return GSM_WaitFor (s, req, 4, 0x08, 2, ID_GetSecurityStatus); |
1603 | } | 1609 | } |
1604 | 1610 | ||
1605 | static GSM_Error N6110_ReplyEnterSecurityCode(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1611 | static GSM_Error N6110_ReplyEnterSecurityCode(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1606 | { | 1612 | { |
1607 | switch (msg.Buffer[3]) { | 1613 | switch (msg.Buffer[3]) { |
1608 | case 0x0b: | 1614 | case 0x0b: |
1609 | smprintf(s, "Security code OK\n"); | 1615 | smprintf(s, "Security code OK\n"); |
1610 | return ERR_NONE; | 1616 | return ERR_NONE; |
1611 | case 0x0c: | 1617 | case 0x0c: |
1612 | switch (msg.Buffer[4]) { | 1618 | switch (msg.Buffer[4]) { |
1613 | case 0x88: | 1619 | case 0x88: |
1614 | smprintf(s, "Wrong code\n"); | 1620 | smprintf(s, "Wrong code\n"); |
1615 | return ERR_SECURITYERROR; | 1621 | return ERR_SECURITYERROR; |
1616 | case 0x8b: | 1622 | case 0x8b: |
1617 | smprintf(s, "Not required\n"); | 1623 | smprintf(s, "Not required\n"); |
1618 | return ERR_NONE; | 1624 | return ERR_NONE; |
1619 | default: | 1625 | default: |
1620 | smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); | 1626 | smprintf(s, "ERROR: unknown %i\n",msg.Buffer[4]); |
1621 | } | 1627 | } |
1622 | } | 1628 | } |
1623 | return ERR_UNKNOWNRESPONSE; | 1629 | return ERR_UNKNOWNRESPONSE; |
1624 | } | 1630 | } |
1625 | 1631 | ||
1626 | static GSM_Error N6110_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode Code) | 1632 | static GSM_Error N6110_EnterSecurityCode(GSM_StateMachine *s, GSM_SecurityCode Code) |
1627 | { | 1633 | { |
1628 | int len = 0; | 1634 | int len = 0; |
1629 | unsigned char req[15] = {N6110_FRAME_HEADER, 0x0a, | 1635 | unsigned char req[15] = {N6110_FRAME_HEADER, 0x0a, |
1630 | 0x00}; /* Type of code to enter */ | 1636 | 0x00}; /* Type of code to enter */ |
1631 | 1637 | ||
1632 | req[4]=Code.Type; | 1638 | req[4]=Code.Type; |
1633 | 1639 | ||
1634 | len = strlen(Code.Code); | 1640 | len = strlen(Code.Code); |
1635 | memcpy(req+5,Code.Code,len); | 1641 | memcpy(req+5,Code.Code,len); |
1636 | req[5+len]=0x00; | 1642 | req[5+len]=0x00; |
1637 | req[6+len]=0x00; | 1643 | req[6+len]=0x00; |
1638 | 1644 | ||
1639 | smprintf(s, "Entering security code\n"); | 1645 | smprintf(s, "Entering security code\n"); |
1640 | return GSM_WaitFor (s, req, 7+len, 0x08, 4, ID_EnterSecurityCode); | 1646 | return GSM_WaitFor (s, req, 7+len, 0x08, 4, ID_EnterSecurityCode); |
1641 | } | 1647 | } |
1642 | 1648 | ||
1643 | static GSM_Error N6110_ReplyGetSpeedDial(GSM_Protocol_Message msg, GSM_StateMachine *s) | 1649 | static GSM_Error N6110_ReplyGetSpeedDial(GSM_Protocol_Message msg, GSM_StateMachine *s) |
1644 | { | 1650 | { |
1645 | GSM_Phone_Data *Data = &s->Phone.Data; | 1651 | GSM_Phone_Data *Data = &s->Phone.Data; |
1646 | 1652 | ||
1647 | switch (msg.Buffer[3]) { | 1653 | switch (msg.Buffer[3]) { |
1648 | case 0x17: | 1654 | case 0x17: |
1649 | smprintf(s, "Speed dial received\n"); | 1655 | smprintf(s, "Speed dial received\n"); |
1650 | switch (msg.Buffer[4]) { | 1656 | switch (msg.Buffer[4]) { |
1651 | case 0x02: | 1657 | case 0x02: |
1652 | Data->SpeedDial->MemoryType = MEM_ME; | 1658 | Data->SpeedDial->MemoryType = MEM_ME; |
1653 | smprintf(s, "ME "); | 1659 | smprintf(s, "ME "); |
1654 | break; | 1660 | break; |
1655 | case 0x03: | 1661 | case 0x03: |
1656 | Data->SpeedDial->MemoryType = MEM_SM; | 1662 | Data->SpeedDial->MemoryType = MEM_SM; |
1657 | smprintf(s, "SIM "); | 1663 | smprintf(s, "SIM "); |
1658 | break; | 1664 | break; |
1659 | default: | 1665 | default: |
@@ -2350,194 +2356,194 @@ static GSM_Error N6110_ReplyGetNextCalendar(GSM_Protocol_Message msg, GSM_StateM | |||
2350 | Entry->EntriesNum++; | 2356 | Entry->EntriesNum++; |
2351 | 2357 | ||
2352 | NOKIA_DecodeDateTime(s, msg.Buffer+16, &Entry->Entries[1].Date); | 2358 | NOKIA_DecodeDateTime(s, msg.Buffer+16, &Entry->Entries[1].Date); |
2353 | if (Entry->Entries[1].Date.Year!=0) { | 2359 | if (Entry->Entries[1].Date.Year!=0) { |
2354 | smprintf(s, "Alarm : %02i-%02i-%04i %02i:%02i:%02i\n", | 2360 | smprintf(s, "Alarm : %02i-%02i-%04i %02i:%02i:%02i\n", |
2355 | Entry->Entries[1].Date.Day,Entry->Entries[1].Date.Month,Entry->Entries[1].Date.Year, | 2361 | Entry->Entries[1].Date.Day,Entry->Entries[1].Date.Month,Entry->Entries[1].Date.Year, |
2356 | Entry->Entries[1].Date.Hour,Entry->Entries[1].Date.Minute,Entry->Entries[1].Date.Second); | 2362 | Entry->Entries[1].Date.Hour,Entry->Entries[1].Date.Minute,Entry->Entries[1].Date.Second); |
2357 | Entry->Entries[1].EntryType = CAL_ALARM_DATETIME; | 2363 | Entry->Entries[1].EntryType = CAL_ALARM_DATETIME; |
2358 | Entry->EntriesNum++; | 2364 | Entry->EntriesNum++; |
2359 | } else { | 2365 | } else { |
2360 | smprintf(s, "No alarm\n"); | 2366 | smprintf(s, "No alarm\n"); |
2361 | } | 2367 | } |
2362 | 2368 | ||
2363 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_CAL52) || | 2369 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_CAL52) || |
2364 | IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_CAL82)) { | 2370 | IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_CAL82)) { |
2365 | memcpy(Entry->Entries[Entry->EntriesNum].Text,msg.Buffer+24,msg.Buffer[23]); | 2371 | memcpy(Entry->Entries[Entry->EntriesNum].Text,msg.Buffer+24,msg.Buffer[23]); |
2366 | Entry->Entries[Entry->EntriesNum].Text[msg.Buffer[23] ]=0; | 2372 | Entry->Entries[Entry->EntriesNum].Text[msg.Buffer[23] ]=0; |
2367 | Entry->Entries[Entry->EntriesNum].Text[msg.Buffer[23]+1]=0; | 2373 | Entry->Entries[Entry->EntriesNum].Text[msg.Buffer[23]+1]=0; |
2368 | } else { | 2374 | } else { |
2369 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_CAL33)) { | 2375 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo,F_CAL33)) { |
2370 | /* first char is subset for 33xx and reminders */ | 2376 | /* first char is subset for 33xx and reminders */ |
2371 | if (Entry->Type == GSM_CAL_REMINDER) { | 2377 | if (Entry->Type == GSM_CAL_REMINDER) { |
2372 | i=1; | 2378 | i=1; |
2373 | smprintf(s, "Subset %i in reminder note !\n",msg.Buffer[24]); | 2379 | smprintf(s, "Subset %i in reminder note !\n",msg.Buffer[24]); |
2374 | } | 2380 | } |
2375 | SpecialSubSet = true; | 2381 | SpecialSubSet = true; |
2376 | switch (msg.Buffer[24]) { | 2382 | switch (msg.Buffer[24]) { |
2377 | case 2 : Decode3310Subset2(i,msg,&s->Phone.Data); break; | 2383 | case 2 : Decode3310Subset2(i,msg,&s->Phone.Data); break; |
2378 | case 3 : Decode3310Subset3(i,msg,&s->Phone.Data); break; | 2384 | case 3 : Decode3310Subset3(i,msg,&s->Phone.Data); break; |
2379 | default : SpecialSubSet = false; break; | 2385 | default : SpecialSubSet = false; break; |
2380 | } | 2386 | } |
2381 | } | 2387 | } |
2382 | if (!SpecialSubSet) { | 2388 | if (!SpecialSubSet) { |
2383 | N6110_EncodeUnicode(s,Entry->Entries[Entry->EntriesNum].Text,msg.Buffer+24+i,msg.Buffer[23]-i); | 2389 | N6110_EncodeUnicode(s,Entry->Entries[Entry->EntriesNum].Text,msg.Buffer+24+i,msg.Buffer[23]-i); |
2384 | } | 2390 | } |
2385 | } | 2391 | } |
2386 | smprintf(s, "Text \"%s\"\n",DecodeUnicodeString(Entry->Entries[Entry->EntriesNum].Text)); | 2392 | smprintf(s, "Text \"%s\"\n",DecodeUnicodeString(Entry->Entries[Entry->EntriesNum].Text)); |
2387 | if (msg.Buffer[23] != 0x00) { | 2393 | if (msg.Buffer[23] != 0x00) { |
2388 | Entry->Entries[Entry->EntriesNum].EntryType = CAL_TEXT; | 2394 | Entry->Entries[Entry->EntriesNum].EntryType = CAL_TEXT; |
2389 | Entry->EntriesNum++; | 2395 | Entry->EntriesNum++; |
2390 | } | 2396 | } |
2391 | 2397 | ||
2392 | if (Entry->Type == GSM_CAL_CALL) { | 2398 | if (Entry->Type == GSM_CAL_CALL) { |
2393 | EncodeUnicode(Entry->Entries[Entry->EntriesNum].Text,msg.Buffer+24+msg.Buffer[23]+1,msg.Buffer[24+msg.Buffer[23]]); | 2399 | EncodeUnicode(Entry->Entries[Entry->EntriesNum].Text,msg.Buffer+24+msg.Buffer[23]+1,msg.Buffer[24+msg.Buffer[23]]); |
2394 | smprintf(s, "Phone : \"%s\"\n",DecodeUnicodeString(Entry->Entries[Entry->EntriesNum].Text)); | 2400 | smprintf(s, "Phone : \"%s\"\n",DecodeUnicodeString(Entry->Entries[Entry->EntriesNum].Text)); |
2395 | if (msg.Buffer[24+msg.Buffer[23]] != 0x00) { | 2401 | if (msg.Buffer[24+msg.Buffer[23]] != 0x00) { |
2396 | Entry->Entries[Entry->EntriesNum].EntryType = CAL_PHONE; | 2402 | Entry->Entries[Entry->EntriesNum].EntryType = CAL_PHONE; |
2397 | Entry->EntriesNum++; | 2403 | Entry->EntriesNum++; |
2398 | } | 2404 | } |
2399 | } | 2405 | } |
2400 | return ERR_NONE; | 2406 | return ERR_NONE; |
2401 | case 0x93: | 2407 | case 0x93: |
2402 | smprintf(s, "Can't get calendar note - too high location?\n"); | 2408 | smprintf(s, "Can't get calendar note - too high location?\n"); |
2403 | return ERR_INVALIDLOCATION; | 2409 | return ERR_INVALIDLOCATION; |
2404 | } | 2410 | } |
2405 | return ERR_UNKNOWNRESPONSE; | 2411 | return ERR_UNKNOWNRESPONSE; |
2406 | } | 2412 | } |
2407 | 2413 | ||
2408 | static GSM_Error N6110_GetNextCalendarNote(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start) | 2414 | static GSM_Error N6110_GetNextCalendarNote(GSM_StateMachine *s, GSM_CalendarEntry *Note, bool start) |
2409 | { | 2415 | { |
2410 | int Text, Time, Alarm, Phone, Recurrance, EndTime, Location; | 2416 | int Text, Time, Alarm, Phone, Recurrance, EndTime, Location; |
2411 | GSM_Error error; | 2417 | GSM_Error error; |
2412 | GSM_DateTime date_time; | 2418 | GSM_DateTime date_time; |
2413 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; | 2419 | GSM_Phone_N6110Data *Priv = &s->Phone.Data.Priv.N6110; |
2414 | unsigned char req[] = {N6110_FRAME_HEADER, 0x66, | 2420 | unsigned char req[] = {N6110_FRAME_HEADER, 0x66, |
2415 | 0x00}; /* Location */ | 2421 | 0x00}; /* Location */ |
2416 | 2422 | ||
2417 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOCALENDAR)) return ERR_NOTSUPPORTED; | 2423 | if (IsPhoneFeatureAvailable(s->Phone.Data.ModelInfo, F_NOCALENDAR)) return ERR_NOTSUPPORTED; |
2418 | 2424 | ||
2419 | if (start) { | 2425 | if (start) { |
2420 | Priv->LastCalendarPos = 1; | 2426 | Priv->LastCalendarPos = 1; |
2421 | } else { | 2427 | } else { |
2422 | Priv->LastCalendarPos++; | 2428 | Priv->LastCalendarPos++; |
2423 | } | 2429 | } |
2424 | 2430 | ||
2425 | Note->Location = Priv->LastCalendarPos; | 2431 | Note->Location = Priv->LastCalendarPos; |
2426 | req[4] = Priv->LastCalendarPos; | 2432 | req[4] = Priv->LastCalendarPos; |
2427 | 2433 | ||
2428 | s->Phone.Data.Cal=Note; | 2434 | s->Phone.Data.Cal=Note; |
2429 | smprintf(s, "Getting calendar note\n"); | 2435 | smprintf(s, "Getting calendar note\n"); |
2430 | error=GSM_WaitFor (s, req, 5, 0x13, 4, ID_GetCalendarNote); | 2436 | error=GSM_WaitFor (s, req, 5, 0x13, 4, ID_GetCalendarNote); |
2431 | 2437 | ||
2432 | GSM_CalendarFindDefaultTextTimeAlarmPhoneRecurrance(Note, &Text, &Time, &Alarm, &Phone, &Recurrance, &EndTime, &Location); | 2438 | GSM_CalendarFindDefaultTextTimeAlarmPhoneRecurrance(Note, &Text, &Time, &Alarm, &Phone, &Recurrance, &EndTime, &Location); |
2433 | /* 2090 year is set for example in 3310 */ | 2439 | /* 2090 year is set for example in 3310 */ |
2434 | if (error == ERR_NONE && Note->Entries[Time].Date.Year == 2090) { | 2440 | if (error == ERR_NONE && Note->Entries[Time].Date.Year == 2090) { |
2435 | error=N6110_GetDateTime(s, &date_time); | 2441 | error=N6110_GetDateTime(s, &date_time); |
2436 | if (error == ERR_NONE) Note->Entries[Time].Date.Year = date_time.Year; | 2442 | if (error == ERR_NONE) Note->Entries[Time].Date.Year = date_time.Year; |
2437 | } | 2443 | } |
2438 | return error; | 2444 | return error; |
2439 | } | 2445 | } |
2440 | 2446 | ||
2441 | GSM_Error N6110_ReplyUSSDInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) | 2447 | GSM_Error N6110_ReplyUSSDInfo(GSM_Protocol_Message msg, GSM_StateMachine *s) |
2442 | { | 2448 | { |
2443 | unsigned char buffer[2000],buffer2[4000]; | 2449 | unsigned char buffer[2000],buffer2[4000]; |
2444 | int tmp; | 2450 | int tmp; |
2445 | 2451 | ||
2446 | tmp=GSM_UnpackEightBitsToSeven(0, 82, 82, msg.Buffer+8, buffer); | 2452 | tmp=GSM_UnpackEightBitsToSeven(0, msg.Buffer[7], 82, msg.Buffer+8, buffer); |
2447 | msg.Buffer[tmp] = 0; | 2453 | buffer[tmp] = 0; |
2448 | 2454 | ||
2449 | smprintf(s, "USSD reply: \"%s\"\n",buffer); | 2455 | smprintf(s, "USSD reply: \"%s\"\n",buffer); |
2450 | 2456 | ||
2451 | if (s->Phone.Data.EnableIncomingUSSD && s->User.IncomingUSSD!=NULL) { | 2457 | if (s->Phone.Data.EnableIncomingUSSD && s->User.IncomingUSSD!=NULL) { |
2452 | EncodeUnicode(buffer2,buffer,strlen(buffer)); | 2458 | EncodeUnicode(buffer2,buffer,strlen(buffer)); |
2453 | s->User.IncomingUSSD(s->CurrentConfig->Device, buffer2); | 2459 | s->User.IncomingUSSD(s->CurrentConfig->Device, buffer2); |
2454 | } | 2460 | } |
2455 | 2461 | ||
2456 | return ERR_NONE; | 2462 | return ERR_NONE; |
2457 | } | 2463 | } |
2458 | 2464 | ||
2459 | GSM_Error N6110_AnswerCall(GSM_StateMachine *s, int ID, bool all) | 2465 | GSM_Error N6110_AnswerCall(GSM_StateMachine *s, int ID, bool all) |
2460 | { | 2466 | { |
2461 | GSM_Error error; | 2467 | GSM_Error error; |
2462 | unsigned char req1[] = {N6110_FRAME_HEADER, 0x42, 0x05, 0x01, | 2468 | unsigned char req1[] = {N6110_FRAME_HEADER, 0x42, 0x05, 0x01, |
2463 | 0x07, 0xa2, 0x88, 0x81, 0x21, 0x15, 0x63, 0xa8, | 2469 | 0x07, 0xa2, 0x88, 0x81, 0x21, 0x15, 0x63, 0xa8, |
2464 | 0x00, 0x00, 0x07, 0xa3, 0xb8, 0x81, 0x20, 0x15, | 2470 | 0x00, 0x00, 0x07, 0xa3, 0xb8, 0x81, 0x20, 0x15, |
2465 | 0x63, 0x80}; | 2471 | 0x63, 0x80}; |
2466 | 2472 | ||
2467 | if (!all) { | 2473 | if (!all) { |
2468 | smprintf(s, "Answering call part 1\n"); | 2474 | smprintf(s, "Answering call part 1\n"); |
2469 | error = GSM_WaitFor (s, req1, 24, 0x01, 5, ID_AnswerCall); | 2475 | error = GSM_WaitFor (s, req1, 24, 0x01, 5, ID_AnswerCall); |
2470 | if (error != ERR_NONE) return error; | 2476 | if (error != ERR_NONE) return error; |
2471 | return DCT3DCT4_AnswerCall(s,ID); | 2477 | return DCT3DCT4_AnswerCall(s,ID); |
2472 | } | 2478 | } |
2473 | 2479 | ||
2474 | return DCT3_AnswerAllCalls(s); | 2480 | return DCT3_AnswerAllCalls(s); |
2475 | } | 2481 | } |
2476 | 2482 | ||
2477 | static GSM_Error N6110_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber) | 2483 | static GSM_Error N6110_DialVoice(GSM_StateMachine *s, char *number, GSM_CallShowNumber ShowNumber) |
2478 | { | 2484 | { |
2479 | unsigned int pos = 4; | 2485 | unsigned int pos = 4; |
2480 | unsigned char req[100] = {N6110_FRAME_HEADER,0x01, | 2486 | unsigned char req[100] = {N6110_FRAME_HEADER,0x01, |
2481 | 0x0c}; /* Length of number */ | 2487 | 0x0c}; /* Length of number */ |
2482 | 2488 | ||
2483 | if (ShowNumber == GSM_CALL_DefaultNumberPresence) return DCT3_DialVoice(s,number,ShowNumber); | 2489 | if (ShowNumber == GSM_CALL_DefaultNumberPresence) return DCT3_DialVoice(s,number,ShowNumber); |
2484 | 2490 | ||
2485 | req[pos++] = strlen(number); | 2491 | req[pos++] = strlen(number); |
2486 | memcpy(req+pos,number,strlen(number)); | 2492 | memcpy(req+pos,number,strlen(number)); |
2487 | pos += strlen(number); | 2493 | pos += strlen(number); |
2488 | req[pos++] = 0x05; /* call type: voice - 0x05, data - 0x01 */ | 2494 | req[pos++] = 0x05; /* call type: voice - 0x05, data - 0x01 */ |
2489 | req[pos++] = 0x01; | 2495 | req[pos++] = 0x01; |
2490 | req[pos++] = 0x01; | 2496 | req[pos++] = 0x01; |
2491 | req[pos++] = 0x05; | 2497 | req[pos++] = 0x05; |
2492 | req[pos++] = 0x81; | 2498 | req[pos++] = 0x81; |
2493 | switch (ShowNumber) { | 2499 | switch (ShowNumber) { |
2494 | case GSM_CALL_HideNumber: | 2500 | case GSM_CALL_HideNumber: |
2495 | req[pos++] = 0x02; | 2501 | req[pos++] = 0x02; |
2496 | break; | 2502 | break; |
2497 | case GSM_CALL_ShowNumber: | 2503 | case GSM_CALL_ShowNumber: |
2498 | req[pos++] = 0x03; | 2504 | req[pos++] = 0x03; |
2499 | break; | 2505 | break; |
2500 | case GSM_CALL_DefaultNumberPresence: | 2506 | case GSM_CALL_DefaultNumberPresence: |
2501 | req[pos++] = 0x01; | 2507 | req[pos++] = 0x01; |
2502 | break; | 2508 | break; |
2503 | } | 2509 | } |
2504 | req[pos++] = 0x00; | 2510 | req[pos++] = 0x00; |
2505 | req[pos++] = 0x00; | 2511 | req[pos++] = 0x00; |
2506 | 2512 | ||
2507 | smprintf(s, "Making voice call\n"); | 2513 | smprintf(s, "Making voice call\n"); |
2508 | return GSM_WaitFor (s, req, pos, 0x01, 4, ID_DialVoice); | 2514 | return GSM_WaitFor (s, req, pos, 0x01, 4, ID_DialVoice); |
2509 | } | 2515 | } |
2510 | 2516 | ||
2511 | GSM_Error N6110_UnholdCall(GSM_StateMachine *s, int ID) | 2517 | GSM_Error N6110_UnholdCall(GSM_StateMachine *s, int ID) |
2512 | { | 2518 | { |
2513 | unsigned char req[] = {N6110_FRAME_HEADER, 0x24, 0x00, 0x02}; | 2519 | unsigned char req[] = {N6110_FRAME_HEADER, 0x24, 0x00, 0x02}; |
2514 | 2520 | ||
2515 | req[4] = (unsigned char)ID; | 2521 | req[4] = (unsigned char)ID; |
2516 | s->Phone.Data.CallID = ID; | 2522 | s->Phone.Data.CallID = ID; |
2517 | 2523 | ||
2518 | smprintf(s, "Unholding call\n"); | 2524 | smprintf(s, "Unholding call\n"); |
2519 | return GSM_WaitFor (s, req, 6, 0x01, 4, ID_UnholdCall); | 2525 | return GSM_WaitFor (s, req, 6, 0x01, 4, ID_UnholdCall); |
2520 | } | 2526 | } |
2521 | 2527 | ||
2522 | GSM_Error N6110_HoldCall(GSM_StateMachine *s, int ID) | 2528 | GSM_Error N6110_HoldCall(GSM_StateMachine *s, int ID) |
2523 | { | 2529 | { |
2524 | unsigned char req[] = {N6110_FRAME_HEADER, 0x22, 0x00, 0x00}; | 2530 | unsigned char req[] = {N6110_FRAME_HEADER, 0x22, 0x00, 0x00}; |
2525 | 2531 | ||
2526 | req[4] = (unsigned char)ID; | 2532 | req[4] = (unsigned char)ID; |
2527 | s->Phone.Data.CallID = ID; | 2533 | s->Phone.Data.CallID = ID; |
2528 | 2534 | ||
2529 | smprintf(s, "Unholding call\n"); | 2535 | smprintf(s, "Unholding call\n"); |
2530 | return GSM_WaitFor (s, req, 6, 0x01, 4, ID_HoldCall); | 2536 | return GSM_WaitFor (s, req, 6, 0x01, 4, ID_HoldCall); |
2531 | } | 2537 | } |
2532 | 2538 | ||
2533 | /* Joining selected call to current (and making conference) */ | 2539 | /* Joining selected call to current (and making conference) */ |
2534 | GSM_Error N6110_ConferenceCall(GSM_StateMachine *s, int ID) | 2540 | GSM_Error N6110_ConferenceCall(GSM_StateMachine *s, int ID) |
2535 | { | 2541 | { |
2536 | unsigned char req[] = {N6110_FRAME_HEADER, 0x28, 0x00, 0x01}; | 2542 | unsigned char req[] = {N6110_FRAME_HEADER, 0x28, 0x00, 0x01}; |
2537 | 2543 | ||
2538 | req[4] = (unsigned char)ID; | 2544 | req[4] = (unsigned char)ID; |
2539 | s->Phone.Data.CallID = ID; | 2545 | s->Phone.Data.CallID = ID; |
2540 | 2546 | ||
2541 | smprintf(s, "Conference call\n"); | 2547 | smprintf(s, "Conference call\n"); |
2542 | return GSM_WaitFor (s, req, 6, 0x01, 4, ID_ConferenceCall); | 2548 | return GSM_WaitFor (s, req, 6, 0x01, 4, ID_ConferenceCall); |
2543 | } | 2549 | } |
@@ -2714,171 +2720,172 @@ static GSM_Reply_Function N6110ReplyFunctions[] = { | |||
2714 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x16,ID_GetConnectSet }, | 2720 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x16,ID_GetConnectSet }, |
2715 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x17,ID_GetConnectSet }, | 2721 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x17,ID_GetConnectSet }, |
2716 | {DCT3_ReplySetWAPSettings, "\x3f",0x03,0x19,ID_SetConnectSet }, | 2722 | {DCT3_ReplySetWAPSettings, "\x3f",0x03,0x19,ID_SetConnectSet }, |
2717 | {DCT3_ReplySetWAPSettings, "\x3f",0x03,0x1A,ID_SetConnectSet }, | 2723 | {DCT3_ReplySetWAPSettings, "\x3f",0x03,0x1A,ID_SetConnectSet }, |
2718 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x1C,ID_GetConnectSet }, | 2724 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x1C,ID_GetConnectSet }, |
2719 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x1D,ID_GetConnectSet }, | 2725 | {DCT3_ReplyGetWAPSettings, "\x3f",0x03,0x1D,ID_GetConnectSet }, |
2720 | {DCT3_ReplySetWAPSettings, "\x3f",0x03,0x1F,ID_SetConnectSet }, | 2726 | {DCT3_ReplySetWAPSettings, "\x3f",0x03,0x1F,ID_SetConnectSet }, |
2721 | 2727 | ||
2722 | {DCT3_ReplyEnableSecurity, "\x40",0x02,0x64,ID_EnableSecurity }, | 2728 | {DCT3_ReplyEnableSecurity, "\x40",0x02,0x64,ID_EnableSecurity }, |
2723 | {N61_71_ReplyResetPhoneSettings, "\x40",0x02,0x65,ID_ResetPhoneSettings }, | 2729 | {N61_71_ReplyResetPhoneSettings, "\x40",0x02,0x65,ID_ResetPhoneSettings }, |
2724 | {DCT3_ReplyGetIMEI, "\x40",0x02,0x66,ID_GetIMEI }, | 2730 | {DCT3_ReplyGetIMEI, "\x40",0x02,0x66,ID_GetIMEI }, |
2725 | {DCT3_ReplyDialCommand, "\x40",0x02,0x7C,ID_DialVoice }, | 2731 | {DCT3_ReplyDialCommand, "\x40",0x02,0x7C,ID_DialVoice }, |
2726 | {DCT3_ReplyDialCommand, "\x40",0x02,0x7C,ID_CancelCall }, | 2732 | {DCT3_ReplyDialCommand, "\x40",0x02,0x7C,ID_CancelCall }, |
2727 | {DCT3_ReplyDialCommand, "\x40",0x02,0x7C,ID_AnswerCall }, | 2733 | {DCT3_ReplyDialCommand, "\x40",0x02,0x7C,ID_AnswerCall }, |
2728 | {DCT3_ReplyNetmonitor, "\x40",0x02,0x7E,ID_Netmonitor }, | 2734 | {DCT3_ReplyNetmonitor, "\x40",0x02,0x7E,ID_Netmonitor }, |
2729 | {DCT3_ReplyPlayTone, "\x40",0x02,0x8F,ID_PlayTone }, | 2735 | {DCT3_ReplyPlayTone, "\x40",0x02,0x8F,ID_PlayTone }, |
2730 | {N6110_ReplyGetRingtone, "\x40",0x02,0x9E,ID_GetRingtone }, | 2736 | {N6110_ReplyGetRingtone, "\x40",0x02,0x9E,ID_GetRingtone }, |
2731 | {N6110_ReplySetBinRingtone, "\x40",0x02,0xA0,ID_SetRingtone }, | 2737 | {N6110_ReplySetBinRingtone, "\x40",0x02,0xA0,ID_SetRingtone }, |
2732 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xC8,ID_GetHardware }, | 2738 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xC8,ID_GetHardware }, |
2733 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xC8,ID_GetPPM }, | 2739 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xC8,ID_GetPPM }, |
2734 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xCA,ID_GetProductCode }, | 2740 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xCA,ID_GetProductCode }, |
2735 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xCC,ID_GetManufactureMonth}, | 2741 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xCC,ID_GetManufactureMonth}, |
2736 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xCC,ID_GetOriginalIMEI }, | 2742 | {NOKIA_ReplyGetPhoneString, "\x40",0x02,0xCC,ID_GetOriginalIMEI }, |
2737 | 2743 | ||
2738 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x02,ID_GetBitmap }, | 2744 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x02,ID_GetBitmap }, |
2739 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x04,ID_SetBitmap }, | 2745 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x04,ID_SetBitmap }, |
2740 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x05,ID_SetBitmap }, | 2746 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x05,ID_SetBitmap }, |
2741 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x06,ID_GetBitmap }, | 2747 | {N6110_ReplyGetSetPicture, "\x47",0x03,0x06,ID_GetBitmap }, |
2742 | 2748 | ||
2743 | #ifndef ENABLE_LGPL | 2749 | #ifndef ENABLE_LGPL |
2744 | {N6110_ReplyGetMagicBytes, "\x64",0x00,0x00,ID_MakeAuthentication }, | 2750 | {N6110_ReplyGetMagicBytes, "\x64",0x00,0x00,ID_MakeAuthentication }, |
2745 | #endif | 2751 | #endif |
2746 | 2752 | ||
2747 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetModel }, | 2753 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetModel }, |
2748 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetFirmware }, | 2754 | {DCT3DCT4_ReplyGetModelFirmware, "\xD2",0x02,0x00,ID_GetFirmware }, |
2749 | {DCT3_ReplyPressKey, "\xD2",0x02,0x46,ID_PressKey }, | 2755 | {DCT3_ReplyPressKey, "\xD2",0x02,0x46,ID_PressKey }, |
2750 | {DCT3_ReplyPressKey, "\xD2",0x02,0x47,ID_PressKey }, | 2756 | {DCT3_ReplyPressKey, "\xD2",0x02,0x47,ID_PressKey }, |
2751 | 2757 | ||
2752 | {NULL, "\x00",0x00,0x00,ID_None } | 2758 | {NULL, "\x00",0x00,0x00,ID_None } |
2753 | }; | 2759 | }; |
2754 | 2760 | ||
2755 | GSM_Phone_Functions N6110Phone = { | 2761 | GSM_Phone_Functions N6110Phone = { |
2756 | "2100|3210|3310|3330|3390|3410|3610|5110|5110i|5130|5190|5210|5510|6110|6130|6150|6190|8210|8250|8290|8850|8855|8890", | 2762 | "2100|3210|3310|3330|3390|3410|3610|5110|5110i|5130|5190|5210|5510|6110|6130|6150|6190|8210|8250|8290|8850|8855|8890", |
2757 | N6110ReplyFunctions, | 2763 | N6110ReplyFunctions, |
2758 | N6110_Initialise, | 2764 | N6110_Initialise, |
2759 | PHONE_Terminate, | 2765 | PHONE_Terminate, |
2760 | GSM_DispatchMessage, | 2766 | GSM_DispatchMessage, |
2761 | N6110_ShowStartInfo, | 2767 | N6110_ShowStartInfo, |
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 | */ |