summaryrefslogtreecommitdiffabout
path: root/gammu/emb/common/phone/alcatel
Unidiff
Diffstat (limited to 'gammu/emb/common/phone/alcatel') (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/common/phone/alcatel/alcatel.c298
1 files changed, 155 insertions, 143 deletions
diff --git a/gammu/emb/common/phone/alcatel/alcatel.c b/gammu/emb/common/phone/alcatel/alcatel.c
index f004ad4..3821f13 100644
--- a/gammu/emb/common/phone/alcatel/alcatel.c
+++ b/gammu/emb/common/phone/alcatel/alcatel.c
@@ -11,5 +11,5 @@
11 * - BH4 series (535/735) 11 * - BH4 series (535/735)
12 * For some functions it uses normal AT mode (not implemented here, look at 12 * For some functions it uses normal AT mode (not implemented here, look at
13 * ../at/atgen.[ch]) for others it switches into binary mode and initialises 13 * ../at/atgen.[ch]) for others it switches into binary mode and initialises
14 * underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and 14 * underlaying protocol (see ../../protocol/alcatel/alcabus.[ch]) and
15 * communicates over it. Don't ask me why Alcatel uses such silly thing... 15 * communicates over it. Don't ask me why Alcatel uses such silly thing...
@@ -103,2 +103,3 @@ extern GSM_Error ATGEN_DeleteAllMemory (GSM_StateMachine *s, GSM_MemoryType typ
103 extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s); 103 extern GSM_Error ATGEN_DispatchMessage (GSM_StateMachine *s);
104 extern GSM_Error ATGEN_SetFastSMSSending(GSM_StateMachine *s, bool enable);
104 extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable); 105 extern GSM_Error ATGEN_SetIncomingCB (GSM_StateMachine *s, bool enable);
@@ -118,3 +119,3 @@ unsigned char GSM_AlcatelAlphabet[] =
118 0x83, 0x00,0x20, /* empty*/ 119 0x83, 0x00,0x20, /* empty*/
119 120
120 0x84, 0x00,0xe7, /* c cedilla*/ 121 0x84, 0x00,0xe7, /* c cedilla*/
@@ -170,14 +171,14 @@ unsigned char GSM_AlcatelAlphabet[] =
170 0xb5, 0x00,0x20, /* empty*/ 171 0xb5, 0x00,0x20, /* empty*/
171 172
172 0xb6, 0x01,0x48, /* n caron*/ 173 0xb6, 0x01,0x48, /* n caron*/
173 0xb7, 0x01,0x65, /* t caron*/ 174 0xb7, 0x01,0x65, /* t caron*/
174 175
175 0xb8, 0x00,0x20, /* empty*/ 176 0xb8, 0x00,0x20, /* empty*/
176 177
177 0xb9, 0x01,0x7e, /* z caron*/ 178 0xb9, 0x01,0x7e, /* z caron*/
178 0xba, 0x01,0xe7, /* g caron*/ 179 0xba, 0x01,0xe7, /* g caron*/
179 180
180 0xbb, 0x00,0x20, /* empty*/ 181 0xbb, 0x00,0x20, /* empty*/
181 0xbc, 0x00,0x20, /* empty*/ 182 0xbc, 0x00,0x20, /* empty*/
182 183
183 0xbd, 0x1e,0x20, /* G macron*/ 184 0xbd, 0x1e,0x20, /* G macron*/
@@ -198,3 +199,3 @@ unsigned char GSM_AlcatelAlphabet[] =
198 0xcc, 0x01,0x0f, /* d caron*/ 199 0xcc, 0x01,0x0f, /* d caron*/
199 200
200 0xcd, 0x00,0x20, /* empty*/ 201 0xcd, 0x00,0x20, /* empty*/
@@ -204,5 +205,5 @@ unsigned char GSM_AlcatelAlphabet[] =
204 0xd0, 0x00,0x5e, /* ^ */ 205 0xd0, 0x00,0x5e, /* ^ */
205 206
206 0xd1, 0x00,0x20, /* empty*/ 207 0xd1, 0x00,0x20, /* empty*/
207 208
208 0xd2, 0x00,0x7b, /* { */ 209 0xd2, 0x00,0x7b, /* { */
@@ -210,7 +211,7 @@ unsigned char GSM_AlcatelAlphabet[] =
210 0xd4, 0x00,0x7d, /* } */ 211 0xd4, 0x00,0x7d, /* } */
211 212
212 0xd5, 0x00,0x20, /* empty*/ 213 0xd5, 0x00,0x20, /* empty*/
213 214
214 0xd6, 0x01,0x63, /* t cedilla*/ 215 0xd6, 0x01,0x63, /* t cedilla*/
215 216
216 0xd7, 0x00,0x20, /* empty*/ 217 0xd7, 0x00,0x20, /* empty*/
@@ -225,5 +226,5 @@ unsigned char GSM_AlcatelAlphabet[] =
225 0xe0, 0x00,0x20, /* empty*/ 226 0xe0, 0x00,0x20, /* empty*/
226 227
227 0xe1, 0x00,0x20, /* two candles*/ /* FIXME */ 228 0xe1, 0x00,0x20, /* two candles*/ /* FIXME */
228 229
229 0xe2, 0x00,0x20, /* empty*/ 230 0xe2, 0x00,0x20, /* empty*/
@@ -231,3 +232,3 @@ unsigned char GSM_AlcatelAlphabet[] =
231 0xe4, 0x00,0x20, /* empty*/ 232 0xe4, 0x00,0x20, /* empty*/
232 233
233 0xe5, 0x01,0xce, /* a caron*/ 234 0xe5, 0x01,0xce, /* a caron*/
@@ -241,8 +242,8 @@ unsigned char GSM_AlcatelAlphabet[] =
241 0xed, 0x00,0x20,/* some strange char :-) */ /* FIXME */ 242 0xed, 0x00,0x20,/* some strange char :-) */ /* FIXME */
242 243
243 0xee, 0x00,0x20, /* big key stroken*/ /* FIXME */ 244 0xee, 0x00,0x20, /* big key stroken*/ /* FIXME */
244 0xef, 0x00,0x20, /* big key*/ /* FIXME */ 245 0xef, 0x00,0x20, /* big key*/ /* FIXME */
245 246
246 0xf0, 0x00,0x20, /* empty*/ 247 0xf0, 0x00,0x20, /* empty*/
247 248
248 0xf1, 0x00,0x31, /* 1 */ 249 0xf1, 0x00,0x31, /* 1 */
@@ -253,12 +254,12 @@ unsigned char GSM_AlcatelAlphabet[] =
253 0xf6, 0x26,0x6a, /* note */ 254 0xf6, 0x26,0x6a, /* note */
254 255
255 0xf7, 0x27,0x13, /* okay inv*/ /* FIXME */ 256 0xf7, 0x27,0x13, /* okay inv*/ /* FIXME */
256 0xf8, 0x27,0x13, /* okay */ 257 0xf8, 0x27,0x13, /* okay */
257 258
258 0xf9, 0x00,0x20, /* empty*/ 259 0xf9, 0x00,0x20, /* empty*/
259 260
260 0xfa, 0x00,0x20, /* key */ /* FIXME */ 261 0xfa, 0x00,0x20, /* key */ /* FIXME */
261 262
262 0xfb, 0x00,0x20, /* empty*/ 263 0xfb, 0x00,0x20, /* empty*/
263 264
264 0xfc, 0x20,0xac, /* Euro */ 265 0xfc, 0x20,0xac, /* Euro */
@@ -268,3 +269,3 @@ unsigned char GSM_AlcatelAlphabet[] =
268 0xff, 0x00,0x20, /* empty*/ 269 0xff, 0x00,0x20, /* empty*/
269 270
270 0x00, 0x00,0x00 271 0x00, 0x00,0x00
@@ -317,3 +318,3 @@ static GSM_Error ALCATEL_SetBinaryMode(GSM_StateMachine *s)
317 if (error != ERR_NONE) return error; 318 if (error != ERR_NONE) return error;
318 319
319 error=GSM_WaitFor (s, "AT+CPROT=?\r", 11, 0x02, 4, ID_AlcatelProtocol); 320 error=GSM_WaitFor (s, "AT+CPROT=?\r", 11, 0x02, 4, ID_AlcatelProtocol);
@@ -326,3 +327,3 @@ static GSM_Error ALCATEL_SetBinaryMode(GSM_StateMachine *s)
326 } 327 }
327 328
328 if (error == ERR_TIMEOUT && s->Speed != 19200) { 329 if (error == ERR_TIMEOUT && s->Speed != 19200) {
@@ -330,3 +331,3 @@ static GSM_Error ALCATEL_SetBinaryMode(GSM_StateMachine *s)
330 } 331 }
331 332
332 if (error != ERR_NONE) return error; 333 if (error != ERR_NONE) return error;
@@ -378,3 +379,3 @@ static GSM_Error ALCATEL_GoToBinaryState(GSM_StateMachine *s, GSM_Alcatel_Binary
378 unsigned char commit_buffer[] = 379 unsigned char commit_buffer[] =
379 {0x00, 0x04, 380 {0x00, 0x04,
380 0x00, /*type */ 381 0x00, /*type */
@@ -445,3 +446,3 @@ static GSM_Error ALCATEL_GoToBinaryState(GSM_StateMachine *s, GSM_Alcatel_Binary
445 if (error != ERR_NONE) return error; 446 if (error != ERR_NONE) return error;
446 447
447 switch (Priv->BinaryType) { 448 switch (Priv->BinaryType) {
@@ -546,2 +547,4 @@ static GSM_Error ALCATEL_SetATMode(GSM_StateMachine *s)
546 Priv->Mode = ModeAT; 547 Priv->Mode = ModeAT;
548 s->Phone.Data.Priv.ATGEN.PBKCharset= 0;
549 s->Phone.Data.Priv.ATGEN.PBKMemory= 0;
547 550
@@ -630,3 +633,3 @@ static GSM_Error ALCATEL_IsIdAvailable(GSM_StateMachine *s, int id) {
630 } 633 }
631 634
632 for (i=0; i<*Priv->CurrentCount; i++) { 635 for (i=0; i<*Priv->CurrentCount; i++) {
@@ -634,3 +637,3 @@ static GSM_Error ALCATEL_IsIdAvailable(GSM_StateMachine *s, int id) {
634 } 637 }
635 638
636 return ERR_EMPTY; 639 return ERR_EMPTY;
@@ -848,3 +851,3 @@ static GSM_Error ALCATEL_ReplyGetFieldValue(GSM_Protocol_Message msg, GSM_StateM
848 Priv->ReturnDateTime.Second= buffer[6]; 851 Priv->ReturnDateTime.Second= buffer[6];
849 852
850 Priv->ReturnDateTime.Day= 0; 853 Priv->ReturnDateTime.Day= 0;
@@ -1098,3 +1101,3 @@ static GSM_Error ALCATEL_GetCategoryText(GSM_StateMachine *s, int id) {
1098 GSM_Error error; 1101 GSM_Error error;
1099 1102
1100 if (Priv->CurrentCategoriesCache[id][0] != '\000' || Priv->CurrentCategoriesCache[id][1] != '\000') { 1103 if (Priv->CurrentCategoriesCache[id][0] != '\000' || Priv->CurrentCategoriesCache[id][1] != '\000') {
@@ -1103,3 +1106,3 @@ static GSM_Error ALCATEL_GetCategoryText(GSM_StateMachine *s, int id) {
1103 } 1106 }
1104 1107
1105 smprintf(s,"Reading category %d\n", id); 1108 smprintf(s,"Reading category %d\n", id);
@@ -1125,3 +1128,3 @@ static GSM_Error ALCATEL_GetCategoryText(GSM_StateMachine *s, int id) {
1125 if (error != ERR_NONE) return error; 1128 if (error != ERR_NONE) return error;
1126 1129
1127 CopyUnicodeString(Priv->CurrentCategoriesCache[id], Priv->ReturnString); 1130 CopyUnicodeString(Priv->CurrentCategoriesCache[id], Priv->ReturnString);
@@ -1215,5 +1218,5 @@ static GSM_Error ALCATEL_BuildWriteBuffer(unsigned char * buffer, GSM_Alcatel_Fi
1215 int len; 1218 int len;
1216 1219
1217 buffer[1] = field & 0xff; 1220 buffer[1] = field & 0xff;
1218 1221
1219 switch(type) { 1222 switch(type) {
@@ -1331,6 +1334,6 @@ static GSM_Error ALCATEL_CreateField(GSM_StateMachine *s, GSM_Alcatel_FieldType
1331 if (error != ERR_NONE) return error; 1334 if (error != ERR_NONE) return error;
1332 1335
1333 error = GSM_WaitFor (s, buffer, 8 + buffer[6], 0x02, ALCATEL_TIMEOUT, ID_AlcatelCreateField); 1336 error = GSM_WaitFor (s, buffer, 8 + buffer[6], 0x02, ALCATEL_TIMEOUT, ID_AlcatelCreateField);
1334 if (error != ERR_NONE) return error; 1337 if (error != ERR_NONE) return error;
1335 1338
1336 return ERR_NONE; 1339 return ERR_NONE;
@@ -1344,3 +1347,3 @@ static GSM_Error ALCATEL_UpdateField(GSM_StateMachine *s, GSM_Alcatel_FieldType
1344 0x00, /* type */ 1347 0x00, /* type */
1345 0x26, 0x01, 1348 0x26, 0x01,
1346 0x00, 0x00, 0x00, 0x00,/* id */ 1349 0x00, 0x00, 0x00, 0x00,/* id */
@@ -1352,3 +1355,3 @@ static GSM_Error ALCATEL_UpdateField(GSM_StateMachine *s, GSM_Alcatel_FieldType
1352 smprintf(s,"Updating field (%08x.%02x)\n", id, field); 1355 smprintf(s,"Updating field (%08x.%02x)\n", id, field);
1353 1356
1354 buffer[5] = (id >> 24); 1357 buffer[5] = (id >> 24);
@@ -1371,6 +1374,6 @@ static GSM_Error ALCATEL_UpdateField(GSM_StateMachine *s, GSM_Alcatel_FieldType
1371 if (error != ERR_NONE) return error; 1374 if (error != ERR_NONE) return error;
1372 1375
1373 error = GSM_WaitFor (s, buffer, 12 + buffer[10], 0x02, ALCATEL_TIMEOUT, ID_AlcatelUpdateField); 1376 error = GSM_WaitFor (s, buffer, 12 + buffer[10], 0x02, ALCATEL_TIMEOUT, ID_AlcatelUpdateField);
1374 if (error != ERR_NONE) return error; 1377 if (error != ERR_NONE) return error;
1375 1378
1376 return ERR_NONE; 1379 return ERR_NONE;
@@ -1745,3 +1748,3 @@ static GSM_Error ALCATEL_GetNextMemory(GSM_StateMachine *s, GSM_MemoryEntry *ent
1745 if (Priv->ContactsItemsCount == 0) return ERR_EMPTY; 1748 if (Priv->ContactsItemsCount == 0) return ERR_EMPTY;
1746 1749
1747 if (start) entry->Location = 0; 1750 if (start) entry->Location = 0;
@@ -1770,3 +1773,3 @@ static GSM_Error ALCATEL_AddMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1770 switch (entry->Entries[i].EntryType) { 1773 switch (entry->Entries[i].EntryType) {
1771 case PBK_Number_General: 1774 case PBK_Number_General:
1772 if ((error = ALCATEL_CreateField(s, Alcatel_phone, 8, entry->Entries[i].Text)) != ERR_NONE) return error; 1775 if ((error = ALCATEL_CreateField(s, Alcatel_phone, 8, entry->Entries[i].Text)) != ERR_NONE) return error;
@@ -1779,3 +1782,3 @@ static GSM_Error ALCATEL_AddMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1779 break; 1782 break;
1780 case PBK_Number_Fax: 1783 case PBK_Number_Fax:
1781 if ((error = ALCATEL_CreateField(s, Alcatel_phone, 9, entry->Entries[i].Text)) != ERR_NONE) return error; 1784 if ((error = ALCATEL_CreateField(s, Alcatel_phone, 9, entry->Entries[i].Text)) != ERR_NONE) return error;
@@ -1811,9 +1814,9 @@ static GSM_Error ALCATEL_AddMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1811 break; 1814 break;
1812 case PBK_Text_JobTitle: 1815 case PBK_Text_JobTitle:
1813 if ((error = ALCATEL_CreateField(s, Alcatel_string, 3, entry->Entries[i].Text)) != ERR_NONE) return error; 1816 if ((error = ALCATEL_CreateField(s, Alcatel_string, 3, entry->Entries[i].Text)) != ERR_NONE) return error;
1814 break; 1817 break;
1815 case PBK_Category: 1818 case PBK_Category:
1816 if ((error = ALCATEL_CreateField(s, Alcatel_byte, 5, &(entry->Entries[i].Number))) != ERR_NONE) return error; 1819 if ((error = ALCATEL_CreateField(s, Alcatel_byte, 5, &(entry->Entries[i].Number))) != ERR_NONE) return error;
1817 break; 1820 break;
1818 case PBK_Private: 1821 case PBK_Private:
1819 if ((error = ALCATEL_CreateField(s, Alcatel_bool, 6, &(entry->Entries[i].Number))) != ERR_NONE) return error; 1822 if ((error = ALCATEL_CreateField(s, Alcatel_bool, 6, &(entry->Entries[i].Number))) != ERR_NONE) return error;
@@ -1842,3 +1845,3 @@ static GSM_Error ALCATEL_AddMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1842 case PBK_Text_Custom3: 1845 case PBK_Text_Custom3:
1843 if ((error = ALCATEL_CreateField(s, Alcatel_string, 23, entry->Entries[i].Text)) != ERR_NONE) return error; 1846 if ((error = ALCATEL_CreateField(s, Alcatel_string, 23, entry->Entries[i].Text)) != ERR_NONE) return error;
1844 break; 1847 break;
@@ -1847,3 +1850,3 @@ static GSM_Error ALCATEL_AddMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1847 break; 1850 break;
1848 case PBK_PictureID: 1851 case PBK_PictureID:
1849 if (s->Phone.Data.Priv.ALCATEL.ProtocolVersion == V_1_1) { 1852 if (s->Phone.Data.Priv.ALCATEL.ProtocolVersion == V_1_1) {
@@ -1908,5 +1911,5 @@ static GSM_Error ALCATEL_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1908 if ((error = ALCATEL_GetFields(s, entry->Location))!= ERR_NONE) return error; 1911 if ((error = ALCATEL_GetFields(s, entry->Location))!= ERR_NONE) return error;
1909 1912
1910 for (i = 0; i < 26; i++) { UpdatedFields[i] = false; } 1913 for (i = 0; i < 26; i++) { UpdatedFields[i] = false; }
1911 1914
1912 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeContacts, entry->Location))!= ERR_NONE) return error; 1915 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeContacts, entry->Location))!= ERR_NONE) return error;
@@ -1914,24 +1917,24 @@ static GSM_Error ALCATEL_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1914 switch (entry->Entries[i].EntryType) { 1917 switch (entry->Entries[i].EntryType) {
1915 case PBK_Number_General: 1918 case PBK_Number_General:
1916 UpdatedFields[8] = true; 1919 UpdatedFields[8] = true;
1917 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 8, entry->Entries[i].Text)) != ERR_NONE) return error; 1920 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 8, entry->Entries[i].Text)) != ERR_NONE) return error;
1918 break; 1921 break;
1919 case PBK_Number_Mobile: 1922 case PBK_Number_Mobile:
1920 UpdatedFields[12] = true; 1923 UpdatedFields[12] = true;
1921 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 12, entry->Entries[i].Text)) != ERR_NONE) return error; 1924 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 12, entry->Entries[i].Text)) != ERR_NONE) return error;
1922 break; 1925 break;
1923 case PBK_Number_Work: 1926 case PBK_Number_Work:
1924 UpdatedFields[7] = true; 1927 UpdatedFields[7] = true;
1925 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 7, entry->Entries[i].Text)) != ERR_NONE) return error; 1928 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 7, entry->Entries[i].Text)) != ERR_NONE) return error;
1926 break; 1929 break;
1927 case PBK_Number_Fax: 1930 case PBK_Number_Fax:
1928 UpdatedFields[9] = true; 1931 UpdatedFields[9] = true;
1929 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 9, entry->Entries[i].Text)) != ERR_NONE) return error; 1932 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 9, entry->Entries[i].Text)) != ERR_NONE) return error;
1930 break; 1933 break;
1931 case PBK_Number_Home: 1934 case PBK_Number_Home:
1932 UpdatedFields[13] = true; 1935 UpdatedFields[13] = true;
1933 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 13, entry->Entries[i].Text)) != ERR_NONE) return error; 1936 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 13, entry->Entries[i].Text)) != ERR_NONE) return error;
1934 break; 1937 break;
1935 case PBK_Number_Pager: 1938 case PBK_Number_Pager:
1936 UpdatedFields[11] = true; 1939 UpdatedFields[11] = true;
1937 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 11, entry->Entries[i].Text)) != ERR_NONE) return error; 1940 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 11, entry->Entries[i].Text)) != ERR_NONE) return error;
@@ -1940,29 +1943,29 @@ static GSM_Error ALCATEL_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1940 UpdatedFields[10] = true; 1943 UpdatedFields[10] = true;
1941 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 10, entry->Entries[i].Text)) != ERR_NONE) return error; 1944 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, entry->Location, 10, entry->Entries[i].Text)) != ERR_NONE) return error;
1942 break; 1945 break;
1943 case PBK_Text_Note: 1946 case PBK_Text_Note:
1944 UpdatedFields[4] = true; 1947 UpdatedFields[4] = true;
1945 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 4, entry->Entries[i].Text)) != ERR_NONE) return error; 1948 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 4, entry->Entries[i].Text)) != ERR_NONE) return error;
1946 break; 1949 break;
1947 case PBK_Text_Email: 1950 case PBK_Text_Email:
1948 UpdatedFields[14] = true; 1951 UpdatedFields[14] = true;
1949 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 14, entry->Entries[i].Text)) != ERR_NONE) return error; 1952 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 14, entry->Entries[i].Text)) != ERR_NONE) return error;
1950 break; 1953 break;
1951 case PBK_Text_Email2: 1954 case PBK_Text_Email2:
1952 UpdatedFields[15] = true; 1955 UpdatedFields[15] = true;
1953 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 15, entry->Entries[i].Text)) != ERR_NONE) return error; 1956 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 15, entry->Entries[i].Text)) != ERR_NONE) return error;
1954 break; 1957 break;
1955 case PBK_Text_LastName: 1958 case PBK_Text_LastName:
1956 UpdatedFields[0] = true; 1959 UpdatedFields[0] = true;
1957 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 0, entry->Entries[i].Text)) != ERR_NONE) return error; NameSet = true; 1960 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 0, entry->Entries[i].Text)) != ERR_NONE) return error; NameSet = true;
1958 break; 1961 break;
1959 case PBK_Text_FirstName: 1962 case PBK_Text_FirstName:
1960 UpdatedFields[1] = true; 1963 UpdatedFields[1] = true;
1961 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 1, entry->Entries[i].Text)) != ERR_NONE) return error; NameSet = true; 1964 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 1, entry->Entries[i].Text)) != ERR_NONE) return error; NameSet = true;
1962 break; 1965 break;
1963 case PBK_Text_Company: 1966 case PBK_Text_Company:
1964 UpdatedFields[2] = true; 1967 UpdatedFields[2] = true;
1965 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 2, entry->Entries[i].Text)) != ERR_NONE) return error; 1968 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 2, entry->Entries[i].Text)) != ERR_NONE) return error;
1966 break; 1969 break;
1967 case PBK_Text_JobTitle: 1970 case PBK_Text_JobTitle:
1968 UpdatedFields[3] = true; 1971 UpdatedFields[3] = true;
@@ -1971,3 +1974,3 @@ static GSM_Error ALCATEL_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1971 case PBK_Category: 1974 case PBK_Category:
1972 UpdatedFields[5] = true; 1975 UpdatedFields[5] = true;
1973 if ((error = ALCATEL_UpdateField(s, Alcatel_byte, entry->Location, 5, &(entry->Entries[i].Number))) != ERR_NONE) return error; 1976 if ((error = ALCATEL_UpdateField(s, Alcatel_byte, entry->Location, 5, &(entry->Entries[i].Number))) != ERR_NONE) return error;
@@ -1978,17 +1981,17 @@ static GSM_Error ALCATEL_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
1978 break; 1981 break;
1979 case PBK_Text_StreetAddress: 1982 case PBK_Text_StreetAddress:
1980 UpdatedFields[16] = true; 1983 UpdatedFields[16] = true;
1981 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 16, entry->Entries[i].Text)) != ERR_NONE) return error; 1984 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 16, entry->Entries[i].Text)) != ERR_NONE) return error;
1982 break; 1985 break;
1983 case PBK_Text_City: 1986 case PBK_Text_City:
1984 UpdatedFields[17] = true; 1987 UpdatedFields[17] = true;
1985 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 17, entry->Entries[i].Text)) != ERR_NONE) return error; 1988 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 17, entry->Entries[i].Text)) != ERR_NONE) return error;
1986 break; 1989 break;
1987 case PBK_Text_State: 1990 case PBK_Text_State:
1988 UpdatedFields[18] = true; 1991 UpdatedFields[18] = true;
1989 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 18, entry->Entries[i].Text)) != ERR_NONE) return error; 1992 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 18, entry->Entries[i].Text)) != ERR_NONE) return error;
1990 break; 1993 break;
1991 case PBK_Text_Zip: 1994 case PBK_Text_Zip:
1992 UpdatedFields[19] = true; 1995 UpdatedFields[19] = true;
1993 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 19, entry->Entries[i].Text)) != ERR_NONE) return error; 1996 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 19, entry->Entries[i].Text)) != ERR_NONE) return error;
1994 break; 1997 break;
@@ -2002,3 +2005,3 @@ static GSM_Error ALCATEL_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
2002 break; 2005 break;
2003 case PBK_Text_Custom2: 2006 case PBK_Text_Custom2:
2004 UpdatedFields[22] = true; 2007 UpdatedFields[22] = true;
@@ -2011,6 +2014,6 @@ static GSM_Error ALCATEL_SetMemory(GSM_StateMachine *s, GSM_MemoryEntry *entry)
2011 case PBK_Text_Custom4: 2014 case PBK_Text_Custom4:
2012 UpdatedFields[24] = true; 2015 UpdatedFields[24] = true;
2013 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 24, entry->Entries[i].Text)) != ERR_NONE) return error 2016 if ((error = ALCATEL_UpdateField(s, Alcatel_string, entry->Location, 24, entry->Entries[i].Text)) != ERR_NONE) return error
2014 ; break; 2017 ; break;
2015 case PBK_PictureID: 2018 case PBK_PictureID:
2016 if (s->Phone.Data.Priv.ALCATEL.ProtocolVersion == V_1_1) { 2019 if (s->Phone.Data.Priv.ALCATEL.ProtocolVersion == V_1_1) {
@@ -2071,3 +2074,3 @@ static GSM_Error ALCATEL_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entr
2071 if (error != ERR_NONE) return error; 2074 if (error != ERR_NONE) return error;
2072 2075
2073 /* Refresh list */ 2076 /* Refresh list */
@@ -2075,3 +2078,3 @@ static GSM_Error ALCATEL_DeleteMemory(GSM_StateMachine *s, GSM_MemoryEntry *entr
2075 if ((error = ALCATEL_GetAvailableIds(s, true))!= ERR_NONE) return error; 2078 if ((error = ALCATEL_GetAvailableIds(s, true))!= ERR_NONE) return error;
2076 2079
2077 return ERR_NONE; 2080 return ERR_NONE;
@@ -2230,3 +2233,3 @@ static GSM_Error ALCATEL_GetDisplayStatus(GSM_StateMachine *s, GSM_DisplayFeatur
2230} 2233}
2231 2234
2232static GSM_Error ALCATEL_SetAutoNetworkLogin(GSM_StateMachine *s) 2235static GSM_Error ALCATEL_SetAutoNetworkLogin(GSM_StateMachine *s)
@@ -2339,5 +2342,5 @@ static GSM_Error ALCATEL_GetCalendarStatus(GSM_StateMachine *s, GSM_CalendarStat
2339 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL; 2342 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL;
2340 2343
2341 status->Used = 0; 2344 status->Used = 0;
2342 2345
2343 if ((error = ALCATEL_GoToBinaryState(s, StateSession, TypeCalendar, 0))!= ERR_NONE) return error; 2346 if ((error = ALCATEL_GoToBinaryState(s, StateSession, TypeCalendar, 0))!= ERR_NONE) return error;
@@ -2729,3 +2732,3 @@ static GSM_Error ALCATEL_GetNextCalendar(GSM_StateMachine *s, GSM_CalendarEntry
2729 if (Priv->CalendarItemsCount == 0) return ERR_EMPTY; 2732 if (Priv->CalendarItemsCount == 0) return ERR_EMPTY;
2730 2733
2731 if (start) Note->Location = 0; 2734 if (start) Note->Location = 0;
@@ -2770,3 +2773,3 @@ static GSM_Error ALCATEL_AddCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2770 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeCalendar, 0))!= ERR_NONE) return error; 2773 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeCalendar, 0))!= ERR_NONE) return error;
2771 2774
2772 for (i = 0; i < Note->EntriesNum; i++) { 2775 for (i = 0; i < Note->EntriesNum; i++) {
@@ -2808,3 +2811,3 @@ static GSM_Error ALCATEL_AddCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2808 phone_set = true; 2811 phone_set = true;
2809 break; 2812 break;
2810 case CAL_REPEAT_DAYOFWEEK: 2813 case CAL_REPEAT_DAYOFWEEK:
@@ -2844,3 +2847,3 @@ static GSM_Error ALCATEL_AddCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2844 } 2847 }
2845 2848
2846 switch (Note->Type) { 2849 switch (Note->Type) {
@@ -2902,3 +2905,3 @@ static GSM_Error ALCATEL_SetCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2902 if ((error = ALCATEL_GetFields(s, Note->Location))!= ERR_NONE) return error; 2905 if ((error = ALCATEL_GetFields(s, Note->Location))!= ERR_NONE) return error;
2903 2906
2904 for (i = 0; i < 22; i++) { UpdatedFields[i] = false; } 2907 for (i = 0; i < 22; i++) { UpdatedFields[i] = false; }
@@ -2906,3 +2909,3 @@ static GSM_Error ALCATEL_SetCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2906 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeCalendar, Note->Location))!= ERR_NONE) return error; 2909 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeCalendar, Note->Location))!= ERR_NONE) return error;
2907 2910
2908 for (i = 0; i < Note->EntriesNum; i++) { 2911 for (i = 0; i < Note->EntriesNum; i++) {
@@ -2911,3 +2914,3 @@ static GSM_Error ALCATEL_SetCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2911 if (!date_set) { 2914 if (!date_set) {
2912 UpdatedFields[0] = true; 2915 UpdatedFields[0] = true;
2913 if ((error = ALCATEL_UpdateField(s, Alcatel_date, Note->Location, 0, &(Note->Entries[i].Date))) != ERR_NONE) return error; 2916 if ((error = ALCATEL_UpdateField(s, Alcatel_date, Note->Location, 0, &(Note->Entries[i].Date))) != ERR_NONE) return error;
@@ -2955,3 +2958,3 @@ static GSM_Error ALCATEL_SetCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2955 phone_set = true; 2958 phone_set = true;
2956 break; 2959 break;
2957 case CAL_REPEAT_DAYOFWEEK: 2960 case CAL_REPEAT_DAYOFWEEK:
@@ -2998,3 +3001,3 @@ static GSM_Error ALCATEL_SetCalendar(GSM_StateMachine *s, GSM_CalendarEntry *Not
2998 } 3001 }
2999 3002
3000 switch (Note->Type) { 3003 switch (Note->Type) {
@@ -3074,3 +3077,3 @@ static GSM_Error ALCATEL_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm)
3074 if ((error = ALCATEL_GetAvailableIds(s, false))!= ERR_NONE) return error; 3077 if ((error = ALCATEL_GetAvailableIds(s, false))!= ERR_NONE) return error;
3075 3078
3076 for (i=0; i<Priv->CalendarItemsCount; i++) { 3079 for (i=0; i<Priv->CalendarItemsCount; i++) {
@@ -3093,3 +3096,3 @@ static GSM_Error ALCATEL_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm)
3093 Note.Location = Priv->CalendarItems[i]; 3096 Note.Location = Priv->CalendarItems[i];
3094 3097
3095 if ((error = ALCATEL_GetCalendar(s, &Note))!= ERR_NONE) return error; 3098 if ((error = ALCATEL_GetCalendar(s, &Note))!= ERR_NONE) return error;
@@ -3101,3 +3104,3 @@ static GSM_Error ALCATEL_GetAlarm(GSM_StateMachine *s, GSM_Alarm *alarm)
3101 } 3104 }
3102 3105
3103 alarm->Text[0] = 0; alarm->Text[1] = 0; 3106 alarm->Text[0] = 0; alarm->Text[1] = 0;
@@ -3148,3 +3151,3 @@ static GSM_Error ALCATEL_SetAlarm (GSM_StateMachine *s, GSM_Alarm *alarm)
3148 } 3151 }
3149 3152
3150 if (Found) { 3153 if (Found) {
@@ -3186,5 +3189,5 @@ static GSM_Error ALCATEL_GetToDoStatus(GSM_StateMachine *s, GSM_ToDoStatus *stat
3186 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL; 3189 GSM_Phone_ALCATELData*Priv = &s->Phone.Data.Priv.ALCATEL;
3187 3190
3188 status->Used = 0; 3191 status->Used = 0;
3189 3192
3190 if ((error = ALCATEL_GoToBinaryState(s, StateSession, TypeToDo, 0))!= ERR_NONE) return error; 3193 if ((error = ALCATEL_GoToBinaryState(s, StateSession, TypeToDo, 0))!= ERR_NONE) return error;
@@ -3453,3 +3456,3 @@ static GSM_Error ALCATEL_GetNextToDo(GSM_StateMachine *s, GSM_ToDoEntry *ToDo, b
3453 if (Priv->ToDoItemsCount == 0) return ERR_EMPTY; 3456 if (Priv->ToDoItemsCount == 0) return ERR_EMPTY;
3454 3457
3455 if (start) ToDo->Location = 0; 3458 if (start) ToDo->Location = 0;
@@ -3492,3 +3495,3 @@ static GSM_Error ALCATEL_AddToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3492 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeToDo, 0))!= ERR_NONE) return error; 3495 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeToDo, 0))!= ERR_NONE) return error;
3493 3496
3494 switch (ToDo->Priority) { 3497 switch (ToDo->Priority) {
@@ -3520,3 +3523,3 @@ static GSM_Error ALCATEL_AddToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3520 break; 3523 break;
3521 case TODO_ALARM_DATETIME: 3524 case TODO_ALARM_DATETIME:
3522 if ((error = ALCATEL_CreateField(s, Alcatel_date, 2, &(ToDo->Entries[i].Date))) != ERR_NONE) return error; 3525 if ((error = ALCATEL_CreateField(s, Alcatel_date, 2, &(ToDo->Entries[i].Date))) != ERR_NONE) return error;
@@ -3581,5 +3584,5 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3581 if ((error = ALCATEL_GetFields(s, ToDo->Location))!= ERR_NONE) return error; 3584 if ((error = ALCATEL_GetFields(s, ToDo->Location))!= ERR_NONE) return error;
3582 3585
3583 for (i = 0; i < 12; i++) { UpdatedFields[i] = false; } 3586 for (i = 0; i < 12; i++) { UpdatedFields[i] = false; }
3584 3587
3585 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeToDo, ToDo->Location))!= ERR_NONE) return error; 3588 if ((error = ALCATEL_GoToBinaryState(s, StateEdit, TypeToDo, ToDo->Location))!= ERR_NONE) return error;
@@ -3610,3 +3613,3 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3610 if ((error = ALCATEL_UpdateField(s, Alcatel_date, ToDo->Location, 0, &(ToDo->Entries[i].Date))) != ERR_NONE) return error; 3613 if ((error = ALCATEL_UpdateField(s, Alcatel_date, ToDo->Location, 0, &(ToDo->Entries[i].Date))) != ERR_NONE) return error;
3611 UpdatedFields[0] = true; 3614 UpdatedFields[0] = true;
3612 break; 3615 break;
@@ -3614,13 +3617,13 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3614 if ((error = ALCATEL_UpdateField(s, Alcatel_bool, ToDo->Location, 1, &(ToDo->Entries[i].Number))) != ERR_NONE) return error; 3617 if ((error = ALCATEL_UpdateField(s, Alcatel_bool, ToDo->Location, 1, &(ToDo->Entries[i].Number))) != ERR_NONE) return error;
3615 UpdatedFields[1] = true; 3618 UpdatedFields[1] = true;
3616 break; 3619 break;
3617 case TODO_ALARM_DATETIME: 3620 case TODO_ALARM_DATETIME:
3618 if ((error = ALCATEL_UpdateField(s, Alcatel_date, ToDo->Location, 2, &(ToDo->Entries[i].Date))) != ERR_NONE) return error; 3621 if ((error = ALCATEL_UpdateField(s, Alcatel_date, ToDo->Location, 2, &(ToDo->Entries[i].Date))) != ERR_NONE) return error;
3619 UpdatedFields[2] = true; 3622 UpdatedFields[2] = true;
3620 if ((error = ALCATEL_UpdateField(s, Alcatel_time, ToDo->Location, 3, &(ToDo->Entries[i].Date))) != ERR_NONE) return error; 3623 if ((error = ALCATEL_UpdateField(s, Alcatel_time, ToDo->Location, 3, &(ToDo->Entries[i].Date))) != ERR_NONE) return error;
3621 UpdatedFields[3] = true; 3624 UpdatedFields[3] = true;
3622 if ((error = ALCATEL_UpdateField(s, Alcatel_date, ToDo->Location, 10, &(ToDo->Entries[i].Date))) != ERR_NONE) return error; 3625 if ((error = ALCATEL_UpdateField(s, Alcatel_date, ToDo->Location, 10, &(ToDo->Entries[i].Date))) != ERR_NONE) return error;
3623 UpdatedFields[10] = true; 3626 UpdatedFields[10] = true;
3624 if ((error = ALCATEL_UpdateField(s, Alcatel_time, ToDo->Location, 11, &(ToDo->Entries[i].Date))) != ERR_NONE) return error; 3627 if ((error = ALCATEL_UpdateField(s, Alcatel_time, ToDo->Location, 11, &(ToDo->Entries[i].Date))) != ERR_NONE) return error;
3625 UpdatedFields[11] = true; 3628 UpdatedFields[11] = true;
3626 break; 3629 break;
@@ -3628,3 +3631,3 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3628 if ((error = ALCATEL_UpdateField(s, Alcatel_string, ToDo->Location, 4, ToDo->Entries[i].Text)) != ERR_NONE) return error; 3631 if ((error = ALCATEL_UpdateField(s, Alcatel_string, ToDo->Location, 4, ToDo->Entries[i].Text)) != ERR_NONE) return error;
3629 UpdatedFields[4] = true; 3632 UpdatedFields[4] = true;
3630 break; 3633 break;
@@ -3632,3 +3635,3 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3632 if ((error = ALCATEL_UpdateField(s, Alcatel_bool, ToDo->Location, 5, &(ToDo->Entries[i].Number))) != ERR_NONE) return error; 3635 if ((error = ALCATEL_UpdateField(s, Alcatel_bool, ToDo->Location, 5, &(ToDo->Entries[i].Number))) != ERR_NONE) return error;
3633 UpdatedFields[5] = true; 3636 UpdatedFields[5] = true;
3634 break; 3637 break;
@@ -3636,3 +3639,3 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3636 if ((error = ALCATEL_UpdateField(s, Alcatel_byte, ToDo->Location, 6, &(ToDo->Entries[i].Number))) != ERR_NONE) return error; 3639 if ((error = ALCATEL_UpdateField(s, Alcatel_byte, ToDo->Location, 6, &(ToDo->Entries[i].Number))) != ERR_NONE) return error;
3637 UpdatedFields[6] = true; 3640 UpdatedFields[6] = true;
3638 break; 3641 break;
@@ -3640,3 +3643,3 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3640 if ((error = ALCATEL_UpdateField(s, Alcatel_int, ToDo->Location, 8, &(ToDo->Entries[i].Number))) != ERR_NONE) return error; 3643 if ((error = ALCATEL_UpdateField(s, Alcatel_int, ToDo->Location, 8, &(ToDo->Entries[i].Number))) != ERR_NONE) return error;
3641 UpdatedFields[8] = true; 3644 UpdatedFields[8] = true;
3642 contact_set = true; 3645 contact_set = true;
@@ -3645,3 +3648,3 @@ static GSM_Error ALCATEL_SetToDo (GSM_StateMachine *s, GSM_ToDoEntry *ToDo)
3645 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, ToDo->Location, 9, ToDo->Entries[i].Text)) != ERR_NONE) return error; 3648 if ((error = ALCATEL_UpdateField(s, Alcatel_phone, ToDo->Location, 9, ToDo->Entries[i].Text)) != ERR_NONE) return error;
3646 UpdatedFields[9] = true; 3649 UpdatedFields[9] = true;
3647 phone_set = true; 3650 phone_set = true;
@@ -3824,2 +3827,10 @@ static GSM_Error ALCATEL_SetIncomingSMS (GSM_StateMachine *s, bool enable)
3824 3827
3828static GSM_Error ALCATEL_SetFastSMSSending(GSM_StateMachine *s, bool enable)
3829{
3830 GSM_Error error;
3831
3832 if ((error = ALCATEL_SetATMode(s))!= ERR_NONE) return error;
3833 return ATGEN_SetFastSMSSending(s, enable);
3834}
3835
3825static GSM_Reply_Function ALCATELReplyFunctions[] = { 3836static GSM_Reply_Function ALCATELReplyFunctions[] = {
@@ -3915,2 +3926,3 @@ GSM_Phone_Functions ALCATELPhone = {
3915 ALCATEL_SendSavedSMS, 3926 ALCATEL_SendSavedSMS,
3927 ALCATEL_SetFastSMSSending,
3916 ALCATEL_SetIncomingSMS, 3928 ALCATEL_SetIncomingSMS,
@@ -3969,3 +3981,3 @@ GSM_Phone_Functions ALCATELPhone = {
3969 NOTSUPPORTED, /* SetCalendarSettings*/ 3981 NOTSUPPORTED, /* SetCalendarSettings*/
3970 NOTSUPPORTED, /* GetNote */ 3982 NOTSUPPORTED, /* GetNextNote */
3971 NOTSUPPORTED, /* GetProfile */ 3983 NOTSUPPORTED, /* GetProfile */