summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libgsmd/libgsmd_modem.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/libgsmd/libgsmd_modem.c b/src/libgsmd/libgsmd_modem.c
new file mode 100644
index 0000000..e01b350
--- /dev/null
+++ b/src/libgsmd/libgsmd_modem.c
@@ -0,0 +1,23 @@
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+
+#include <libgsmd/libgsmd.h>
+#include <libgsmd/misc.h>
+
+#include <gsmd/usock.h>
+#include <gsmd/event.h>
+
+#include "lgsm_internals.h"
+
+int lgsm_modem_power(struct lgsm_handle *lh, int power)
+{
+ int type;
+
+ if (power)
+ type = GSMD_MODEM_POWERUP;
+ else
+ type = GSMD_MODEM_POWERDOWN;
+
+ return lgsm_send_simple(lh, GSMD_MSG_MODEM, type);
+}
personal git repositories of Harald Welte. Your mileage may vary