summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/atcmd.c4
-rw-r--r--src/util/event.c4
-rw-r--r--src/util/pin.c4
-rw-r--r--src/util/shell.c12
4 files changed, 16 insertions, 8 deletions
diff --git a/src/util/atcmd.c b/src/util/atcmd.c
index 36984b5..88703d0 100644
--- a/src/util/atcmd.c
+++ b/src/util/atcmd.c
@@ -35,6 +35,7 @@ static int pt_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
{
char *payload = (char *)gmh + sizeof(*gmh);
printf("RSTR=`%s'\n", payload);
+ return 0;
}
int atcmd_main(struct lgsm_handle *lgsmh)
@@ -42,7 +43,7 @@ int atcmd_main(struct lgsm_handle *lgsmh)
int rc;
char buf[STDIN_BUF_SIZE+1];
char rbuf[STDIN_BUF_SIZE+1];
- int rlen = sizeof(rbuf);
+ unsigned int rlen = sizeof(rbuf);
fd_set readset;
lgsm_register_handler(lgsmh, GSMD_MSG_PASSTHROUGH, &pt_msghandler);
@@ -99,4 +100,5 @@ int atcmd_main(struct lgsm_handle *lgsmh)
fflush(stdout);
}
}
+ return 0;
}
diff --git a/src/util/event.c b/src/util/event.c
index d063642..88f315f 100644
--- a/src/util/event.c
+++ b/src/util/event.c
@@ -115,7 +115,7 @@ static int incbm_handler(struct lgsm_handle *lh, int evt,
msg->page, msg->pages);
if (msg->coding_scheme == ALPHABET_DEFAULT) {
- cbm_unpacking_7bit_character(msg->data, payload);
+ cbm_unpacking_7bit_character((char *)msg->data, payload);
printf("\"%s\"\n", payload);
} else if (msg->coding_scheme == ALPHABET_8BIT)
printf("8-bit encoded data\n");
@@ -176,6 +176,8 @@ static int netreg_handler(struct lgsm_handle *lh, int evt, struct gsmd_evt_auxda
case GSMD_NETREG_REG_ROAMING:
printf("registered (roaming) ");
break;
+ default:
+ break;
}
if (aux->u.netreg.lac)
diff --git a/src/util/pin.c b/src/util/pin.c
index b873535..47602b6 100644
--- a/src/util/pin.c
+++ b/src/util/pin.c
@@ -52,7 +52,7 @@ static int pin_handler(struct lgsm_handle *lh,
} else {
do {
printf("Please enter %s: ", lgsm_pin_name(type));
- rc = fscanf(stdin, "%8s", &pinbuf);
+ rc = fscanf(stdin, "%8s", pinbuf);
} while (rc < 1);
switch (type) {
@@ -60,7 +60,7 @@ static int pin_handler(struct lgsm_handle *lh,
case GSMD_PIN_SIM_PUK2:
do {
printf("Please enter new PIN: ");
- rc = fscanf(stdin, "%8s", &pinbuf2);
+ rc = fscanf(stdin, "%8s", pinbuf2);
newpin = pinbuf2;
} while (rc < 1);
break;
diff --git a/src/util/shell.c b/src/util/shell.c
index 976acc2..f5f8fd3 100644
--- a/src/util/shell.c
+++ b/src/util/shell.c
@@ -31,6 +31,7 @@
#include <libgsmd/misc.h>
#include <libgsmd/phonebook.h>
#include <libgsmd/sms.h>
+#include <libgsmd/pin.h>
#include <gsmd/usock.h>
#include <gsmd/ts0705.h>
@@ -49,6 +50,7 @@ static int pt_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
{
char *payload = (char *)gmh + sizeof(*gmh);
printf("RSTR=`%s'\n", payload);
+ return 0;
}
/* this is the handler for receiving phonebook responses */
@@ -135,7 +137,8 @@ static int pb_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
break;
default:
return -EINVAL;
- }
+ }
+ return 0;
}
/* this is the handler for receiving sms responses */
@@ -273,6 +276,7 @@ static int sms_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
pending_responses --;
return -EINVAL;
}
+ return 0;
}
/* this is the handler for responses to network/operator commands */
@@ -359,6 +363,7 @@ static int net_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
default:
return -EINVAL;
}
+ return 0;
}
static int phone_msghandler(struct lgsm_handle *lh, struct gsmd_msg_hdr *gmh)
@@ -482,7 +487,7 @@ static const struct msghandler_s {
{ 0, 0 }
};
-static int shell_help(void)
+static void shell_help(void)
{
printf( "\tA\tAnswer incoming call\n"
"\tD\tDial outgoing number\n"
@@ -542,8 +547,6 @@ int shell_main(struct lgsm_handle *lgsmh, int sync)
{
int rc;
char buf[STDIN_BUF_SIZE+1];
- char rbuf[STDIN_BUF_SIZE+1];
- int rlen = sizeof(rbuf);
fd_set readset;
char *ptr, *fcomma, *lcomma;
int gsm_fd = lgsm_fd(lgsmh);
@@ -923,4 +926,5 @@ int shell_main(struct lgsm_handle *lgsmh, int sync)
}
fflush(stdout);
}
+ return 0;
}
personal git repositories of Harald Welte. Your mileage may vary