summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-06 14:34:26 (UTC)
committer zautrix <zautrix>2004-10-06 14:34:26 (UTC)
commitef71411c2f248d1dc908aa2f119c9b281e0e8bb9 (patch) (side-by-side diff)
tree4c0a66c56d9fb7cf4839dbef4126d6be705a84ad
parent3e949ed97c7a65eeaddecb1048872cd8595b3caf (diff)
downloadkdepimpi-ef71411c2f248d1dc908aa2f119c9b281e0e8bb9.zip
kdepimpi-ef71411c2f248d1dc908aa2f119c9b281e0e8bb9.tar.gz
kdepimpi-ef71411c2f248d1dc908aa2f119c9b281e0e8bb9.tar.bz2
gammu fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--gammu/emb/gammu/gammu.c4
-rw-r--r--gammu/gammu.tar.bz2bin612042 -> 0 bytes
2 files changed, 2 insertions, 2 deletions
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c
index f49ae36..c436b90 100644
--- a/gammu/emb/gammu/gammu.c
+++ b/gammu/emb/gammu/gammu.c
@@ -4586,385 +4586,385 @@ static void Backup(int argc, char *argv[])
*Backup.FMStation[used]=FMStation;
used++;
}
i++;
FMStation.Location = i;
printmsgerr("*");
}
printmsgerr("\n");
}
DoBackup = false;
if (Info.GPRSPoint) {
printmsg("Checking GPRS access points\n");
GPRSPoint.Location = 1;
error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint);
if (error == ERR_NONE || error == ERR_EMPTY) {
if (answer_yes(" Backup GPRS access points")) DoBackup = true;
}
}
if (DoBackup) {
used = 0;
i = 1;
printmsgerr(" Reading: ");
while (error == ERR_NONE || error == ERR_EMPTY) {
error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint);
if (error == ERR_NONE) {
if (used < GSM_BACKUP_MAX_GPRSPOINT) {
Backup.GPRSPoint[used] = malloc(sizeof(GSM_GPRSAccessPoint));
if (Backup.GPRSPoint[used] == NULL) Print_Error(ERR_MOREMEMORY);
Backup.GPRSPoint[used + 1] = NULL;
} else {
printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_GPRSPOINT");
GSM_Terminate();
exit(-1);
}
*Backup.GPRSPoint[used]=GPRSPoint;
used++;
}
i++;
GPRSPoint.Location = i;
printmsgerr("*");
}
printmsgerr("\n");
}
GSM_Terminate();
GSM_SaveBackupFile(argv[2],&Backup, Info.UseUnicode);
GSM_FreeBackup(&Backup);
}
static void Restore(int argc, char *argv[])
{
GSM_Backup Backup;
GSM_FMStation FMStation;
GSM_DateTime date_time;
GSM_CalendarEntry Calendar;
GSM_Bitmap Bitmap;
GSM_Ringtone Ringtone;
GSM_MemoryEntry Pbk;
GSM_MemoryStatus MemStatus;
GSM_ToDoEntry ToDo;
GSM_ToDoStatus ToDoStatus;
GSM_Profile Profile;
GSM_MultiWAPSettings Settings;
GSM_GPRSAccessPoint GPRSPoint;
GSM_WAPBookmark Bookmark;
int i, used, max = 0;
bool Past = true;
bool Found, DoRestore;
error=GSM_ReadBackupFile(argv[2],&Backup);
if (error!=ERR_NOTIMPLEMENTED) {
Print_Error(error);
} else {
printmsgerr("WARNING: Some data not read from file. It can be damaged or restoring some settings from this file format not implemented (maybe higher Gammu required ?)\n");
}
signal(SIGINT, interrupt);
printmsgerr("Press Ctrl+C to break...\n");
if (Backup.DateTimeAvailable) printmsgerr("Time of backup : %s\n",OSDateTime(Backup.DateTime,false));
if (Backup.Model[0]!=0) printmsgerr("Phone : %s\n",Backup.Model);
if (Backup.IMEI[0]!=0) printmsgerr("IMEI : %s\n",Backup.IMEI);
if (Backup.Creator[0]!=0) printmsgerr("File created by : %s\n",Backup.Creator);
if (Backup.MD5Calculated[0]!=0) {
dbgprintf("\"%s\"\n",Backup.MD5Original);
dbgprintf("\"%s\"\n",Backup.MD5Calculated);
if (strcmp(Backup.MD5Original,Backup.MD5Calculated)) {
if (!answer_yes("Checksum in backup file do not match. Continue")) return;
}
}
GSM_Init(true);
DoRestore = false;
if (Backup.PhonePhonebook[0] != NULL) {
MemStatus.MemoryType = MEM_ME;
error=Phone->GetMemoryStatus(&s, &MemStatus);
if (error==ERR_NONE) {
max = 0;
while (Backup.PhonePhonebook[max]!=NULL) max++;
printmsgerr("%i entries in backup file\n",max);
if (answer_yes("Restore phone phonebook")) DoRestore = true;
}
}
if (DoRestore) {
used = 0;
for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) {
Pbk.MemoryType = MEM_ME;
Pbk.Location = i + 1;
Pbk.EntriesNum = 0;
if (used<max) {
if (Backup.PhonePhonebook[used]->Location == Pbk.Location) {
Pbk = *Backup.PhonePhonebook[used];
used++;
dbgprintf("Location %i\n",Pbk.Location);
if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk);
}
}
if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree));
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.SIMPhonebook[0] != NULL) {
MemStatus.MemoryType = MEM_SM;
error=Phone->GetMemoryStatus(&s, &MemStatus);
if (error==ERR_NONE) {
max = 0;
while (Backup.SIMPhonebook[max]!=NULL) max++;
printmsgerr("%i entries in backup file\n",max);
if (answer_yes("Restore SIM phonebook")) DoRestore = true;
}
}
if (DoRestore) {
used = 0;
for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) {
Pbk.MemoryType = MEM_SM;
Pbk.Location = i + 1;
Pbk.EntriesNum = 0;
if (used<max) {
if (Backup.SIMPhonebook[used]->Location == Pbk.Location) {
Pbk = *Backup.SIMPhonebook[used];
used++;
dbgprintf("Location %i\n",Pbk.Location);
if (Pbk.EntriesNum != 0) error=Phone->SetMemory(&s, &Pbk);
}
}
if (Pbk.EntriesNum == 0) error=Phone->DeleteMemory(&s, &Pbk);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree));
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.CallerLogos[0] != NULL) {
Bitmap.Type = GSM_CallerGroupLogo;
Bitmap.Location = 1;
error=Phone->GetBitmap(&s,&Bitmap);
if (error == ERR_NONE) {
if (answer_yes("Restore caller groups and logos")) DoRestore = true;
}
}
if (DoRestore) {
max = 0;
while (Backup.CallerLogos[max]!=NULL) max++;
for (i=0;i<max;i++) {
error=Phone->SetBitmap(&s,Backup.CallerLogos[i]);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) {
- if (answer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")) {
+ if ( true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) {
GSM_GetCurrentDateTime(&date_time);
error=Phone->SetDateTime(&s, &date_time);
Print_Error(error);
}
}
DoRestore = false;
if (Backup.Calendar[0] != NULL) {
/* N6110 doesn't support getting calendar status */
error = Phone->GetNextCalendar(&s,&Calendar,true);
if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) {
max = 0;
while (Backup.Calendar[max] != NULL) max++;
printmsgerr("%i entries in backup file\n",max);
// LR
//if (answer_yes("Restore calendar notes")) {
//Past = answer_yes("Restore notes from the past");
DoRestore = true;
//}
}
}
if (DoRestore) {
printmsgerr("Deleting old notes: ");
error = Phone->DeleteAllCalendar(&s);
if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
while (1) {
error = Phone->GetNextCalendar(&s,&Calendar,true);
if (error != ERR_NONE) break;
error = Phone->DeleteCalendar(&s,&Calendar);
Print_Error(error);
printmsgerr("*");
}
printmsgerr("\n");
} else {
printmsgerr("Done\n");
Print_Error(error);
}
for (i=0;i<max;i++) {
if (!Past && IsCalendarNoteFromThePast(Backup.Calendar[i])) continue;
Calendar = *Backup.Calendar[i];
error=Phone->AddCalendar(&s,&Calendar);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.ToDo[0] != NULL) {
error = Phone->GetToDoStatus(&s,&ToDoStatus);
if (error == ERR_NONE) {
max = 0;
while (Backup.ToDo[max]!=NULL) max++;
printmsgerr("%i entries in backup file\n",max);
//LR if (answer_yes("Restore ToDo"))
DoRestore = true;
}
}
if (DoRestore) {
ToDo = *Backup.ToDo[0];
error = Phone->SetToDo(&s,&ToDo);
}
if (DoRestore && (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED)) {
printmsgerr("Deleting old ToDo: ");
error=Phone->DeleteAllToDo(&s);
if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
while (1) {
error = Phone->GetNextToDo(&s,&ToDo,true);
if (error != ERR_NONE) break;
error = Phone->DeleteToDo(&s,&ToDo);
Print_Error(error);
printmsgerr("*");
}
printmsgerr("\n");
} else {
printmsgerr("Done\n");
Print_Error(error);
}
for (i=0;i<max;i++) {
ToDo = *Backup.ToDo[i];
ToDo.Location = 0;
error=Phone->AddToDo(&s,&ToDo);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
} else if (DoRestore) {
/* At first delete entries, that were deleted */
used = 0;
error = Phone->GetNextToDo(&s,&ToDo,true);
while (error == ERR_NONE) {
used++;
Found = false;
for (i=0;i<max;i++) {
if (Backup.ToDo[i]->Location == ToDo.Location) {
Found = true;
break;
}
}
if (!Found) {
error=Phone->DeleteToDo(&s,&ToDo);
Print_Error(error);
}
error = Phone->GetNextToDo(&s,&ToDo,false);
printmsgerr("%cCleaning: %i percent",13,used*100/ToDoStatus.Used);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
/* Now write modified/new entries */
for (i=0;i<max;i++) {
ToDo = *Backup.ToDo[i];
error = Phone->SetToDo(&s,&ToDo);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
if (Backup.SMSC[0] != NULL && answer_yes("Restore SMSC profiles")) {
max = 0;
while (Backup.SMSC[max]!=NULL) max++;
for (i=0;i<max;i++) {
error=Phone->SetSMSC(&s,Backup.SMSC[i]);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
if (Backup.StartupLogo != NULL && answer_yes("Restore startup logo/text")) {
error=Phone->SetBitmap(&s,Backup.StartupLogo);
Print_Error(error);
}
if (Backup.OperatorLogo != NULL && answer_yes("Restore operator logo")) {
error=Phone->SetBitmap(&s,Backup.OperatorLogo);
Print_Error(error);
}
DoRestore = false;
if (Backup.WAPBookmark[0] != NULL) {
Bookmark.Location = 1;
error = Phone->GetWAPBookmark(&s,&Bookmark);
if (error == ERR_NONE || error == ERR_INVALIDLOCATION) {
if (answer_yes("Restore WAP bookmarks")) DoRestore = true;
}
}
if (DoRestore) {
printmsgerr("Deleting old bookmarks: ");
/* One thing to explain: DCT4 phones seems to have bug here.
* When delete for example first bookmark, phone change
* numeration for getting frame, not for deleting. So, we try to
* get 1'st bookmark. Inside frame is "correct" location. We use
* it later
*/
while (error==ERR_NONE) {
error = Phone->DeleteWAPBookmark(&s,&Bookmark);
Bookmark.Location = 1;
error = Phone->GetWAPBookmark(&s,&Bookmark);
printmsgerr("*");
}
printmsgerr("\n");
max = 0;
while (Backup.WAPBookmark[max]!=NULL) max++;
for (i=0;i<max;i++) {
Bookmark = *Backup.WAPBookmark[i];
Bookmark.Location = 0;
error=Phone->SetWAPBookmark(&s,&Bookmark);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
@@ -5017,385 +5017,385 @@ static void Restore(int argc, char *argv[])
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.Ringtone[0] != NULL) {
Ringtone.Location = 1;
Ringtone.Format = 0;
error = Phone->GetRingtone(&s,&Ringtone,false);
if (error == ERR_NONE || error ==ERR_EMPTY) {
if (Phone->DeleteUserRingtones != NOTSUPPORTED) {
if (answer_yes("Delete all user ringtones")) DoRestore = true;
}
}
}
if (DoRestore) {
printmsgerr("Deleting: ");
error=Phone->DeleteUserRingtones(&s);
Print_Error(error);
printmsgerr("Done\n");
DoRestore = false;
if (answer_yes("Restore user ringtones")) DoRestore = true;
}
if (DoRestore) {
max = 0;
while (Backup.Ringtone[max]!=NULL) max++;
for (i=0;i<max;i++) {
error=GSM_RingtoneConvert(&Ringtone, Backup.Ringtone[i], Ringtone.Format);
Print_Error(error);
error=Phone->SetRingtone(&s,&Ringtone,&i);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.Profiles[0] != NULL) {
Profile.Location = 1;
error = Phone->GetProfile(&s,&Profile);
if (error == ERR_NONE) {
if (answer_yes("Restore profiles")) DoRestore = true;
}
}
if (DoRestore) {
Profile.Location= 0;
max = 0;
while (Backup.Profiles[max]!=NULL) max++;
for (i=0;i<max;i++) {
Profile = *Backup.Profiles[i];
error=Phone->SetProfile(&s,&Profile);
Print_Error(error);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.FMStation[0] != NULL) {
FMStation.Location = 1;
error = Phone->GetFMStation(&s,&FMStation);
if (error == ERR_NONE || error == ERR_EMPTY) {
if (answer_yes("Restore FM stations")) DoRestore = true;
}
}
if (DoRestore) {
printmsgerr("Deleting old FM stations: ");
error=Phone->ClearFMStations(&s);
Print_Error(error);
printmsgerr("Done\n");
max = 0;
while (Backup.FMStation[max]!=NULL) max++;
for (i=0;i<max;i++) {
FMStation = *Backup.FMStation[i];
error=Phone->SetFMStation(&s,&FMStation);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
DoRestore = false;
if (Backup.GPRSPoint[0] != NULL) {
GPRSPoint.Location = 1;
error = Phone->GetGPRSAccessPoint(&s,&GPRSPoint);
if (error == ERR_NONE || error == ERR_EMPTY) {
if (answer_yes("Restore GPRS Points")) DoRestore = true;
}
}
if (DoRestore) {
max = 0;
while (Backup.GPRSPoint[max]!=NULL) max++;
for (i=0;i<max;i++) {
error=Phone->SetGPRSAccessPoint(&s,Backup.GPRSPoint[i]);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
GSM_Terminate();
}
static void AddNew(int argc, char *argv[])
{
GSM_Backup Backup;
GSM_DateTime date_time;
GSM_MemoryEntry Pbk;
GSM_MemoryStatus MemStatus;
GSM_ToDoEntry ToDo;
GSM_ToDoStatus ToDoStatus;
GSM_CalendarEntry Calendar;
GSM_WAPBookmark Bookmark;
int i, max, j;
error=GSM_ReadBackupFile(argv[2],&Backup);
if (error!=ERR_NOTIMPLEMENTED) Print_Error(error);
signal(SIGINT, interrupt);
printmsgerr("Press Ctrl+C to break...\n");
if (Backup.DateTimeAvailable) printmsgerr("Time of backup : %s\n",OSDateTime(Backup.DateTime,false));
if (Backup.Model[0]!=0) printmsgerr("Phone : %s\n",Backup.Model);
if (Backup.IMEI[0]!=0) printmsgerr("IMEI : %s\n",Backup.IMEI);
GSM_Init(true);
if (Backup.PhonePhonebook[0] != NULL) {
MemStatus.MemoryType = MEM_ME;
error=Phone->GetMemoryStatus(&s, &MemStatus);
if (error==ERR_NONE) {
max = 0;
while (Backup.PhonePhonebook[max]!=NULL) max++;
printmsgerr("%i entries in backup file\n",max);
if (MemStatus.MemoryFree < max) {
printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree);
} else if (answer_yes("Add phone phonebook entries")) {
for (i=0;i<max;i++) {
Pbk = *Backup.PhonePhonebook[i];
Pbk.MemoryType = MEM_ME;
error=Phone->AddMemory(&s, &Pbk);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
}
}
if (Backup.SIMPhonebook[0] != NULL) {
MemStatus.MemoryType = MEM_SM;
error=Phone->GetMemoryStatus(&s, &MemStatus);
if (error==ERR_NONE) {
max = 0;
while (Backup.SIMPhonebook[max]!=NULL) max++;
printmsgerr("%i entries in backup file\n",max);
if (MemStatus.MemoryFree < max) {
printmsgerr("Memory has only %i free locations.Exiting\n",MemStatus.MemoryFree);
} else if (answer_yes("Add SIM phonebook entries")) {
j = 1;
for (i=0;i<max;i++) {
Pbk = *Backup.SIMPhonebook[i];
Pbk.MemoryType = MEM_SM;
error=Phone->AddMemory(&s, &Pbk);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
}
}
if (!mystrncasecmp(s.CurrentConfig->SyncTime,"yes",0)) {
- if (answer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")) {
+ if (true /*LRanswer_yes("Do you want to set date/time in phone (NOTE: in some phones it's required to correctly restore calendar notes and other items)")*/) {
GSM_GetCurrentDateTime(&date_time);
error=Phone->SetDateTime(&s, &date_time);
Print_Error(error);
}
}
if (Backup.Calendar[0] != NULL) {
error = Phone->GetNextCalendar(&s,&Calendar,true);
if (error == ERR_NONE || error == ERR_INVALIDLOCATION || error == ERR_EMPTY) {
if (answer_yes("Add calendar notes")) {
max = 0;
while (Backup.Calendar[max]!=NULL) max++;
for (i=0;i<max;i++) {
Calendar = *Backup.Calendar[i];
error=Phone->AddCalendar(&s,&Calendar);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
}
}
if (Backup.ToDo[0] != NULL) {
ToDo.Location = 1;
error=Phone->GetToDoStatus(&s,&ToDoStatus);
if (error == ERR_NONE) {
if (answer_yes("Add ToDo")) {
max = 0;
while (Backup.ToDo[max]!=NULL) max++;
for (i=0;i<max;i++) {
ToDo = *Backup.ToDo[i];
error = Phone->AddToDo(&s,&ToDo);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
}
}
if (Backup.WAPBookmark[0] != NULL) {
Bookmark.Location = 1;
error = Phone->GetWAPBookmark(&s,&Bookmark);
if (error == ERR_NONE || error == ERR_INVALIDLOCATION) {
if (answer_yes("Add WAP bookmarks")) {
max = 0;
while (Backup.WAPBookmark[max]!=NULL) max++;
for (i=0;i<max;i++) {
Bookmark = *Backup.WAPBookmark[i];
Bookmark.Location = 0;
error=Phone->SetWAPBookmark(&s,&Bookmark);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/max);
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
}
}
}
GSM_Terminate();
}
#endif
static void ClearAll(int argc, char *argv[])
{
GSM_MemoryStatus MemStatus;
GSM_ToDoStatus ToDoStatus;
GSM_CalendarEntry Calendar;
GSM_ToDoEntry ToDo;
GSM_WAPBookmark Bookmark;
GSM_FMStation Station;
GSM_MemoryEntry Pbk;
bool DoClear;
GSM_Init(true);
DoClear = false;
MemStatus.MemoryType = MEM_ME;
error=Phone->GetMemoryStatus(&s, &MemStatus);
if (error==ERR_NONE && MemStatus.MemoryUsed !=0) {
if (answer_yes("Delete phone phonebook")) DoClear = true;
}
if (DoClear) {
error = Phone->DeleteAllMemory(&s,MEM_ME);
if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) {
Pbk.MemoryType = MEM_ME;
Pbk.Location = i + 1;
Pbk.EntriesNum = 0;
error=Phone->DeleteMemory(&s, &Pbk);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree));
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
} else {
printmsgerr("Done\n");
Print_Error(error);
}
}
DoClear = false;
MemStatus.MemoryType = MEM_SM;
error=Phone->GetMemoryStatus(&s, &MemStatus);
if (error==ERR_NONE && MemStatus.MemoryUsed !=0) {
if (answer_yes("Delete SIM phonebook")) DoClear = true;
}
if (DoClear) {
error = Phone->DeleteAllMemory(&s,MEM_SM);
if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
for (i=0;i<MemStatus.MemoryUsed+MemStatus.MemoryFree;i++) {
Pbk.MemoryType = MEM_SM;
Pbk.Location = i + 1;
Pbk.EntriesNum = 0;
error=Phone->DeleteMemory(&s, &Pbk);
Print_Error(error);
printmsgerr("%cWriting: %i percent",13,(i+1)*100/(MemStatus.MemoryUsed+MemStatus.MemoryFree));
if (gshutdown) {
GSM_Terminate();
exit(0);
}
}
printmsgerr("\n");
} else {
printmsgerr("Done\n");
Print_Error(error);
}
}
DoClear = false;
error = Phone->GetNextCalendar(&s,&Calendar,true);
if (error == ERR_NONE) {
if (answer_yes("Delete calendar notes")) DoClear = true;
}
if (DoClear) {
printmsgerr("Deleting: ");
error=Phone->DeleteAllCalendar(&s);
if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
while (1) {
error = Phone->GetNextCalendar(&s,&Calendar,true);
if (error != ERR_NONE) break;
error = Phone->DeleteCalendar(&s,&Calendar);
Print_Error(error);
printmsgerr("*");
}
printmsgerr("\n");
} else {
printmsgerr("Done\n");
Print_Error(error);
}
}
DoClear = false;
error = Phone->GetToDoStatus(&s,&ToDoStatus);
if (error == ERR_NONE && ToDoStatus.Used != 0) {
if (answer_yes("Delete ToDo")) DoClear = true;
}
if (DoClear) {
printmsgerr("Deleting: ");
error=Phone->DeleteAllToDo(&s);
if (error == ERR_NOTSUPPORTED || error == ERR_NOTIMPLEMENTED) {
while (1) {
error = Phone->GetNextToDo(&s,&ToDo,true);
if (error != ERR_NONE) break;
error = Phone->DeleteToDo(&s,&ToDo);
Print_Error(error);
printmsgerr("*");
}
printmsgerr("\n");
} else {
printmsgerr("Done\n");
Print_Error(error);
}
}
Bookmark.Location = 1;
error = Phone->GetWAPBookmark(&s,&Bookmark);
if (error == ERR_NONE || error == ERR_INVALIDLOCATION) {
diff --git a/gammu/gammu.tar.bz2 b/gammu/gammu.tar.bz2
deleted file mode 100644
index 7c921a7..0000000
--- a/gammu/gammu.tar.bz2
+++ b/dev/null
Binary files differ