You can retrieve sensor status and configuration information on your target from /dev/sensor.
When the sensor service is running, you can query status and configuration information on each of the sensors that are in your sensor configuration file from /dev/sensor.
To query this information, use the cat command on the sensor unit you would like information on.
Do so by using the ls command on /dev/sensor. For example, you may see the following if your sensor configuration file included configuration for one camera sensor, two interim data sensors, and seven sensors:
# ls /dev/sensor camera1 data1 data2 sensor2 sensor3 sensor4 sensor5 sensor6 sensor7 sensor8Each sensor is listed in the format of sensor_typesensor_unit where sensor_type corresponds to the type of sensor (camera, data, or sensor), and sensor_unit corresponds to the enumerator as specified in the sensor configuration file. For example, an entry in the sensor configuration file of the following:
begin SENSOR_UNIT_1 type = usb_camera name = front position = 0, 0, 0 direction = 0, 0, 1 address = /dev/usb/io-usb-otg, -1, -1, -1, -1 end SENSOR_UNIT_1results in camera1 in your list when you use the ls command on /dev/sensor.
Entries in your interim data configuration file result in datainterim_data_unit. For example:
begin INTERIM_DATA_UNIT_1 num_buffers = 5 buffer_size = 65535 queue_depth = 5 data_format = SENSOR_FORMAT_USER_DATA data_id = 1 name = tracked_objects position = -25.2, 13.25, -7.278 direction = 128.9, -221, 17.98 end INTERIM_DATA_UNIT_1results in data1 in your list when you use the ls command on /dev/sensor.
# cat /dev/sensor/sensor2The output from this command depends on the state of the sensor. For example, if the sensor is not streaming any data, you may see this:
# cat /dev/sensor/sensor2 Stream Info: refCount 0 status 0 # underflows 0If the sensor is streaming data, you may see this:
# cat /dev/sensor/sensor2 Stream Info: refCount 1 status 27 # underflows 0 Stream State: size 5760 format 20 last time 12ac562326d adjust 0 Q Info: pid 6094875 key 0 r/w 0 q 0 held 0 # queued 503 # overflows 0 Pool Info: inUse 1 buf 852a000 phys 260704000 len 115200 refCount 1 Pool Info: inUse 0 buf 82cb000 phys 260fce000 len 115200 refCount 0 Pool Info: inUse 0 buf 82e8000 phys 260fb1000 len 115200 refCount 0