I am using MPU-9250 Invensense sensor and have taken its driver from android kernel and integrated with linux kernel. The driver is working fine with some modifications to the kernel and node, /dev/iio:\device0, and files under sys file system are also generated. So I assume that the driver is working fine.
Now I want to read the sensor data from the user space with an application using /dev/iio:\device0 node. For that I need to open read close functionalities in the MPU-9250 driver. But no file operations are available in the driver.
I have tried to read data from sys file system i.e,
# echo 1 > /sys/bus/iio/devices/iio:device0/power_state
# echo 1 > /sys/bus/iio/devices/iio:device0/accel_enable
# echo 100 > /sys/bus/iio/devices/iio:device0/buffer/length
# echo 1 > /sys/bus/iio/devices/iio:device0/buffer/enable
After this it should populate data read from the sensor. But nothing is getting displayed. So after this I tried read the data from dev filesystem
# cat /dev/iio:\device0
even then nothing got displayed.
Please can someone tell me how to read the data.
Regards