[HELP] writting to sensors sysfs

Search This thread

elesbb

Senior Member
Jun 20, 2010
7,883
5,324
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

Inactive Recognized Developer
Mar 23, 2012
1,048
4,224
Cordoba, Argentina
www.groupon.com.ar
what I found so far:

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

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


dmesg while samsung service writes to it:

[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
 
Last edited:

elesbb

Senior Member
Jun 20, 2010
7,883
5,324
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
 

elesbb

Senior Member
Jun 20, 2010
7,883
5,324
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.
 

Top Liked Posts