summaryrefslogtreecommitdiff
path: root/src/gsmd
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2013-03-15 11:07:12 +0100
committerHarald Welte <laforge@gnumonks.org>2013-03-15 11:07:12 +0100
commit3ec111676ff9e34058b3bf2e482a236f341c10eb (patch)
tree4a12ba3ccfd8ed8d15d0624ed0a41034043df9a4 /src/gsmd
parent4c14b6eb4183905dea8f0a2cea695cebb174815f (diff)
Add run-time changing of gsmd log level via libgsm/libgsmd-tool
Diffstat (limited to 'src/gsmd')
-rw-r--r--src/gsmd/usock.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/gsmd/usock.c b/src/gsmd/usock.c
index 13c3bb1..f258fd6 100644
--- a/src/gsmd/usock.c
+++ b/src/gsmd/usock.c
@@ -43,6 +43,8 @@
#include <gsmd/ts0707.h>
#include <gsmd/sms.h>
+extern int loglevel;
+
static void *__ucmd_ctx, *__gu_ctx;
struct gsmd_ucmd *ucmd_alloc(int extra_size)
@@ -765,6 +767,14 @@ static int usock_rcv_phone(struct gsmd_user *gu, struct gsmd_msg_hdr *gph,
cmd = atcmd_fill("AT+CVIB=0", 9+1, &phone_vibrator_disable_cb, gu, 0, NULL);
gu->gsmd->dev_state.vibrator = 0;
break;
+ case GSMD_PHONE_GSMD_LOGLEVEL:
+ if (gph->len < 1)
+ return -EINVAL;
+ gsmd_log(GSMD_NOTICE, "Setting loglevel to %u on client "
+ "request\n", gph->data[0]);
+ loglevel = gph->data[0];
+ return 0;
+ break;
default:
return -EINVAL;
}
personal git repositories of Harald Welte. Your mileage may vary