Hi,
I have 2 imx boards, MCIMX6Q-SDB and MCIMX8M-EVK.
I developed Android App.(SensorList.apk) to get a sensor list from these boards.
I can get the list from MCIMX6Q-SDB board, but NOT MCIMX8M-EVK.board.
1. MCIMX6Q-SDB
My "SensorList" App. shows following information.
-----------------------------------------------------------------------------------------------------
Number of Sensors: 5
Freescale 3-axis Accelerometer
Type: TYPE_ACCELEROMETER
Vendor: Freescale Semiconductor Inc.
Version: 1
Resolution: 5.985504E-4
MaxumumRange: 1500.0
Power: 0.3
...
-----------------------------------------------------------------------------------------------------
This information is same as that of sSensorList structure in sensors.cpp file.
This file is in $(MY_ANDROID)/vendor/nxp-opensource/imx/libsensors directory.
static const struct sensor_t sSensorList[] = {
{
.name = "Freescale 3-axis Accelerometer",
.vendor = "Freescale Semiconductor Inc.",
.version= 1,
.handle = SENSORS_ACCELERATION_HANDLE,
.type = SENSOR_TYPE_ACCELEROMETER,
.maxRange = RANGE_A,
.resolution = CONVERT_A,
.power = 0.30f,
.minDelay = 2500,
.fifoReservedEventCount = 0,
.fifoMaxEventCount = 32,
.stringType = SENSOR_STRING_TYPE_ACCELEROMETER,
.requiredPermission = 0,
.maxDelay = 640000,
.flags = SENSOR_FLAG_CONTINUOUS_MODE,
.reserved = {}
},
...
...
...
2. MCIMX8M-EVK
My "SensorList" App. shows no sensor information as follows.
-----------------------------------------------------------------------------------------------------
Number of Sensors: 0
-----------------------------------------------------------------------------------------------------
But sensors.cpp in
$(MY_ANDROID)/vendor/nxp-opensource/imx/libsensors_sensorhub directory
has following sensor information.
static const struct sensor_t sSensorList[] = {
{
.name = "Freescale Sensor Hub Accelerometer",
.vendor = "Freescale Semiconductor Inc.",
.version= 1,
.handle = SENSORS_ACCELERATION_HANDLE,
.type = SENSOR_TYPE_ACCELEROMETER,
.maxRange = RANGE_A,
.resolution = CONVERT_A,
.power = 0.30f,
.minDelay = 2500,
.fifoReservedEventCount = 0,
.fifoMaxEventCount = 0,
.stringType = SENSOR_STRING_TYPE_ACCELEROMETER,
.requiredPermission = 0,
.maxDelay = 640000,
.flags = SENSOR_FLAG_CONTINUOUS_MODE,
.reserved = {}
},
...
...
...
How can I get the sensor list (in sensors.cpp) in MCIMX8M-EVK development environment?
MCIMX6Q-SDB board has real H/W sensors, but MCIMX8M-EVK board does not.
I think that the absence of real sensors has no effect on getting the sensor list.
Is it correct?
Pleas help me to fix this problem.
Thanks in advance.
Hi james,
There is no sensor supported on i.MX8M-EVK, It means that there is no any sensors hardware related to libsensor. So you couldn't get corresponding list.
Have a nice day!
TIC weidong sun
Hi weidong,
Thanks for your response.
I think that my question was not clear.
Anyway, one more question.
I wrote a simple linux kernel driver which simply emulate some accelerometer functions.
(such as 'enable', 'power', 'report input event', ...)
And linux kernel log shows this driver is successfully probed as following.
-----------------------------------------------------------------------------------------------------------------
[ 2.396065] input: FreescaleGyroscope as /devices/virtual/input/input0
[ 2.402876] fxas2100x device driver probe successfully
-----------------------------------------------------------------------------------------------------------------
device node created
crw------- 1 root root 10, 61 1970-01-01 00:00 /dev/FreescaleGyroscope
also sysfs is created
/sys/class/misc/FreescaleGyroscope
/sys/class/misc/FreescaleGyroscope/uevent shows
MAJOR=10
MINOR=61
DEVNAME=FreescaleGyroscope
In this situation,
How can I get a list of the sensors in Android Sensor Framework?
(My SensorList App. just called the 'getSensorList' functions)
I'm not experienced in such things,
Please give me some tips for registering new sensors into given iMX8 board which has no sensors.
Thanks very much.