Menu

Main Menu
Talk Get Daily Search

Member's Online

    User Name
    Password

    [ANNOUNCE] Phone Speakers Switcher - turns speakers on/off during call

    Reply
    Page 4 of 15 | Prev |   2     3   4   5     6   14 | Next | Last
    jaeezzy | # 31 | 2010-03-20, 03:09 | Report

    Originally Posted by hawaii View Post
    Interested in implementing tapping the power button, to disconnect the call instead of the camera button (which works brilliantly, by the way).

    If not, I can localize and make a personal patch.
    Ya, that would be fine but the thing is when pressing power button it pops up a menu and I don't know how I can cancel that and only do what I want. If you can tell me how, I can implement that and also I'm working on proximity sensor coz the one I'm using at the moment isn't giving stable result - meaning in the day time, night and night time with the room lights on. Maybe because I chose the shorthand (easy way) Can anyone plz check this one and report me back?. Coz all I'm doing now is reading the files from /sys/class/hwmon/hwmon1/device/ namely adc0 and adc1 every 1 second and as they return numeric values, I'm just using that to turn speakers on/off. Can someone plz tell what they are actually, coz they are giving random results in different scenarios like I mentioned above and from what I found in the web, it is suppose to give proximity value.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qwerty12 | # 32 | 2010-03-20, 08:11 | Report

    Originally Posted by jaeezzy View Post
    Coz all I'm doing now is reading the files from /sys/class/hwmon/hwmon1/device/ namely adc0 and adc1 every 1 second and as they return numeric values, I'm just using that to turn speakers on/off. Can someone plz tell what they are actually, coz they are giving random results in different scenarios like I mentioned above and from what I found in the web, it is suppose to give proximity value.
    That would be due to those being the values for the light sensor... You want the file "/sys/bus/platform/devices/proximity/state" which can have a state of "open" or "closed".

    P.S. GIOChannels provide a nicer alternative to watching files.

    Edit | Forward | Quote | Quick Reply | Thanks

    Last edited by qwerty12; 2010-03-20 at 08:15. Reason: 'l', even
    The Following User Says Thank You to qwerty12 For This Useful Post:
    jaeezzy

     
    pillar | # 33 | 2010-03-20, 09:05 | Report

    Shortcutd uses proximityd which I think could be used for easy proximity reading. Maybe it could be useful here as well?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jaeezzy | # 34 | 2010-03-21, 02:01 | Report

    Originally Posted by qwerty12 View Post
    That would be due to those being the values for the light sensor... You want the file "/sys/bus/platform/devices/proximity/state" which can have a state of "open" or "closed".

    P.S. GIOChannels provide a nicer alternative to watching files.
    Thanks for the info but I just couldn't make use of GIOChannel. Here's how I did:

    Code:
    int fd = open("/sys/bus/platform/devices/proximity/state", O_RDONLY, O_NONBLOCK, O_NOCTTY);
    GIOChannel *channel = g_io_channel_unix_new(fd);
    g_io_add_watch(channel, G_IO_IN | G_IO_PRI, (GIOFunc)readState, NULL);
    ..........
    
    gboolean readState(GIOChannel *channel, GIOCondition cond, gpointer data){
     gchar *state;
     gsize size;
     GIOStatus ret = g_io_channel_read_line(channel, &state, &size, NULL, NULL);
     if (ret != G_IO_STATUS_ERROR){
       printf("STATE: %s", state);
       if (strcmp(state, "open") == 0){
            ...........
        }
       else if (strcmp(state, "closed") == 0){
            ...........
       }
       g_free(state);
     }else
       return FALSE;
    
     return TRUE;
    }
    Any help would be great. Thanks

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qwerty12 | # 35 | 2010-03-21, 07:19 | Report

    Originally Posted by jaeezzy View Post
    Thanks for the info but I just couldn't make use of GIOChannel. Here's how I did:

    Code:
    int fd = open("/sys/bus/platform/devices/proximity/state", O_RDONLY, O_NONBLOCK, O_NOCTTY);
    GIOChannel *channel = g_io_channel_unix_new(fd);
    g_io_add_watch(channel, G_IO_IN | G_IO_PRI, (GIOFunc)readState, NULL);
    ..........
    
    gboolean readState(GIOChannel *channel, GIOCondition cond, gpointer data){
     gchar *state;
     gsize size;
     GIOStatus ret = g_io_channel_read_line(channel, &state, &size, NULL, NULL);
     if (ret != G_IO_STATUS_ERROR){
       printf("STATE: %s", state);
       if (strcmp(state, "open") == 0){
            ...........
        }
       else if (strcmp(state, "closed") == 0){
            ...........
       }
       g_free(state);
     }else
       return FALSE;
    
     return TRUE;
    }
    Any help would be great. Thanks
    I'd be lying if I said I knew, so all I can do is point you to headphoned: http://repo.or.cz/w/headphoned.git/b...dphoned.c#l280

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to qwerty12 For This Useful Post:
    jaeezzy

     
    jaeezzy | # 36 | 2010-03-22, 01:21 | Report

    I've just uploaded the current version 0.1-5 to both devel and my #1 post. Its more matured now As, always all info are in that same post.

    Edit | Forward | Quote | Quick Reply | Thanks
    The Following User Says Thank You to jaeezzy For This Useful Post:
    qwerty12

     
    jaeezzy | # 37 | 2010-03-22, 06:30 | Report

    ok I think I've messed up couple of things in extras-devel repo as it's says dependency missing and I've no idea why and it can't be downloaded (I'm just noticing it). I checked some other packages and in every of them its "libosso1 (>=2.23)" but how come mine has "libosso1 (>=2.26)" and its in this where the problem lies. I'm using scratchbox only nothing else and in control file in Depends its ${shlibsepends}. Any help would be great however installing the provided deb file in the #1 post goes well. Thanks

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qwerty12 | # 38 | 2010-03-22, 10:32 | Report

    Originally Posted by jaeezzy View Post
    ok I think I've messed up couple of things in extras-devel repo as it's says dependency missing and I've no idea why and it can't be downloaded (I'm just noticing it). I checked some other packages and in every of them its "libosso1 (>=2.23)" but how come mine has "libosso1 (>=2.26)" and its in this where the problem lies. I'm using scratchbox only nothing else and in control file in Depends its ${shlibsepends}. Any help would be great however installing the provided deb file in the #1 post goes well. Thanks
    https://bugs.maemo.org/show_bug.cgi?id=9070#c3 - the first paragraph there should sum it up.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    jaeezzy | # 39 | 2010-03-22, 11:18 | Report

    Originally Posted by qwerty12 View Post
    https://bugs.maemo.org/show_bug.cgi?id=9070#c3 - the first paragraph there should sum it up.
    Thanks for the info and does that mean I've to wait until the release of PR1.2 to be able to upload downloadable package in extras-* repo?

    Edit | Forward | Quote | Quick Reply | Thanks

     
    qwerty12 | # 40 | 2010-03-22, 11:21 | Report

    Originally Posted by jaeezzy View Post
    Thanks for the info and does that mean I've to wait until the release of PR1.2 to be able to upload downloadable package in extras-* repo?
    Nah, you should be OK -- you don't appear to depend on any components that are new to PR 1.1.

    Edit | Forward | Quote | Quick Reply | Thanks

     
    Page 4 of 15 | Prev |   2     3   4   5     6   14 | Next | Last
vBulletin® Version 3.8.8
Normal Logout