Quantcast
Channel: MobileRead Forums - Kobo Reader
Viewing all articles
Browse latest Browse all 11155

Glo Controlling the Glo's Frontlight

$
0
0
I was looking at a strace of nickel today, and found that the Glo's frontlight is controlled by ioctl calls to /dev/ntx_io. I hacked together some quick C code to control the light:
Code:

#include <stdio.h>
#include <fcntl.h>
#include <sys/ioctl.h>

int main(int argc, char *argv[])
{
    if ( argc != 2 ) {
        printf("Usage: %s brightness \n", argv[0]);
        return 1;
    }
   
    int light;

    // Open the file for reading and writing
    if ((light = open("/dev/ntx_io", O_RDWR)) == -1) {
        printf("Error opening ntx_io device");       
    }

    int brightness = atoi ( (argv[1]) );
    ioctl(light, 241, brightness);

    return 0;
}

I know that some people, myself included, would like the light to go lower than the lowest setting offered by Kobo. And while there is one light level lower, level 1, that the Glo never uses, setting the frontlight to that level causes flickering that is very noticeable in a dark room.

I've attached the source code and the compiled program below.

Attached Files
File Type: zip GloLight.zip (3.2 KB)

Viewing all articles
Browse latest Browse all 11155

Trending Articles