summaryrefslogtreecommitdiffabout
path: root/gammu/emb/gammu/gammu.c
Unidiff
Diffstat (limited to 'gammu/emb/gammu/gammu.c') (more/less context) (show whitespace changes)
-rw-r--r--gammu/emb/gammu/gammu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gammu/emb/gammu/gammu.c b/gammu/emb/gammu/gammu.c
index c436b90..8db9afb 100644
--- a/gammu/emb/gammu/gammu.c
+++ b/gammu/emb/gammu/gammu.c
@@ -4006,97 +4006,97 @@ static void Backup(int argc, char *argv[])
4006 strcat(Backup.Creator+strlen(Backup.Creator),GetOS()); 4006 strcat(Backup.Creator+strlen(Backup.Creator),GetOS());
4007 } 4007 }
4008 if (strlen(GetCompiler()) != 0) { 4008 if (strlen(GetCompiler()) != 0) {
4009 strcat(Backup.Creator+strlen(Backup.Creator),", "); 4009 strcat(Backup.Creator+strlen(Backup.Creator),", ");
4010 strcat(Backup.Creator+strlen(Backup.Creator),GetCompiler()); 4010 strcat(Backup.Creator+strlen(Backup.Creator),GetCompiler());
4011 } 4011 }
4012 4012
4013 signal(SIGINT, interrupt); 4013 signal(SIGINT, interrupt);
4014 printmsgerr("Press Ctrl+C to break...\n"); 4014 printmsgerr("Press Ctrl+C to break...\n");
4015 4015
4016 GSM_Init(true); 4016 GSM_Init(true);
4017 4017
4018 if (Info.UseUnicode) { 4018 if (Info.UseUnicode) {
4019 Info.UseUnicode=answer_yes("Use Unicode subformat of backup file"); 4019 Info.UseUnicode=answer_yes("Use Unicode subformat of backup file");
4020 } 4020 }
4021 if (Info.DateTime) { 4021 if (Info.DateTime) {
4022 GSM_GetCurrentDateTime (&Backup.DateTime); 4022 GSM_GetCurrentDateTime (&Backup.DateTime);
4023 Backup.DateTimeAvailable=true; 4023 Backup.DateTimeAvailable=true;
4024 } 4024 }
4025 if (Info.Model) { 4025 if (Info.Model) {
4026 error=Phone->GetManufacturer(&s); 4026 error=Phone->GetManufacturer(&s);
4027 Print_Error(error); 4027 Print_Error(error);
4028 sprintf(Backup.Model,"%s ",s.Phone.Data.Manufacturer); 4028 sprintf(Backup.Model,"%s ",s.Phone.Data.Manufacturer);
4029 if (s.Phone.Data.ModelInfo->model[0]!=0) { 4029 if (s.Phone.Data.ModelInfo->model[0]!=0) {
4030 strcat(Backup.Model,s.Phone.Data.ModelInfo->model); 4030 strcat(Backup.Model,s.Phone.Data.ModelInfo->model);
4031 } else { 4031 } else {
4032 strcat(Backup.Model,s.Phone.Data.Model); 4032 strcat(Backup.Model,s.Phone.Data.Model);
4033 } 4033 }
4034 strcat(Backup.Model," "); 4034 strcat(Backup.Model," ");
4035 strcat(Backup.Model,s.Phone.Data.Version); 4035 strcat(Backup.Model,s.Phone.Data.Version);
4036 } 4036 }
4037 if (Info.IMEI) { 4037 if (Info.IMEI) {
4038 error=Phone->GetIMEI(&s); 4038 error=Phone->GetIMEI(&s);
4039 if (error != ERR_NOTSUPPORTED) { 4039 if (error != ERR_NOTSUPPORTED) {
4040 strcpy(Backup.IMEI, s.Phone.Data.IMEI); 4040 strcpy(Backup.IMEI, s.Phone.Data.IMEI);
4041 Print_Error(error); 4041 Print_Error(error);
4042 } else { 4042 } else {
4043 Backup.IMEI[0] = 0; 4043 Backup.IMEI[0] = 0;
4044 } 4044 }
4045 } 4045 }
4046 printf("\n"); 4046 printf("\n");
4047 4047
4048 DoBackup = false; 4048 DoBackup = false;
4049 if (Info.PhonePhonebook) { 4049 if (Info.PhonePhonebook) {
4050 printmsg("Checking phone phonebook\n"); 4050 printmsg("Checking phone phonebook\n");
4051 MemStatus.MemoryType = MEM_ME; 4051 MemStatus.MemoryType = MEM_ME;
4052 error=Phone->GetMemoryStatus(&s, &MemStatus); 4052 error=Phone->GetMemoryStatus(&s, &MemStatus);
4053 if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { 4053 if (error==ERR_NONE && MemStatus.MemoryUsed != 0) {
4054 if (answer_yes(" Backup phone phonebook")) DoBackup = true; 4054 /*LRif (answer_yes(" Backup phone phonebook")) */DoBackup = true;
4055 } 4055 }
4056 } 4056 }
4057 if (DoBackup) { 4057 if (DoBackup) {
4058 Pbk.MemoryType = MEM_ME; 4058 Pbk.MemoryType = MEM_ME;
4059 i = 1; 4059 i = 1;
4060 used = 0; 4060 used = 0;
4061 while (used != MemStatus.MemoryUsed) { 4061 while (used != MemStatus.MemoryUsed) {
4062 Pbk.Location = i; 4062 Pbk.Location = i;
4063 error=Phone->GetMemory(&s, &Pbk); 4063 error=Phone->GetMemory(&s, &Pbk);
4064 if (error != ERR_EMPTY) { 4064 if (error != ERR_EMPTY) {
4065 Print_Error(error); 4065 Print_Error(error);
4066 if (used < GSM_BACKUP_MAX_PHONEPHONEBOOK) { 4066 if (used < GSM_BACKUP_MAX_PHONEPHONEBOOK) {
4067 Backup.PhonePhonebook[used] = malloc(sizeof(GSM_MemoryEntry)); 4067 Backup.PhonePhonebook[used] = malloc(sizeof(GSM_MemoryEntry));
4068 if (Backup.PhonePhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY); 4068 if (Backup.PhonePhonebook[used] == NULL) Print_Error(ERR_MOREMEMORY);
4069 Backup.PhonePhonebook[used+1] = NULL; 4069 Backup.PhonePhonebook[used+1] = NULL;
4070 } else { 4070 } else {
4071 printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PHONEPHONEBOOK"); 4071 printmsg(" Increase %s\n" , "GSM_BACKUP_MAX_PHONEPHONEBOOK");
4072 GSM_Terminate(); 4072 GSM_Terminate();
4073 exit(-1); 4073 exit(-1);
4074 } 4074 }
4075 *Backup.PhonePhonebook[used]=Pbk; 4075 *Backup.PhonePhonebook[used]=Pbk;
4076 used++; 4076 used++;
4077 } 4077 }
4078 printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed); 4078 printmsgerr("%c Reading: %i percent",13,used*100/MemStatus.MemoryUsed);
4079 i++; 4079 i++;
4080 if (gshutdown) { 4080 if (gshutdown) {
4081 GSM_Terminate(); 4081 GSM_Terminate();
4082 exit(0); 4082 exit(0);
4083 } 4083 }
4084 } 4084 }
4085 printmsgerr("\n"); 4085 printmsgerr("\n");
4086 } 4086 }
4087 DoBackup = false; 4087 DoBackup = false;
4088 if (Info.SIMPhonebook) { 4088 if (Info.SIMPhonebook) {
4089 printmsg("Checking SIM phonebook\n"); 4089 printmsg("Checking SIM phonebook\n");
4090 MemStatus.MemoryType = MEM_SM; 4090 MemStatus.MemoryType = MEM_SM;
4091 error=Phone->GetMemoryStatus(&s, &MemStatus); 4091 error=Phone->GetMemoryStatus(&s, &MemStatus);
4092 if (error==ERR_NONE && MemStatus.MemoryUsed != 0) { 4092 if (error==ERR_NONE && MemStatus.MemoryUsed != 0) {
4093 if (answer_yes(" Backup SIM phonebook")) DoBackup=true; 4093 if (answer_yes(" Backup SIM phonebook")) DoBackup=true;
4094 } 4094 }
4095 } 4095 }
4096 if (DoBackup) { 4096 if (DoBackup) {
4097 Pbk.MemoryType = MEM_SM; 4097 Pbk.MemoryType = MEM_SM;
4098 i = 1; 4098 i = 1;
4099 used = 0; 4099 used = 0;
4100 while (used != MemStatus.MemoryUsed) { 4100 while (used != MemStatus.MemoryUsed) {
4101 Pbk.Location = i; 4101 Pbk.Location = i;
4102 error=Phone->GetMemory(&s, &Pbk); 4102 error=Phone->GetMemory(&s, &Pbk);