Attend XDA's Second Annual Developer Conference, XDA:DevCon 2014!
5,740,667 Members 49,451 Now Online
XDA Developers Android and Mobile Development Forum

[HELP] writting to sensors sysfs

Tip us?
 
elesbb
Old
#21  
elesbb's Avatar
Senior Member
Thanks Meter 4256
Posts: 6,660
Join Date: Jun 2010

 
DONATE TO ME
Yes i saw that code already. And what i am making sense of it is that based off what the app request "SENSOR_DELAY_FASTEST" or "SENSOR_DELAY_DEFAULT" is how it changes the time.
 
frapeti
Old
(Last edited by frapeti; 10th April 2014 at 11:24 PM.)
#22  
frapeti's Avatar
Recognized Developer - OP
Thanks Meter 2328
Posts: 787
Join Date: Mar 2012
Location: Cordoba, Argentina

 
DONATE TO ME
what I found so far:

echoing numbers: $? = 0 (normal exit value)

echoing letters: $? = 1 (error exit value)


dmesg while samsung service writes to it:

Quote:
[12503.835235] [SSP]: show_sensors_enable - cur_enable = 3
<6>[12503.835387] [SSP]: set_sensors_enable - new_enable = 19, old_enable = 3
<6>[12503.835601] [SSP]: change_sensor_delay - add 16, New = 200000000ns
<6>[12503.839080] [SSP]: send_instruction - Inst = 0xa1, Sensor Type = 0x4, data = 3
<6>[12503.839446] [SSP]: change_sensor_delay - Change 16, New = 10000000ns
<6>[12503.845886] [SSP]: MSG From MCU - GEO
 
elesbb
Old
#23  
elesbb's Avatar
Senior Member
Thanks Meter 4256
Posts: 6,660
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by frapeti View Post
what I found so far:

echoing numbers: $? = 0 (normal exit value)

echoing letters: $? = 1 (error exit value)


dmesg while samsung service writes to it:
Anything that comes up in a dmesg is the kernel writing to it. So I don't think you'll be able to write to it unless you mod the kernel somehow

Sent from my SGH-M919 using Tapatalk
 
frapeti
Old
#24  
frapeti's Avatar
Recognized Developer - OP
Thanks Meter 2328
Posts: 787
Join Date: Mar 2012
Location: Cordoba, Argentina

 
DONATE TO ME
Quote:
Originally Posted by elesbb View Post
Anything that comes up in a dmesg is the kernel writing to it. So I don't think you'll be able to write to it unless you mod the kernel somehow

Sent from my SGH-M919 using Tapatalk
Of course kernel manage it but that's why sysfs exists, to communicate between userspace and kernel

Enviado desde mi GT-I9505 mediante Tapatalk
 
elesbb
Old
#25  
elesbb's Avatar
Senior Member
Thanks Meter 4256
Posts: 6,660
Join Date: Jun 2010

 
DONATE TO ME
Quote:
Originally Posted by frapeti View Post
Of course kernel manage it but that's why sysfs exists, to communicate between userspace and kernel

Enviado desde mi GT-I9505 mediante Tapatalk
Your best bet would be to do what Broodplank recommended. Write a c lib file, include it in your assets folder then using root copy it to the system/bin directory then use a Runtime in your app to execute the file. I know sysfs allows you to communicate but sometimes certain files cannot be accessed because they are not really a file but an object.
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

Play Your Hits and Learn the Lyrics with NextGen Music Player

There are plenty of music players for Android available in Play Store. They … more

Control Your Toast Notifications with SlicedToasts

Toasts are delicious, even in their Android flavor. In Android, toast doesn’t lead … more

Rotation Lets You Take Full Control of Your Device’s Orientation Settings

To be brutally honest, the native options for screen … more

Change the Alarm Icon in the Status Bar with Xposed

It’s hard to find a more hated object than your alarm clock. They wake us up nearly … more