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

IIO node by default assume the IIO driver has buffer implemention and give warning message #2044

Closed lblim closed 8 years ago

lblim commented 8 years ago

Issue Description

IIO node by default assume the IIO driver has buffer implemented, but not all IIO drivers have buffer implementation, therefore the lookup for buffer entry in sysfs may return warning at user space and also need to have buffer_size entry as -1 in the JSON file.

} else {
    /* buffer_size == -1 means that user doesn't want to use the buffer */
    device->buffer_enabled = false;
    if (!set_buffer_enabled(device, false)) {
        SOL_WRN("Could not disable buffer for device%d", device->device_id);
    }
}

Steps to reproduce

  1. Create FBP for IIO node without buffer implementation, for example BMP280, AK09911
  2. Run FBP with sol-flow-runner
  3. look for message at console

    Board information

Host OS and architecture: Ubuntu 14.04.4 LTS

Target OS and platform: Linux 4.1 APL-i

barbieri commented 8 years ago

@yongli3 can you look into this? otherwise let @edersondisouza know

yongli3 commented 8 years ago

@edersondisouza I submitted a PR for this issue. For such "no-buffer" devices(BH1750 light sensor), If enable buffer reading in fbp files(buffer_size > -1), Soletta will output warning message and quit, and does not call the buffer disable API since there is no buffer/enable file

edersondisouza commented 8 years ago

@lblim This issue should've been addressed, can you confirm it, please?

lblim commented 8 years ago

@fulong82 will confirm this fix once the build issue is resolved

fulong82 commented 8 years ago

I have verified the latest code and no more warning message appear if the iio sensor does not have buffer expose.

edersondisouza commented 8 years ago

@fulong82 Thanks, closing issue then.