This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

A question about sensor adding to android2.3

HI:

I got the android source code from git://gitorious.org/rowboat/manifest.git -m rowboat-gingerbread-dsp.xml, and it can be made succefully.

I want to add bma250 sensor to the android 2.3. I test the linux driver of bma250, which works very well. 

Then I turn into the HAL. I put the android.mk and sensors.cpp into the rowboat-android/hardware/ti/omap3/libsensors, then make the project.

it is the message when making

...

target thumb C++: sensors.default <= hardware/ti/omap3/libsensors/sensors.cpp
hardware/ti/omap3/libsensors/sensors.cpp: In function 'int sensor_get_class_path(sensors_poll_context_t*)':
hardware/ti/omap3/libsensors/sensors.cpp:169: warning: deprecated conversion from string constant to 'char*'
target SharedLib: sensors.default (out/target/product/omap3evm/obj/SHARED_LIBRARIES/sensors.default_intermediates/LINKED/sensors.default.so)
target Non-prelinked: sensors.default (out/target/product/omap3evm/symbols/system/lib/hw/sensors.default.so)
target Strip: sensors.default (out/target/product/omap3evm/obj/lib/sensors.default.so)

...

Instead of rowboat-android/out/target/product/omap3evm/system/lib/hw , I find the sensors.default.so in the rowboat-android/out/target/product/omap3evm/symbols/system/lib/hw.

I manually move sensors.default.so form ../symbols/system/lib/hw to ../system/lib/hw, everytime I use the bam250,

I should input commond

cd sys/class/input/input3

echo 1 > enable 

otherwise i can't use it.


what should I do ?

  • You need to adapt the generic sensor HAL for your specific device.

    You can refer to our porting guide for information about how we have customized libsensors on our supported devices like AM335x EVM. http://processors.wiki.ti.com/index.php/TI-Android-ICS-PortingGuide#Sensors

  • HI:

    There is another question. 

    In the android source codethere is " /system/core/rootdir/ueventd.rc ", in the tail of the file, there is 

    # sysfs properties
    /sys/devices/virtual/input/input* enable 0666 root input
    /sys/devices/virtual/input/input* poll_delay 0660 root input

    but when I start the android system, I came into "sys/class/input/input3" where the bma250 node is ,

    # ls -l
    -rw-r--r-- root root 4096 2000-01-01 00:00 uevent
    lrwxrwxrwx root root 2000-01-01 00:01 subsystem -> ../../../../class/input
    -r--r--r-- root root 4096 2000-01-01 00:00 name
    -r--r--r-- root root 4096 2000-01-01 00:01 phys
    -r--r--r-- root root 4096 2000-01-01 00:01 uniq
    -r--r--r-- root root 4096 2000-01-01 00:01 modalias
    drwxr-xr-x root root 2000-01-01 00:00 id
    drwxr-xr-x root root 2000-01-01 00:00 capabilities
    drwxr-xr-x root root 2000-01-01 00:00 power
    drwxr-xr-x root root 2000-01-01 00:00 event3
    -rw-rw-rw- root root 4096 2000-01-01 00:01 range
    -rw-rw-rw- root root 4096 2000-01-01 00:01 bandwidth
    -rw-rw-rw- root root 4096 2000-01-01 00:01 mode
    -r--r--r-- root root 4096 2000-01-01 00:01 value
    -rw-rw-rw- root root 4096 2000-01-01 00:00 delay
    -rw-rw---- root root 4096 2000-01-01 00:00 enable

    It is diffrent from settings in the ueventd.rc. 

    what's the matter ?