solettaproject / soletta

Soletta Project is a framework for making IoT devices. With Soletta Project's libraries developers can easily write software for devices that control actuators/sensors and communicate using standard technologies. It enables adding smartness even on the smallest edge devices.
http://solettaproject.org
Apache License 2.0
225 stars 108 forks source link

channel_get_pure_name needs to remove _blue/_green/_red prefix #2345

Open yongli3 opened 8 years ago

yongli3 commented 8 years ago

root@intel-corei7-64:/sys/bus/iio/devices/iio:device0# ls -l drwxr-xr-x 2 root root 0 Oct 28 00:47 buffer -r--r--r-- 1 root root 4096 Oct 28 00:47 dev drwxr-xr-x 2 root root 0 Oct 28 00:47 events -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_intensity_blue_raw -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_intensity_clear_raw -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_intensity_green_raw -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_intensity_integration_time -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_intensity_red_raw -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_intensity_scale -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_proximity_raw -rw-r--r-- 1 root root 4096 Oct 28 00:47 in_proximity_scale -r--r--r-- 1 root root 4096 Oct 28 00:47 integration_time_available -r--r--r-- 1 root root 4096 Oct 28 00:47 intensity_scale_available -r--r--r-- 1 root root 4096 Oct 27 06:50 name drwxr-xr-x 2 root root 0 Oct 28 00:47 power -r--r--r-- 1 root root 4096 Oct 28 00:47 proximity_scale_available drwxr-xr-x 2 root root 0 Oct 28 00:47 scan_elements lrwxrwxrwx 1 root root 0 Oct 28 00:47 subsystem -> ../../../../../../bus/iio -rw-r--r-- 1 root root 4096 Oct 27 06:49 uevent root@intel-corei7-64:/sys/bus/iio/devices/iio:device0# cat name apds9960

DBG: ./src/lib/io/sol-iio.c:165 craft_filename_path() available=4096, used=55, path='/sys/bus/iio/devices/iio:device0/in_intensity_red_scale' DBG: ./src/lib/io/sol-iio.c:165 craft_filename_path() available=4096, used=45, path='/sys/bus/iio/devices/iio:device0/(null)_scale' INF: ./src/lib/io/sol-iio.c:1091 channel_get_scale() Could not get scale for channel [in_intensity_red] in device0. Assuming 1.0