summaryrefslogtreecommitdiff
path: root/gammu/misc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gammu/misc.c')
-rw-r--r--gammu/misc.c66
1 files changed, 39 insertions, 27 deletions
diff --git a/gammu/misc.c b/gammu/misc.c
index fa9ac53..ce67388 100644
--- a/gammu/misc.c
+++ b/gammu/misc.c
@@ -57,6 +57,18 @@ void PrintNetworkInfo(GSM_NetworkInfo NetInfo)
DecodeUnicodeConsole(NetInfo.NetworkName));
}
}
+ if (NetInfo.GPRS != 0) {
+ printf(LISTFORMAT, _("GPRS"));
+ switch (NetInfo.GPRS) {
+ case GSM_GPRS_Attached:
+ printf("%s", _("attached"));
+ break;
+ case GSM_GPRS_Detached:
+ printf("%s", _("detached"));
+ break;
+ }
+ printf("\n");
+ }
}
GSM_Error GSM_PlayRingtone(GSM_Ringtone ringtone)
@@ -586,7 +598,7 @@ void DialVoice(int argc, char *argv[])
} else if (strcasecmp(argv[3],"hide") == 0) { ShowNumber = GSM_CALL_HideNumber;
} else {
printf(_("Unknown parameter (\"%s\")\n"),argv[3]);
- Terminate(3);
+ Terminate(2);
}
}
@@ -615,7 +627,7 @@ void MakeTerminatedCall(int argc, char *argv[])
} else if (strcasecmp(argv[4],"hide") == 0) { ShowNumber = GSM_CALL_HideNumber;
} else {
printf(_("Unknown parameter (\"%s\")\n"),argv[4]);
- Terminate(3);
+ Terminate(2);
}
}
@@ -755,7 +767,7 @@ void Reset(int argc UNUSED, char *argv[])
} else if (strcasecmp(argv[2],"HARD") == 0) { hard=TRUE;
} else {
printf(_("What type of reset do you want (\"%s\") ?\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
GSM_Init(TRUE);
@@ -866,7 +878,7 @@ void GetBitmap(int argc, char *argv[])
MultiBitmap.Bitmap[0].Type=GSM_OperatorLogo;
} else {
printf(_("What type of logo do you want to get (\"%s\") ?\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
MultiBitmap.Bitmap[0].Location=location;
@@ -976,7 +988,7 @@ void SetBitmap(int argc, char *argv[])
if (strcasecmp(argv[2],"STARTUP") == 0) {
if (argc<4) {
printf("%s\n", _("More parameters required!"));
- Terminate(3);
+ Terminate(2);
}
MultiBitmap.Bitmap[0].Type=GSM_StartupLogo;
MultiBitmap.Bitmap[0].Location=1;
@@ -991,26 +1003,26 @@ void SetBitmap(int argc, char *argv[])
} else if (strcasecmp(argv[2],"TEXT") == 0) {
if (argc<4) {
printf("%s\n", _("More parameters required!"));
- Terminate(3);
+ Terminate(2);
}
Bitmap.Type=GSM_WelcomeNote_Text;
EncodeUnicode(Bitmap.Text,argv[3],strlen(argv[3]));
} else if (strcasecmp(argv[2],"DEALER") == 0) {
if (argc<4) {
printf("%s\n", _("More parameters required!"));
- Terminate(3);
+ Terminate(2);
}
Bitmap.Type=GSM_DealerNote_Text;
EncodeUnicode(Bitmap.Text,argv[3],strlen(argv[3]));
} else if (strcasecmp(argv[2],"CALLER") == 0) {
if (argc<4) {
printf("%s\n", _("More parameters required!"));
- Terminate(3);
+ Terminate(2);
}
GetStartStop(&i, NULL, 3, argc, argv);
if (i>5 && i!=255) {
printf("%s\n", _("Maximal location for caller logo can be 5"));
- Terminate(2);
+ Terminate(1);
}
MultiBitmap.Bitmap[0].Type = GSM_CallerGroupLogo;
MultiBitmap.Bitmap[0].Location = i;
@@ -1035,7 +1047,7 @@ void SetBitmap(int argc, char *argv[])
} else if (strcasecmp(argv[2],"PICTURE") == 0) {
if (argc<5) {
printf("%s\n", _("More parameters required!"));
- Terminate(3);
+ Terminate(2);
}
MultiBitmap.Bitmap[0].Type = GSM_PictureImage;
MultiBitmap.Bitmap[0].Location = atoi(argv[4]);
@@ -1093,7 +1105,7 @@ void SetBitmap(int argc, char *argv[])
memcpy(&Bitmap,&MultiBitmap.Bitmap[0],sizeof(GSM_Bitmap));
} else {
printf(_("What type of logo do you want to set (\"%s\") ?\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
if (init) GSM_Init(TRUE);
@@ -1134,7 +1146,7 @@ void SetRingtone(int argc, char *argv[])
break;
}
printf(_("Unknown parameter (\"%s\")"),argv[i]);
- Terminate(3);
+ Terminate(2);
case 1:
ringtone.Location=atoi(argv[i]);
nextlong = 0;
@@ -1147,11 +1159,11 @@ void SetRingtone(int argc, char *argv[])
}
if (nextlong!=0) {
printf_err("%s\n", _("Parameter missing!"));
- Terminate(3);
+ Terminate(2);
}
if (ringtone.Location==0) {
printf_err("%s\n", _("Please enumerate locations from 1"));
- Terminate(2);
+ Terminate(1);
}
GSM_Init(TRUE);
@@ -1192,7 +1204,7 @@ void ClearMemory(GSM_MemoryType type, const char *question)
(i + 1) * 100 / (MemStatus.MemoryUsed + MemStatus.MemoryFree));
if (gshutdown) {
GSM_Terminate();
- Terminate(0);
+ Terminate(4);
}
}
fprintf(stderr, "\n");
@@ -1591,7 +1603,7 @@ void CopyBitmap(int argc, char *argv[])
Bitmap.Bitmap[i].Type = GSM_OperatorLogo;
} else {
printf(_("What format of output file logo (\"%s\") ?\n"),argv[4]);
- Terminate(3);
+ Terminate(2);
}
}
}
@@ -1616,7 +1628,7 @@ void CopyRingtone(int argc, char *argv[])
} else if (strcasecmp(argv[4],"BINARY") == 0) { Format = RING_NOKIABINARY;
} else {
printf(_("What format of output ringtone file (\"%s\") ?\n"),argv[4]);
- Terminate(3);
+ Terminate(2);
}
}
@@ -1636,7 +1648,7 @@ void PressKeySequence(int argc UNUSED, char *argv[])
error = MakeKeySequence(argv[2], KeyCode, &Length);
if (error == ERR_NOTSUPPORTED) {
printf(_("Unknown key/function name: \"%c\"\n"),argv[2][Length]);
- Terminate(3);
+ Terminate(2);
}
GSM_Init(TRUE);
@@ -1666,7 +1678,7 @@ void GetAllCategories(int argc UNUSED, char *argv[])
Status.Type = Category_Phonebook;
} else {
printf(_("What type of categories do you want to get (\"%s\") ?\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
GSM_Init(TRUE);
@@ -1704,7 +1716,7 @@ void GetCategory(int argc, char *argv[])
Category.Type = Category_Phonebook;
} else {
printf(_("What type of categories do you want to get (\"%s\") ?\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
GetStartStop(&start, &stop, 2, argc - 1, argv + 1);
@@ -1742,7 +1754,7 @@ void AddCategory(int argc UNUSED, char *argv[])
Category.Type = Category_Phonebook;
} else {
printf(_("What type of category do you want to add (\"%s\") ?\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
GSM_Init(TRUE);
@@ -1789,7 +1801,7 @@ void EnterSecurityCode(int argc UNUSED, char *argv[])
} else if (strcasecmp(argv[2],"NETWORK") == 0) { Code.Type = SEC_Network;
} else {
printf_err("%s: %s\n", _("Invalid security code type"), argv[2]);
- Terminate(3);
+ Terminate(2);
}
if (strcmp(argv[3], "-") == 0) {
@@ -1806,7 +1818,7 @@ void EnterSecurityCode(int argc UNUSED, char *argv[])
#endif
if (fscanf(stdin, "%15s", Code.Code) != 1) {
printf_err("%s\n", _("No PIN code entered!"));
- Terminate(3);
+ Terminate(2);
}
#endif
} else {
@@ -2009,7 +2021,7 @@ void ResetPhoneSettings(int argc UNUSED, char *argv[])
} else if (strcasecmp(argv[2],"FACTORY") == 0) { Type = GSM_RESET_FULLFACTORY;
} else {
printf(_("What type of reset phone settings (\"%s\") ?\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
GSM_Init(TRUE);
@@ -2109,7 +2121,7 @@ void CallDivert(int argc, char *argv[])
else if (strcasecmp("set", argv[2]) == 0) {}
else {
printf(_("Unknown divert action (\"%s\")\n"),argv[2]);
- Terminate(3);
+ Terminate(2);
}
if (strcasecmp("all" , argv[3]) == 0) {cd.Request.DivertType = GSM_DIVERT_AllTypes ;}
@@ -2118,7 +2130,7 @@ void CallDivert(int argc, char *argv[])
else if (strcasecmp("outofreach", argv[3]) == 0) {cd.Request.DivertType = GSM_DIVERT_OutOfReach;}
else {
printf(_("Unknown divert type (\"%s\")\n"),argv[3]);
- Terminate(3);
+ Terminate(2);
}
if (strcasecmp("all" , argv[4]) == 0) {cd.Request.CallType = GSM_DIVERT_AllCalls ;}
@@ -2127,7 +2139,7 @@ void CallDivert(int argc, char *argv[])
else if (strcasecmp("data" , argv[4]) == 0) {cd.Request.CallType = GSM_DIVERT_DataCalls ;}
else {
printf(_("Unknown call type (\"%s\")\n"),argv[4]);
- Terminate(3);
+ Terminate(2);
}
GSM_Init(TRUE);