summaryrefslogtreecommitdiff
path: root/src/libgsmd
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/libgsmd
parent4c14b6eb4183905dea8f0a2cea695cebb174815f (diff)
Add run-time changing of gsmd log level via libgsm/libgsmd-tool
Diffstat (limited to 'src/libgsmd')
-rw-r--r--src/libgsmd/libgsmd_phone.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/libgsmd/libgsmd_phone.c b/src/libgsmd/libgsmd_phone.c
index a67642a..9f6569c 100644
--- a/src/libgsmd/libgsmd_phone.c
+++ b/src/libgsmd/libgsmd_phone.c
@@ -1,6 +1,7 @@
/* libgsmd phone related functions
*
* (C) 2006-2007 by OpenMoko, Inc.
+ * (C) 2013 by Harald Welte
* Written by Harald Welte <laforge@openmoko.org>
* All Rights Reserved
*
@@ -90,4 +91,20 @@ int lgsm_phone_vibrator(struct lgsm_handle *lh, int enable)
return lgsm_send_simple(lh, GSMD_MSG_PHONE, type);
}
-
+
+int lgsm_set_gsmd_loglevel(struct lgsm_handle *lh, u_int8_t loglevel)
+{
+ struct gsmd_msg_hdr *gmh;
+ int rc;
+
+ gmh = lgsm_gmh_fill(GSMD_MSG_PHONE, GSMD_PHONE_GSMD_LOGLEVEL, 1);
+ if (!gmh)
+ return -ENOMEM;
+
+ gmh->data[0] = loglevel;
+
+ rc = lgsm_send(lh, gmh);
+
+ lgsm_gmh_free(gmh);
+ return rc;
+}
personal git repositories of Harald Welte. Your mileage may vary