Accessing power_supply class properties from user space?

Showing 1-2 of 2 messages
Accessing power_supply class properties from user space? Yogi 4/22/12 10:56 PM
Hi,

I have a power supply driver and its properties are exposed under /sys/class/power_supply/<chip_name>/.. It has list like voltage_now, health etc etc. If I do a 'cat voltage_now' I can get the needed data.

From user space I want to call an API which can give me access to reading the battery properties. I am not aware of such interface. I dont want to do 'cat' all the times.

Can someone provide inputs please?

Regards,

Yog
Re: [android-kernel] Accessing power_supply class properties from user space? Durga 4/23/12 7:05 PM
Hi Yogi,

You have to open the files as normal files, and read them.
For example, you can use BufferedReader and use br.readLine();

-Durga




--
Regards
Durgadoss