[android-porting] Re: Interfacing native code to hardware functions

2020-03-10 Thread Jerry Naidoo
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

[android-porting] Re: Interfacing native code to hardware functions

2011-01-03 Thread Chris Stratton
On Jan 2, 3:31 pm, A Curtis ajcurti...@gmail.com wrote: On second thought there is a difference, The problem isn't just a sequence of instructions but having sufficient permission to execute. The Java JVM does not run as root. So,you need something that runs as root to change permissions to

[android-porting] Re: Interfacing native code to hardware functions

2011-01-03 Thread Chris Stratton
On Jan 2, 3:31 pm, A Curtis ajcurti...@gmail.com wrote: On second thought there is a difference, The problem isn't just a sequence of instructions but having sufficient permission to execute. The Java JVM does not run as root. echo isn't setuid root either So,you need something that runs as

[android-porting] Re: Interfacing native code to hardware functions

2011-01-02 Thread A Curtis
The point was to proviide a simple short example of how to export GPIO for access from Java. Of course the could have been done in Java but it would be more then 3 lines of code. On Jan 1, 7:13 pm, Chris Stratton cs07...@gmail.com wrote: On Dec 30 2010, 12:19 pm, A Curtis ajcurti...@gmail.com

[android-porting] Re: Interfacing native code to hardware functions

2011-01-02 Thread A Curtis
On second thought there is a difference, The problem isn't just a sequence of instructions but having sufficient permission to execute. The Java JVM does not run as root. So,you need something that runs as root to change permissions to enable Java access. IMO a script maybe the best solution

[android-porting] Re: Interfacing native code to hardware functions

2011-01-01 Thread Chris Stratton
On Dec 30 2010, 12:19 pm, A Curtis ajcurti...@gmail.com wrote: This is basically what I did to access a GPIO from Java land. echo 128 /sys/class/gpio/export echo out /sys/devices/virtual/gpio/gpio128/direction chmod 0666 /sys/devices/virtual/gpio/gpio128/value Just FYI, that's not

[android-porting] Re: Interfacing native code to hardware functions

2010-12-30 Thread A Curtis
I got this working! Basically I did not realize that SYSFS was more sophisticated than / proc and actually supported file permissions. This is basically what I did to access a GPIO from Java land. echo 128 /sys/class/gpio/export echo out /sys/devices/virtual/gpio/gpio128/direction chmod 0666

Re: [android-porting] Re: Interfacing native code to hardware functions

2010-12-30 Thread Dianne Hackborn
This of course opens up security holes. On Thu, Dec 30, 2010 at 9:19 AM, A Curtis ajcurti...@gmail.com wrote: I got this working! Basically I did not realize that SYSFS was more sophisticated than / proc and actually supported file permissions. This is basically what I did to access a GPIO

[android-porting] Re: Interfacing native code to hardware functions

2010-12-29 Thread A Curtis
Chris, Have you tried to access sysfs directly frdom Java? I have not been able to get this to work. Could you provide a code fragment? TIA On Nov 23, 10:12 am, Chris Stratton cs07...@gmail.com wrote: On Nov 23, 5:33 am, Mikkel Christensen mikkel.christen...@ixonos.com wrote: If the LED

[android-porting] Re: Interfacing native code to hardware functions

2010-11-29 Thread jon.schell
I want to use: pmic_secure_mpp_config_i_sink() which is defined in kernel/arch/arm/ mach-msm/pmic.c It should be faster as there would be less overhead. If it's not fast enough, then I would just move most of the code down to the AMSS side and create my own RPC call that would just pass the data

[android-porting] Re: Interfacing native code to hardware functions

2010-11-24 Thread jon.schell
Yes, I have the right coupling from the app to the native code. Yes, I found out about using the sysfs entry. The problem is that interface is too slow. I believe that I need to send an RPC call directly to the hardware layer, and that interface is already defined, but I can't figure out how to

[android-porting] Re: Interfacing native code to hardware functions

2010-11-24 Thread Chris Stratton
Can you post the definition of the interface you want to talk to? Do you have any actual evidence that using this other interface will be faster? (Often the way to speed things up when the interface itself is slow is to hand off larger units of work at a time) On Nov 24, 2:10 pm, jon.schell

[android-porting] Re: Interfacing native code to hardware functions

2010-11-23 Thread Mikkel Christensen
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

[android-porting] Re: Interfacing native code to hardware functions

2010-11-23 Thread Chris Stratton
On Nov 23, 5:33 am, Mikkel Christensen mikkel.christen...@ixonos.com 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