I am using a sensor file similar to the one @
http://dev.openaos.org/attachment/ticket/71/sensors.archos.c
I see that there are 2 calls to open the device.
1. open_input() which scan all input drivers and look for
“accelerometer”
2. open_akm() which tries to open() AKM_DEVICE_NAME (i.e. #define
AKM_DEVICE_NAME "/dev/accel_ctrl").
open_akm() is called at only one place as below followed by
akm_close() call,
control__activate()
{
[..]
fd = open_akm(dev);
mma_set_delay(fd, delay);
close_akm(dev);
[..]
}
So, I see the only purpose open_akm() is serving to retrieve FD to be
used for setting delay in mma_set_delay(). Am I missing anything
here ??
The file descriptor returned in the call open_input() is the one being
used by upper layers all the time. The android framework only polls
the input node (/dev/input/eventX) to get the sensor data.
Finally, I am confused as to what will happen if I don't use
open_akm() call at all. What exactly control__activate() is doing ?
How "/dev/accel_ctrl" and “dev/input/eventX” are different ?
White
On May 4, 3:45 pm, white <[email protected]> wrote:
> I am integrating Sensors ( Accelerometer + Direction Compass) into
> Froyo. I went through previous discussion and got a lot of information
> to build my libraries.
>
> Now, I have my libsensors.so but I don't have hardware to test. So, I
> have simulated to send data from my driver code without having actual
> hardware. I have not completely understood sensors.c file also which I
> used from htc sensor code.
>
> Driver posts event for ORIENTATION to the device file /dev/input/
> input0, It does not provide any other control as of now.
>
> Now, I am running my application but not seeing any update in
> orientation. So, debugging now..
>
> 1. How to ensure whether Sensor Service is included in the Android
> build?
> 2. Do I need to start Sensor service from init.rc? If yes, please
> specify the command to start the same?
> 3. Any environment settings or property settings need to be done on
> init.rc?
> 4. How does SensorManager knows it has to load libsensors.so library
> or any other library like that..it has to be mentioned somewhere
> right !!
>
> Thanks a lot
> White
--
unsubscribe: [email protected]
website: http://groups.google.com/group/android-porting