Hi

On 30.01.2014 10:37, Binyamin wrote:
> Thanks a lot, Thomas, for your feedback!
> 
> Did you meant:
> http://dxr.mozilla.org/mozilla-central/source/hal/gonk/GonkSensor.cpp
> http://dxr.mozilla.org/mozilla-central/source/dom/system/nsDeviceSensors.cpp
> http://dxr.mozilla.org/mozilla-central/source/dom/webidl/

Exactly.

> Where I can find whole list of Android supported sensors?

Have a look at


https://android.googlesource.com/platform/hardware/libhardware/+/master/include/hardware/sensors.h

or hardware/libhardware/include/hardware/sensors.h in the B2G directory.
There are several constants starting with SENSOR_TYPE_ that list
supported sensors. Of course you also need to check that your phone
actually supports the sensor.

> If my sensor is not supported on Android, how "to write an poll loop for the 
> sensor", any example?

Again you'll need a driver for your phone. And if you look into
GonkSensor.cpp, you'll find how it starts a new thread that runs the
function PollSensors, which reads Android sensors and prepares them for
further processing. You could add a new thread that does the same for
your sensor.

Best regards
Thomas

> _______________________________________________
> dev-b2g mailing list
> [email protected]
> https://lists.mozilla.org/listinfo/dev-b2g
> 

_______________________________________________
dev-b2g mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-b2g

Reply via email to