Hello Mikkel, "Make sure that you have given the right write permissions to the LED sysfs entry. This can be done in your init.rc file."
Can you elaborate on this a bit more please? I am trying to edit my init.rc file but there are so many sections e.g. on boot. Where would I insert the commands? I am assuming I have to insert "write sysfs/gpio/export xxx" or something similar. Thanks Jerry On Tuesday, November 23, 2010 at 12:33:19 PM UTC+2, Mikkel Christensen wrote: > > Hello, > > I would use the SimpleJNI sample application [1] as a base reference. > This does the right coupling from Android application to your lower > level hardware interface. > > 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. > > 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"); > > Make sure that you have given the right write permissions to the LED > sysfs entry. This can be done in your init.rc file. > > Best regards, > Mikkel Christensen > > [1] > http://android.git.kernel.org/?p=platform/development.git;a=tree;f=samples/SimpleJNI > > > On Nov 17, 12:10 am, "jon.schell" <jon.sch...@kyocera.com> wrote: > > I am trying to create a simple app for testing that will toggle an LED > > on the phone as needed. I have the NDK set up and my c code compiles, > > but I don't know how to link it to the actual hardware function that > > would set the LED. I'm using the actual source code for the hardware, > > it's not in an exposed library. Do I need to create a static library > > for it to use? Would it maybe be easier to add an android API for > > this somehow rather than using the NDK? > > > > For reference, this is Android 2.1 on a Qualcomm MSM7627. > > > > Jonathan -- -- unsubscribe: android-porting+unsubscr...@googlegroups.com website: http://groups.google.com/group/android-porting --- You received this message because you are subscribed to the Google Groups "android-porting" group. To unsubscribe from this group and stop receiving emails from it, send an email to android-porting+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/android-porting/04c99ba0-ec9b-4499-aacd-353d7ea93092%40googlegroups.com.