On Nov 23, 5:33 am, Mikkel Christensen <[email protected]>
wrote:
> If the LED is already exposed in sysfs you are lucky and it should be
> quite easy. Otherwise create a Kernel device driver that does the
> exposure of the LED to sysfs.
If it's already exposed in sysfs, you don't need to use native code.
You should be able to access the special file directly from java if
you have the permissions set right. If they are wrong, you can't
access it from the ndk either.
> Then in the /jni/native.cpp function do the proper write to the sysfs
> entry like this (note: this depends on how the led is exposed trough
> sysfs):
>
> ret = system("echo 1 > /sys/class/leds/red/brightness");
Chaining the echo command seems wasteful. Why not just write to the
special file yourself?
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting