summaryrefslogtreecommitdiff
path: root/src/util/libgsmd-tool.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util/libgsmd-tool.c')
-rw-r--r--src/util/libgsmd-tool.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/util/libgsmd-tool.c b/src/util/libgsmd-tool.c
index 5fb1eca..4ef3df5 100644
--- a/src/util/libgsmd-tool.c
+++ b/src/util/libgsmd-tool.c
@@ -73,6 +73,7 @@ static int parse_mode(char *modestr)
static struct option opts[] = {
{ "help", 0, 0, 'h' },
+ { "instance", 1, 0, 'i' },
{ "version", 0, 0, 'V' },
{ "verbose", 0, 0, 'v' },
{ "mode", 1, 0, 'm' },
@@ -85,6 +86,7 @@ static void help(void)
{
printf("Usage:\n"
"\t-h\t--help\tPrint this Help message\n"
+ "\t-i\t--instance <0-255>\tWhich instance nubmer to use\n"
"\t-V\t--version\tPrint version number\n"
"\t-v\t--verbose\tBe more verbose\n"
"\t-m\t--mode\tSet mode {shell,eventlog,atcmd}\n"
@@ -100,7 +102,7 @@ static void dump_version(void)
int main(int argc, char **argv)
{
char *pin = NULL;
- int mode = MODE_NONE, shellwait = 0;
+ int mode = MODE_NONE, shellwait = 0, instance = 0;
printf("libgsm-tool - (C) 2006-2007 by Harald Welte and OpenMoko, Inc.\n"
" (C) 2012-2013 by Harald Welte\n"
@@ -108,7 +110,7 @@ int main(int argc, char **argv)
while (1) {
int c, option_index = 0;
- c = getopt_long(argc, argv, "vVhwm:p:", opts, &option_index);
+ c = getopt_long(argc, argv, "vVhi:wm:p:", opts, &option_index);
if (c == -1)
break;
@@ -124,6 +126,9 @@ int main(int argc, char **argv)
help();
exit(0);
break;
+ case 'i':
+ instance = atoi(optarg);
+ break;
case 'm':
mode = parse_mode(optarg);
if (mode < 0) {
@@ -140,7 +145,7 @@ int main(int argc, char **argv)
}
}
- lgsmh = lgsm_init(LGSMD_DEVICE_GSMD);
+ lgsmh = lgsm_init_inst(instance);
if (!lgsmh) {
fprintf(stderr, "Can't connect to gsmd\n");
exit(1);
personal git repositories of Harald Welte. Your mileage may vary