summaryrefslogtreecommitdiffstats
path: root/front-light.c
diff options
context:
space:
mode:
authorroot <root@no.no.james.local>2015-12-28 11:28:47 +0000
committerroot <root@no.no.james.local>2015-12-28 11:28:47 +0000
commit5e4cc437931fb429f9187523de1cfac93e2cb80e (patch)
tree424727e70ac954c42916e14c8c5661ff4af713ad /front-light.c
parent2ad7917a466655a2e8907ff73cdef4c8ea266872 (diff)
downloadkobo-tools-5e4cc437931fb429f9187523de1cfac93e2cb80e.tar.gz
kobo-tools-5e4cc437931fb429f9187523de1cfac93e2cb80e.tar.bz2
kobo-tools-5e4cc437931fb429f9187523de1cfac93e2cb80e.zip
add led and front-light tools
Diffstat (limited to 'front-light.c')
-rw-r--r--front-light.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/front-light.c b/front-light.c
new file mode 100644
index 0000000..e331a26
--- /dev/null
+++ b/front-light.c
@@ -0,0 +1,19 @@
+#include <fcntl.h>
+#include <sys/ioctl.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#define CM_FRONT_LIGHT_SET 241
+
+main (int argc, char *argv[])
+{
+ int fd;
+ fd = open ("/dev/ntx_io", O_RDWR);
+
+ if (argc != 2) {
+ printf ("Usage:\n%s {0-100}\n", argv[0]);
+ exit (1);
+ }
+
+ return ioctl (fd, CM_FRONT_LIGHT_SET, atoi (argv[1]));
+}