On Tue, Jan 27, 2009 at 22:00, Michael Trimarchi
<[email protected]> wrote:
> If you send the code I explain how to do that.
>
> - introduce a new function in the hardware part
> - add a new jni interface for the system
> - use the jni interface
> - using a new system thread to export parameter
> - using you application like a frontend application
>
> It is ok?
So I could test again. I first used Runime exec to luanch a shell
command, but as Jim said, It can simply be done via :
// change usb current limit :
FileWriter fileWriter = new
FileWriter("/sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/force_usb_limit_dangerous");
fileWriter.write("500"); // or 100, or 1000
fileWriter.close();
// I also can read current values this way (here no need to change permissions):
FileReader fileReader = new
FileReader("/sys/class/i2c-adapter/i2c-0/0-0073/pcf50633-mbc/usb_curlim");
char[] buf = new char[20];
int read = fileReader.read(buf);
fileReader.close();
String currentNow = new String(buf, 0, read);
(same for other usefull values as
/sys/class/power_supply/battery/current_now , voltage, ....)
So JNI may not be needed.
But I do not know how to allow write access to this property only with
some Android permissions.
_______________________________________________
android-freerunner mailing list
[email protected]
http://android.koolu.org/listinfo.cgi/android-freerunner-koolu.org