On Mon, Nov 14, 2011 at 11:51 AM, sarika baby <sarikababy...@gmail.com>wrote:

> Hello,
>     I read your blog
> http://thecodeartist.blogspot.com/search/label/Sensors it was quite
> interesting.Actually i am trying to integrate orientation sensors at HAL
> and i am not able to implement it properly.Can you kindly help me.
>
> --
> Regards
> SarikA
>
>
Hi Sarika,

The log "couldn't load sensors module" is logged from

android/frameworks/base/services/sensorservice/SensorDevice.cpp

    status_t err = hw_get_module(SENSORS_HARDWARE_MODULE_ID,
 (hw_module_t const**)&mSensorModule);    LOGE_IF(err, "couldn't load
%s module (%s)",            SENSORS_HARDWARE_MODULE_ID,
strerror(-err));


hw_get_module() is implemented in android/hardware/libhardware/hardware.c

You might want to look into the code and log a few more variables to see
why it is failing in ur case.

The most common reason would be a missing/improperly-named sensors lib in
/system/lib/hw/ on your device.

hw_get_module() expects the sensors-lib to be named as one of the following:

static const char *variant_keys[] = {    "ro.hardware",  /* This goes
first so that it can pick up a different                       file on
the emulator. */    "ro.product.board",    "ro.board.platform",
"ro.arch"};


This is done in the Android.mk file in libsensors directory. For example to
name the sensors lib specific to the board.platform, the following line
goes into Android.mk:

LOCAL_MODULE := sensors.$(*TARGET_BOARD_PLATFORM*)


Finally the file sensors.*.so must be present in /system/lib/hw on the
device.


GoodLUCK!
- CVS

-- 
unsubscribe: android-porting+unsubscr...@googlegroups.com
website: http://groups.google.com/group/android-porting

Reply via email to