View Single Post
Posts: 805 | Thanked: 1,605 times | Joined on Feb 2010 @ Gdynia, Poland
#952
Originally Posted by pali View Post
Problem is that bq27200 chip report only one value (there is no active or ide using). New hald-addon-bme sending that dbus signal too, but both values are same.

See function hald_addon_bme_timeleft_info in https://gitorious.org/rx51-bme-repla...ld-addon-bme.c
Ok, I understand. But in the file you linked I still see
Code:
...
    else if (battery_info->power_supply_status == STATUS_DISCHARGING)

    {

      CHECK_INT(power_supply_time_to_empty_avg,

            libhal_device_set_property_int (hal_ctx, udi, "battery.remaining_time", battery_info->power_supply_time_to_empty_avg, NULL));

    }
...
As well as...
Code:
...
#define BQ27200_UEVENT_FILE_PATH "/sys/class/power_supply/bq27200-0/uevent"
...
fp = fopen(BQ27200_UEVENT_FILE_PATH,"r")
...
   while(fgets(line,sizeof(line),fp))

  {

    char*tmp;

    tmp = strchr(line,'=');
...
      else if(!strcmp(line,"POWER_SUPPLY_TIME_TO_EMPTY_AVG"))

        battery_info->power_supply_time_to_empty_avg = atoi(tmp);
...
But I don't have "/sys/class/power_supply/bq27200-0/uevent" on my main n900 (i have bme, not any open replacement and neither your kernel module). So I understand this code and I think I know now what you mean.

1. your kernel module reports values in its own way and it's irrelevant here
2. hald-addon-bme from rx51-bme-replacement reports value ONLY via battery.remaining_time
3. hald-addon-bme from stock firmware (the closed one) reports value via battery.remaining_time AND reports two values via a signal I desribed earlier.

So, the rx51-bme-replacement doesn't implement the signal emission, do I get it right? (if this is true, the code of your widget could become even more complex and have 3 possible reading options, not 2 )

AND, if I understand you correctly, the chip reports only one value and it's the one reported in battery.remaining_time and the values reported in a signal:
Code:
signal sender=:1.27 -> dest=(null destination) serial=48 path=/com/nokia/bme/signal; interface=com.nokia.bme.signal; member=battery_timeleft
   uint32 4260
   uint32 180
are calculated by some equation we don't know. Do I get you right?

If I understood you, is it possible that the value reported by chip (which we put in battery.remaining_time) is e.g. some kind of current (not as "electric current" but as "right here right now") power usage (some encoded value, e.g. 3600 means 500mA, 7200 means 600mA, 10800 means 700mAh, etc. - but the mA numbers are totally made up), I just noticed that these values depend on device usage - the more cpu and ram is active atm, the higher that number is (that's why I came to this conclusion, but feel free to educate me and proove me wrong, or just write I'm wrong and where I can read more about it to become less of a ***** and more of a genius ).

edit: by the way, thanks for answering.

edit2: in order not to spam i answered for the next Pali's message at http://talk.maemo.org/showthread.php...28#post1291628 .

Last edited by misiak; 2012-11-07 at 23:12.
 

The Following 4 Users Say Thank You to misiak For This Useful Post: