6 #ifdef GSM_ENABLE_NOKIA6510 11 #include "../../../../misc/coding/coding.h" 12 #include "../../../../gsmcomon.h" 13 #include "../../../../service/gsmlogo.h" 14 #include "../../nfunc.h" 15 #include "../../nfuncold.h" 16 #include "../../../pfunc.h" 17 #include "../dct4func.h" 19 #include "../../../../../helper/string.h" 38 smprintf(s,
"Copying %i to %i\n", i - move, i);
43 smprintf(s,
"Copying %i to %i\n", i, i + move);
65 newsize = requested + 10;
77 static int N6510_FindFileCheckSum12(
GSM_StateMachine *s,
unsigned char *ptr,
int len)
84 accx = (accx & 0xffff00ff) | (acc & 0xff00);
85 acc = (acc & 0xffff00ff) | (*ptr++ << 8);
86 for (i = 0; i < 8; i++) {
88 if (acc & 0x10000) acc ^= 0x1021;
89 if (accx & 0x80000000) acc ^= 0x1021;
93 smprintf(s,
"Checksum from Gammu is %04X\n",(acc & 0xffff));
94 return (acc & 0xffff);
107 smprintf(s,
"Length of file part: %i\n",
108 msg->
Buffer[6]*256*256*256+
130 unsigned char GetCRC[] = {
136 smprintf(s,
"Getting CRC for file in filesystem\n");
145 unsigned char buffer[500];
150 smprintf(s,
"File or folder details received\n");
163 smprintf(s,
"%02x %02x %02x %02x %02x %02x %02x %02x %02x\n",
195 else if (msg->
Buffer[i]==0x02 && msg->
Buffer[i+2]==0x02)
197 else if (msg->
Buffer[i]==0x02 && msg->
Buffer[i+2]==0x07)
199 else if (msg->
Buffer[i]==0x02 && msg->
Buffer[i+2]==0x03)
201 else if (msg->
Buffer[i]==0x02 && msg->
Buffer[i+2]==0x05)
203 else if (msg->
Buffer[i]==0x02 && msg->
Buffer[i+2]==0x09)
205 else if (msg->
Buffer[i]==0x04 && msg->
Buffer[i+2]==0x01)
207 else if (msg->
Buffer[i]==0x04 && msg->
Buffer[i+2]==0x02)
209 else if (msg->
Buffer[i]==0x08 && msg->
Buffer[i+2]==0x05)
211 else if (msg->
Buffer[i]==0x10 && msg->
Buffer[i+2]==0x01)
213 else if (msg->
Buffer[i]==0x00 && msg->
Buffer[i+2]==0x01)
218 smprintf(s,
"File or folder used bytes received\n");
230 if (error !=
ERR_NONE)
return error;
232 error = N6510_ShiftFileCache(s, newsize);
233 if (error !=
ERR_NONE)
return error;
235 for (i = 0; i < newsize; i++) {
236 sprintf(buffer,
"%i",msg->
Buffer[13+i*4-1]*256 + msg->
Buffer[13+i*4]);
246 smprintf(s,
"File system is not supported\n");
255 unsigned char req[10] = {
268 smprintf(s,
"Getting info for file in filesystem\n");
270 if (error !=
ERR_NONE)
return error;
275 smprintf(s,
"Getting subfolders for filesystem\n");
277 if (error !=
ERR_NONE)
return error;
283 smprintf(s,
"Getting used memory for file in filesystem\n");
294 unsigned char buffer[5];
297 error = N6510_AllocFileCache(s, 1);
298 if (error !=
ERR_NONE)
return error;
302 sprintf(buffer,
"%i",0x01);
313 error = N6510_ShiftFileCache(s, -1);
314 if (error !=
ERR_NONE)
return error;
316 error = N6510_GetFileFolderInfo1(s, File,
TRUE);
327 smprintf(s,
"File or folder total bytes received\n");
332 smprintf(s,
"File or folder free bytes received\n");
334 msg->
Buffer[6]*256*256*256+
341 smprintf(s,
"File or folder used bytes received\n");
343 msg->
Buffer[6]*256*256*256+
355 unsigned char req[10] = {
372 smprintf(s,
"Getting used/total memory in filesystem\n");
374 if (error !=
ERR_NONE)
return error;
378 smprintf(s,
"Getting free memory in filesystem\n");
387 unsigned char req[] = {
390 0x00, 0x00, 0x00, 0x00,
394 if (File->
Used == 0x00) {
395 error = N6510_GetFileFolderInfo1(s, File,
FALSE);
396 if (error !=
ERR_NONE)
return error;
400 (*Size) = File->
Used;
407 req[10] = old / (256*256*256);
408 req[11] = old / (256*256);
413 smprintf(s,
"Getting file part from filesystem\n");
415 if (error !=
ERR_NONE)
return error;
416 if (File->
Used - old != (0x03 * 256 + 0xE8)) {
418 if (error !=
ERR_NONE)
return error;
431 unsigned char SetAttr[] = {
437 if (!enable) SetAttr[4] = 0x06;
441 smprintf(s,
"Setting readonly attribute\n");
450 memset(&file2, 0,
sizeof(file2));
453 error = N6510_GetFileFolderInfo1(s, &file2,
FALSE);
454 if (error !=
ERR_NONE)
return error;
474 int FilesLocationsUsed,FilesLocationsUsed2,i;
486 error = N6510_AllocFileCache(s, 1);
502 if (NewFiles == NULL) {
522 for (i = 0; i < FilesLocationsUsed2; i++) {
524 error = N6510_GetFileFolderInfo1(s, &NewFiles[i],
FALSE);
548 unsigned char buffer[5];
576 0x00, 0x00, 0x00, 0xE8};
577 unsigned char Add[15000] = {
582 unsigned char end[30] = {
585 0x00, 0x00, 0x00, 0x00};
587 memset(&File2, 0,
sizeof(File2));
592 error = N6510_SearchForFileName1(s,File);
598 memset(Header+14, 0x00, 300);
600 Header[222] = File->
Used / (256*256*256);
601 Header[223] = File->
Used / (256*256);
602 Header[224] = File->
Used / 256;
603 Header[225] = File->
Used % 256;
625 default : Header[231]=0x01; Header[233]=0x05;
631 if (File->
Hidden) Header[241] = 0x01;
632 if (File->
System) Header[242] = 0x01;
633 smprintf(s,
"Adding file header\n");
635 if (error !=
ERR_NONE)
return error;
639 if (File->
Used - *Pos < 1000) j = File->
Used - *Pos;
644 memcpy(Add+14,File->
Buffer+(*Pos),j);
645 smprintf(s,
"Adding file part %ld %i\n", (
long)*Pos,j);
647 if (error !=
ERR_NONE)
return error;
654 smprintf(s,
"Frame for ending adding file\n");
656 if (error !=
ERR_NONE)
return error;
659 error = N6510_GetFileFolderInfo1(s, &File2,
FALSE);
660 if (error !=
ERR_NONE)
return error;
669 memset(Header+14, 0x00, 300);
677 Header[224] = File2.Used / 256;
678 Header[225] = File2.Used % 256;
702 default : Header[231]=0x01; Header[233]=0x05;
707 smprintf(s,
"Adding file header\n");
709 if (error !=
ERR_NONE)
return error;
715 if (error !=
ERR_NONE)
return error;
719 if (error !=
ERR_NONE)
return error;
734 if (msg->
Buffer[4] == 0x01) {
736 }
else if (msg->
Buffer[4] == 0x04) {
747 unsigned char Delete[40] = {
751 memset(&File, 0,
sizeof(File));
755 error = N6510_GetFileFolderInfo1(s, &File,
TRUE);
756 if (error !=
ERR_NONE)
return error;
765 error = N6510_SetReadOnly1(s, ID,
FALSE);
766 if (error !=
ERR_NONE)
return error;
777 return N6510_PrivDeleteFileFolder1(s,ID,
TRUE);
782 return N6510_PrivDeleteFileFolder1(s,ID,
FALSE);
787 unsigned char buffer[5];
801 0x00, 0x00, 0x00, 0xE8};
803 memset(&File2, 0,
sizeof(File2));
806 error = N6510_GetFileFolderInfo1(s, &File2,
FALSE);
807 if (error !=
ERR_NONE)
return error;
812 memset(Header+14, 0x00, 300);
822 if (error !=
ERR_NONE)
return error;
829 if (error !=
ERR_NONE)
return error;
843 error = N6510_GetFileFolderInfo1(s, File,
TRUE);
844 if (error !=
ERR_NONE)
return error;
853 error = N6510_GetFileFolderInfo1(s, File,
FALSE);
854 if (error !=
ERR_NONE)
return error;
856 error = N6510_ShiftFileCache(s, -1);
857 if (error !=
ERR_NONE)
return error;
869 smprintf(s,
"File opened and handle received\n");
875 msg->
Buffer[6]*256*256*256+
880 }
else if (msg->
Buffer[4] == 0x03) {
881 smprintf(s,
"You can't open already existing folder\n");
883 }
else if (msg->
Buffer[4] == 0x06) {
900 if (Create) req[4] = 0x11;
904 if (req[9] ==
'a' || req[9] ==
'A') req[9] =
'b';
905 if (req[9] ==
'd' || req[9] ==
'D') req[9] =
'a';
919 0x00, 0x00, 0x00, 0x00};
921 req[6] = (*Handle) / (256*256*256);
922 req[7] = (*Handle) / (256*256);
923 req[8] = (*Handle) / 256;
924 req[9] = (*Handle) % 256;
932 unsigned char req2[15000] = {
934 0x00, 0x00, 0x00, 0x00};
936 req2[6] = (*Handle) / (256*256*256);
937 req2[7] = (*Handle) / (256*256);
938 req2[8] = (*Handle) / 256;
939 req2[9] = (*Handle) % 256;
955 smprintf(s,
"Probably no MMC card\n");
968 smprintf(s,
"Probably no MMC card\n");
971 smprintf(s,
"unknown status code\n");
974 smprintf(s,
"File or folder details received\n");
976 if (msg->
Buffer[3] == 0x69) {
979 smprintf(s,
"Ignoring file without name!\n");
987 error = N6510_ShiftFileCache(s, 1);
988 if (error !=
ERR_NONE)
return error;
1006 if ((msg->
Buffer[29] & 0x10) == 0x10) {
1019 if ((msg->
Buffer[29] & 1) == 1) {
1024 if ((msg->
Buffer[29] & 2) == 2) {
1029 if ((msg->
Buffer[29] & 4) == 4) {
1034 if ((msg->
Buffer[29] & 0x40) == 0x40) {
1048 smprintf(s,
"File or folder details received - not available ?\n");
1053 smprintf(s,
"File or folder details received - empty\n");
1073 if (req[7] ==
'a' || req[7] ==
'A') req[7] =
'b';
1074 if (req[7] ==
'd' || req[7] ==
'D') req[7] =
'a';
1079 smprintf(s,
"Getting info for file in filesystem\n");
1095 if (req[7] ==
'a' || req[7] ==
'A') req[7] =
'b';
1096 if (req[7] ==
'd' || req[7] ==
'D') req[7] =
'a';
1121 smprintf(s,
"Connection broken or WELL KNOWN phone firmware problem (which makes, that not all files are reported)\n");
1136 error = N6510_AllocFileCache(s, 2);
1137 if (error !=
ERR_NONE)
return error;
1168 error = N6510_ShiftFileCache(s, -1);
1169 if (error !=
ERR_NONE)
return error;
1175 error = N6510_PrivGetFolderListing2(s, File);
1176 if (error !=
ERR_NONE)
return error;
1179 error = N6510_ShiftFileCache(s, -1);
1180 if (error !=
ERR_NONE)
return error;
1194 unsigned char req[] = {
1196 0x00, 0x00, 0x00, 0x01,
1197 0x00, 0x00, 0x00, 0x00,
1198 0x00, 0x00, 0x03, 0xE8,
1199 0x00, 0x00, 0x03, 0xE8};
1201 if (File->
Used == 0x00) {
1202 error = N6510_GetFileFolderInfo2(s, File);
1203 if (error !=
ERR_NONE)
return error;
1208 if (error !=
ERR_NONE)
return error;
1219 (*Size) = File->
Used;
1223 req[6] = (*Handle) / (256*256*256);
1224 req[7] = (*Handle) / (256*256);
1225 req[8] = (*Handle) / 256;
1226 req[9] = (*Handle) % 256;
1229 req[10] = old / (256*256*256);
1230 req[11] = old / (256*256);
1231 req[12] = old / 256;
1232 req[13] = old % 256;
1235 smprintf(s,
"Getting file part from filesystem\n");
1237 if (error !=
ERR_NONE)
return error;
1239 if (File->
Used - old != (0x03 * 256 + 0xE8)) {
1240 error = N6510_GetFileCRC2(s, Handle);
1241 if (error !=
ERR_NONE)
return error;
1243 error = N6510_CloseFile2(s, Handle);
1244 if (error !=
ERR_NONE)
return error;
1263 if (msg->
Buffer[4] == 0x00) {
1265 }
else if (msg->
Buffer[4] == 0x06) {
1280 memcpy(&File2,File,
sizeof(
GSM_File));
1282 error = N6510_GetFileFolderInfo2(s, File);
1283 if (error !=
ERR_NONE)
return error;
1294 if (File2.ReadOnly) Header2[9] += 1;
1295 if (File2.Hidden) Header2[9] += 2;
1296 if (File2.System) Header2[9] += 4;
1297 if (File2.Protected) Header2[9] += 0x40;
1299 if (Header2[11] ==
'a' || Header2[11] ==
'A') Header2[11] =
'b';
1300 if (Header2[11] ==
'd' || Header2[11] ==
'D') Header2[11] =
'a';
1305 if (error !=
ERR_NONE)
return error;
1307 error = N6510_GetFileFolderInfo2(s, File);
1308 if (error !=
ERR_NONE)
return error;
1311 if (File2.System != File->
System ||
1312 File2.ReadOnly != File->
ReadOnly ||
1313 File2.Hidden != File->
Hidden ) {
1327 unsigned char req[15000] = {
1329 0x00, 0x00, 0x00, 0x00,
1330 0x00, 0x00, 0x04, 0x00};
1341 error = N6510_GetFileFolderInfo2(s, File);
1352 if (error !=
ERR_NONE)
return error;
1355 req[6] = (*Handle) / (256*256*256);
1356 req[7] = (*Handle) / (256*256);
1357 req[8] = (*Handle) / 256;
1358 req[9] = (*Handle) % 256;
1361 if (File->
Used - *Pos < 2000) j = File->
Used - *Pos;
1362 req[10] = j / (256*256*256);
1363 req[11] = j / (256*256);
1366 memcpy(req+14,File->
Buffer+(*Pos),j);
1368 smprintf(s,
"Adding file part %ld %i\n",(
long)*Pos,j);
1370 if (error !=
ERR_NONE)
return error;
1374 error = N6510_CloseFile2(s, Handle);
1375 if (error !=
ERR_NONE)
return error;
1389 if (Header[15] ==
'a' || Header[15] ==
'A') Header[15] =
'b';
1390 if (Header[15] ==
'd' || Header[15] ==
'D') Header[15] =
'a';
1396 if (error !=
ERR_NONE)
return error;
1398 error = N6510_SetFileAttributes2(s,File);
1399 if (error !=
ERR_NONE)
return error;
1434 error = N6510_GetFileFolderInfo2(s, File);
1435 if (error !=
ERR_NONE)
return error;
1439 error = N6510_AllocFileCache(s, 1);
1440 if (error !=
ERR_NONE)
return error;
1444 error = N6510_PrivGetFolderListing2(s, File);
1445 if (error !=
ERR_NONE)
return error;
1449 error = N6510_ShiftFileCache(s, -1);
1450 if (error !=
ERR_NONE)
return error;
1457 error = N6510_ShiftFileCache(s, -1);
1458 if (error !=
ERR_NONE)
return error;
1468 if (msg->
Buffer[4] == 0x00) {
1470 }
else if (msg->
Buffer[4] == 0x03) {
1473 }
else if (msg->
Buffer[4] == 0x06) {
1495 error = N6510_SetFileAttributes2(s,&file);
1496 if (error !=
ERR_NONE)
return error;
1501 if (req[7] ==
'a' || req[7] ==
'A') req[7] =
'b';
1502 if (req[7] ==
'd' || req[7] ==
'D') req[7] =
'a';
1513 if (msg->
Buffer[4] == 0x00) {
1515 }
if (msg->
Buffer[4] == 0x04) {
1517 }
if (msg->
Buffer[4] == 0x06) {
1519 }
if (msg->
Buffer[4] == 0x0C) {
1544 if (req[Pos+1] ==
'a' || req[Pos+1] ==
'A') req[Pos+1] =
'b';
1545 if (req[Pos+1] ==
'd' || req[Pos+1] ==
'D') req[Pos+1] =
'a';
1550 req[4] = Len / 256 ;
1551 req[5] = Len % 256 ;
1560 if (msg->
Buffer[4] == 0x00) {
1562 }
if (msg->
Buffer[4] == 0x03) {
1564 }
if (msg->
Buffer[4] == 0x06) {
1566 }
if (msg->
Buffer[4] == 0x0C) {
1582 error = N6510_GetFolderListing2(s, &File2,
TRUE);
1595 if (req[7] ==
'a' || req[7] ==
'A') req[7] =
'b';
1596 if (req[7] ==
'd' || req[7] ==
'D') req[7] =
'a';
1621 memcpy(&File2,File,
sizeof(
GSM_File));
1623 error = N6510_GetFolderListing1(s,&File2,start);
1624 memcpy(File,&File2,
sizeof(
GSM_File));
1631 return N6510_GetFolderListing2(s,File,start);
1657 error = N6510_GetNextFileFolder1(s,File,start);
1669 if (File->
Level != 1)
return error;
1681 return N6510_GetNextFileFolder2(s,File,start);
1698 memcpy(&File2,File,
sizeof(
GSM_File));
1700 error = N6510_GetFilePart1(s,&File2, Handle, Size);
1702 memcpy(File,&File2,
sizeof(
GSM_File));
1707 return N6510_GetFilePart2(s,File, Handle, Size);
1728 memcpy(&File2,File,
sizeof(
GSM_File));
1730 error = N6510_AddFilePart1(s,&File2,Pos,Handle);
1731 memcpy(File,&File2,
sizeof(
GSM_File));
1738 return N6510_AddFilePart2(s,File,Pos,Handle);
1756 return N6510_DeleteFile1(s,ID+6);
1759 return N6510_DeleteFile2(s,ID);
1779 memcpy(&File2,File,
sizeof(
GSM_File));
1781 error = N6510_AddFolder1(s,&File2);
1782 memcpy(File,&File2,
sizeof(
GSM_File));
1789 return N6510_AddFolder2(s,File);
1806 return N6510_DeleteFolder1(s,ID+6);
1809 return N6510_DeleteFolder2(s,ID);
1827 return N6510_GetFileSystemStatus1(s,status);
1845 memcpy(&File2,File,
sizeof(
GSM_File));
1847 error = N6510_SetFileAttributes1(s,&File2);
1849 memcpy(File,&File2,
sizeof(
GSM_File));
1854 return N6510_SetFileAttributes2(s,File);
1865 unsigned char buffer[5];
1869 memset(&File2, 0,
sizeof(File2));
1878 error = N6510_GetFolderListing2(s, File,
TRUE);
1889 sprintf(buffer,
"%i",0x01);
1893 error = N6510_GetFileFolderInfo1(s, &File2,
FALSE);
1894 if (error !=
ERR_NONE)
return error;
1899 memcpy(File,&File2,
sizeof(
GSM_File));
1903 sprintf(buffer,
"c:\\%i",0x01);
1910 error = N6510_GetFolderListing2(s, File,
TRUE);
1920 memcpy(File,&File2,
sizeof(
GSM_File));
1924 sprintf(buffer,
"c:\\%i",0x01);
1939 memset(&Files, 0,
sizeof(Files));
1945 smprintf(s,
"Getting MMS folders\n");
1949 if (error !=
ERR_NONE)
return error;
1984 memset(&Files, 0,
sizeof(Files));
1990 smprintf(s,
"Getting MMS folders\n");
1994 if (error !=
ERR_NONE)
return error;
2046 memset(&Files, 0,
sizeof(Files));
2048 for (i=0;i<10;i++) {
2054 return N6510_PrivGet3220FilesystemMMSFolders(s,folders);
2058 return N6510_PrivGetFilesystemMMSFolders(s,folders);
2065 if (error !=
ERR_NONE)
return error;
2076 if (error !=
ERR_NONE)
return error;
2078 if (!Files.
Folder)
continue;
2097 if (error !=
ERR_NONE)
return error;
2099 if (!Files.
Folder)
continue;
2171 error = N6510_GetFilePart2(s, &file, &Handle, &Size);
2173 error = N6510_CloseFile2(s, &Handle);
2181 if (file.
Buffer[6] != 0x00) {
2207 smprintf(s,
"Getting SMS folders\n");
2211 if (error !=
ERR_NONE)
return error;
2258 smprintf(s,
"Folder[%d] = \"%s\", memory: %s, inbox: %d, outbox: %d\n",
2271 return N6510_PrivGetFilesystemSMSFolders(s, folders,
FALSE);
2282 *folderid = ifolderid + 0x01;
2288 smprintf(s,
"SMS folder %i & location %i -> 6510 folder %i & location %i\n",
2297 smprintf(s,
"6510 folder %i & location %i -> SMS folder %i & location %i\n",
2305 size_t parse_len, pos;
2315 if (FFF->
Used < 96) {
2316 smprintf(s,
"Too short message data!\n");
2331 if (error !=
ERR_NONE)
return error;
2335 switch (sms->
SMS[0].
PDU) {
2347 if (parse_len != FFF->
Buffer[7]) {
2348 smprintf(s,
"ERROR: Parsed PDU data have different length than header says!\n");
2358 pos = 176 + FFF->
Buffer[7];
2361 if (pos >= FFF->
Used) {
2366 if (FFF->
Buffer[pos] != 0x01) {
2367 smprintf(s,
"Unknown block in SMS data after PDU: 0x%02x\n", FFF->
Buffer[pos]);
2373 while (pos < FFF->Used) {
2375 if (pos + 1 >= FFF->
Used) {
2376 if (pos + 1 == FFF->
Used && FFF->
Buffer[pos] == 0x00) {
2377 smprintf(s,
"File padded with 0x00, assuming it is okay\n");
2380 smprintf(s,
"ERROR: Reach end of file before type of block!\n");
2383 if (FFF->
Buffer[pos] == 0x00) {
2384 smprintf(s,
"WARNING: 0x00 block, assuming rest is just junk!\n");
2387 if (pos + 2 == FFF->
Used && FFF->
Buffer[pos] == 0x01) {
2388 smprintf(s,
"WARNING: 0x01 block, assuming rest is just junk!\n");
2391 if (pos + 2 >= FFF->
Used) {
2392 smprintf(s,
"ERROR: Reach end of file before size of block!\n");
2395 switch (FFF->
Buffer[pos]) {
2397 if (FFF->
Buffer[pos + 2] <= 1)
break;
2399 smprintf(s,
"WARNING: Too long SMS number, ignoring!\n");
2405 if (FFF->
Buffer[pos + 2] <= 1)
break;
2407 smprintf(s,
"WARNING: Too long SMS name, ignoring!\n");
2415 if (FFF->
Buffer[pos + 2] <= 1)
break;
2417 smprintf(s,
"WARNING: Too long SMS number, ignoring!\n");
2426 smprintf(s,
"WARNING: Too many recipients, ignoring some!\n");
2437 if (FFF->
Buffer[pos + 2] != 1 ||
2438 (FFF->
Buffer[pos + 3] != 0x00 && FFF->
Buffer[pos + 3] != 0x01)) {
2448 if ((FFF->
Buffer[pos + 2] != 1 || FFF->
Buffer[pos + 3] != 1) &&
2449 (FFF->
Buffer[pos + 2] != 1 || FFF->
Buffer[pos + 3] != 0)) {
2454 if (FFF->
Buffer[pos + 2] != 1 || (FFF->
Buffer[pos + 3] != 0x00F && FFF->
Buffer[pos + 3] != 0x0e)) {
2467 if (FFF->
Buffer[pos + 2] != 1 || FFF->
Buffer[pos + 3] != 0x00) {
2479 if (FFF->
Buffer[pos + 2] != 4 ||
2480 FFF->
Buffer[pos + 3] != 0x00 ||
2481 FFF->
Buffer[pos + 4] != 0x00 ||
2482 FFF->
Buffer[pos + 5] != 0x00 ||
2483 FFF->
Buffer[pos + 6] != 0x00
2489 if (FFF->
Buffer[pos + 2] != 2 ||
2490 FFF->
Buffer[pos + 3] != 0x00 ||
2491 FFF->
Buffer[pos + 4] != 0x00
2501 smprintf(s,
"WARNING: Unknown block 0x%02x, see <https://wammu.eu/support/bugs/> how to report\n", FFF->
Buffer[pos]);
2509 pos += 3 + (FFF->
Buffer[pos + 1] << 8) + FFF->
Buffer[pos + 2];
2519 N26510_SetSMSLocation(s, &sms->
SMS[0], 0, location);
2532 unsigned char folderid;
2533 int location,Handle;
2550 N26510_GetSMSLocation(s, &sms->
SMS[0], &folderid, &location);
2583 error = N6510_CloseFile2(s, &Handle);
2584 if (error !=
ERR_NONE)
return error;
2588 if (FFF.
Buffer != NULL) {
2593 if (FFF.
Buffer[6] == 0x00 && FFF.
Buffer[7] != 0)
break;
2602 return N6510_DecodeFilesystemSMS(s, sms, &FFF, location);
char * DecodeUnicodeConsole(const unsigned char *src)
GSM_Error N6510_ReplyDeleteFileFolder1(GSM_Protocol_Message *msg, GSM_StateMachine *s)
void GSM_SetDefaultReceivedSMSData(GSM_SMSMessage *SMS)
GSM_Error N6510_ReplyGetFileFolderInfo1(GSM_Protocol_Message *msg, GSM_StateMachine *s)
unsigned char Name[2 *(GSM_MAX_FILENAME_LENGTH+1)]
GSM_Error N6510_ReplyGetFileCRC12(GSM_Protocol_Message *msg, GSM_StateMachine *s)
unsigned char ID_FullName[2 *(GSM_MAX_FILENAME_ID_LENGTH+1)]
char * DecodeUnicodeString(const unsigned char *src)
void DumpMessage(GSM_Debug_Info *d, const unsigned char *message, const size_t messagesize)
unsigned char Number[(GSM_MAX_NUMBER_LENGTH+1) *2]
void CopyUnicodeString(unsigned char *Dest, const unsigned char *Source)
GSM_Error N6510_SetFileAttributes(GSM_StateMachine *s, GSM_File *File)
GSM_Error N6510_AddFilePart(GSM_StateMachine *s, GSM_File *File, size_t *Pos, int *Handle)
GSM_Error N6510_ReplySetFileDate2(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_Error N6510_ReplyDeleteFolder2(GSM_Protocol_Message *msg, GSM_StateMachine *s)
#define GSM_PHONE_MAXSMSINFOLDER
GSM_Error N6510_ReplyGetFileSystemStatus1(GSM_Protocol_Message *msg, GSM_StateMachine *s)
#define N6110_FRAME_HEADER
#define GSM_MAX_NUMBER_LENGTH
GSM_OneMMSFolder Folder[GSM_MAX_MMS_FOLDERS]
GSM_Error N6510_ReplyGetFilePart12(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_Error N6510_ReplyAddFilePart1(GSM_Protocol_Message *msg, GSM_StateMachine *s)
void NOKIA_EncodeDateTime(GSM_StateMachine *s UNUSED, unsigned char *buffer, GSM_DateTime *datetime)
GSM_Error N6510_ReplyAddFileHeader1(GSM_Protocol_Message *msg, GSM_StateMachine *s)
gboolean mywstrncasecmp(unsigned const char *a, unsigned const char *b, int num)
GSM_Error GSM_DecodePDUFrame(GSM_Debug_Info *di, GSM_SMSMessage *SMS, const unsigned char *buffer, size_t length, size_t *final_pos, gboolean SMSC)
GSM_OneSMSFolder Folder[GSM_MAX_SMS_FOLDERS]
#define GSM_MemoryTypeToString(x)
GSM_Error N6510_ReplyAddFolder2(GSM_Protocol_Message *msg, GSM_StateMachine *s)
int GSM_ReadDevice(GSM_StateMachine *s, gboolean waitforreply)
GSM_Error N6510_ReplyGetFileFolderInfo2(GSM_Protocol_Message *msg, GSM_StateMachine *s)
size_t UnicodeLength(const unsigned char *str)
GSM_Error N6510_AddFolder(GSM_StateMachine *s, GSM_File *File)
GSM_Error N6510_ReplyOpenFile2(GSM_Protocol_Message *msg, GSM_StateMachine *s)
#define GSM_MAX_FILENAME_ID_LENGTH
unsigned char OtherNumbers[GSM_SMS_OTHER_NUMBERS][(GSM_MAX_NUMBER_LENGTH+1) *2]
GSM_Error(* WriteMessage)(GSM_StateMachine *s, unsigned const char *buffer, int length, int type)
GSM_FileSystemStatus * FileSystemStatus
GSM_SMSFolders LastSMSFolders
GSM_Error N6510_ReplyDeleteFile2(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_PhoneModel * ModelInfo
GSM_Error N6510_GetMMSFolders(GSM_StateMachine *s, GSM_MMSFolders *folders)
GSM_Error N6510_GetNextFileFolder(GSM_StateMachine *s, GSM_File *File, gboolean start)
char Name[(GSM_MAX_MMS_FOLDER_NAME_LEN+1) *2]
#define GSM_MAX_SMS_NAME_LENGTH
GSM_Error N6510_ReplyAddFolder1(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_Error N6510_GetNextMMSFileInfo(GSM_StateMachine *s, unsigned char *FileID, int *MMSFolder, gboolean start)
#define GSM_SMS_OTHER_NUMBERS
void EncodeUnicode(unsigned char *dest, const char *src, size_t len)
unsigned char Name[(GSM_MAX_SMS_NAME_LENGTH+1) *2]
GSM_Error N6510_GetFileSystemStatus(GSM_StateMachine *s, GSM_FileSystemStatus *status)
struct GSM_Phone_Data::@2 Priv
GSM_Error N6510_GetFolderListing(GSM_StateMachine *s, GSM_File *File, gboolean start)
GSM_Error N6510_DeleteFolder(GSM_StateMachine *s, unsigned char *ID)
GSM_Error N6510_GetFilesystemSMSFolders(GSM_StateMachine *s, GSM_SMSFolders *folders)
GSM_Error GSM_WaitFor(GSM_StateMachine *s, unsigned const char *buffer, size_t length, int type, int timeout, GSM_Phone_RequestID request)
GSM_Error N6510_GetNextFilesystemSMS(GSM_StateMachine *s, GSM_MultiSMSMessage *sms, gboolean start)
char MMSFoldersID2[10][80]
GSM_Error filesystem2error
GSM_Phone_RequestID RequestID
unsigned char Name[(GSM_MAX_SMS_FOLDER_NAME_LEN+1) *2]
GSM_Error N6510_GetFilePart(GSM_StateMachine *s, GSM_File *File, int *Handle, size_t *Size)
GSM_SMSMessage SMS[GSM_MAX_MULTI_SMS]
#define N7110_FRAME_HEADER
unsigned char Number[(GSM_MAX_NUMBER_LENGTH+1) *2]
gboolean GSM_IsPhoneFeatureAvailable(GSM_PhoneModel *model, GSM_Feature feature)
GSM_Error N6510_ReplySetAttrib2(GSM_Protocol_Message *msg, GSM_StateMachine *s)
GSM_Error N6510_DeleteFile(GSM_StateMachine *s, unsigned char *ID)
GSM_Protocol_Functions * Functions
void NOKIA_DecodeDateTime(GSM_StateMachine *s, unsigned char *buffer, GSM_DateTime *datetime, gboolean seconds, gboolean DayMonthReverse)
GSM_Error N6510_GetNextRootFolder(GSM_StateMachine *s, GSM_File *File)
int smprintf(GSM_StateMachine *s, const char *format,...)