New IIO C-API to read configuration attributes #2117
Comments
May I know when is the target date for v2? |
no dates set in stone, but we're looking into 2-3 months maximum. |
@laykuanloon @fulong82 could you share more information about which configuration items are needed for the reading/modifying? |
Hi @yongli3, Sorry for the late response. Here are the list that we would like to have a read API that can be used in sensor application:
@laykuanloon do you have any interfaces want to add on? Thanks & Regards, |
@fulong82 which sensor has the "hysteresis" ? |
Hi @yongli3, All of the IIO-HID sensors would have "hysteresis" attributes:
Regards, |
Just like the sol_iio_mount_calibration API, we can add a new one as below: The API will query the device configuration, and save them into config struct iio_device_config { @fulong82 @laykuanloon @edersondisouza @ceolin any comment/suggestion ? |
I suppose we should have 2 different APIs to get parameter: In nodes.c level: we should check two key parameter from fbp include what config parameter(offset, scale, ...) and what kind of sensor type (different type has different config data type) In sol-iio API level:
@fulong82 @laykuanloon @edersondisouza @ceolin @yongli3 any comment/suggestion ? |
For considering the return of error code , the improvement for API design is :
|
@guchaojie in_accel_scale_available |
For get sensor config available config , I suggest two APIs:
@fulong82 @laykuanloon @edersondisouza @ceolin @yongli3 any comment/suggestion ? |
@guchaojie |
@laykuanloon If do so, when to release the memory in API internal function? |
@guchaojie |
I think memory allocation/free is not the key issue, though it's better to be released by assigner itself. Actually the problem is, usually user does not know how may values can be supported for that configuration, so it's difficult to predict the size of the list. A query-response mechanism could be helpful to get the actual size here. |
For Summary, we finally define 4 APIs for two categories:
@fulong82 @laykuanloon @edersondisouza @ceolin @yongli3 @peijiajames |
@guchaojie |
Hi everyone, I'd say that |
Hi everyone,
1 parameter "config_name" generally would be prefix name such as "in_anglvel_x" or "in_anglvel_y"... 2 In existing Soletta sol-iio design, we found configuration has been classified to two structure: sol_iio_config and sol_iio_channel_config. So I think new C-API should be like this, 1st version would be include 3 APIs , and would be easy to add more configuration reading API in future. And we have to pay attention to sampling_frequency and offset data types should be "double", however, in sol-iio library these two configuration attribute data type is "int". This inconformity will result into imprecise attribute reading.
@fulong82 @laykuanloon @edersondisouza @ceolin @yongli3 @peijiajames |
It was merged. Closing it. |
Task Description
The existing IIO C API does not allow the users to read out the existing configuration. The API only support reading out the sensor raw data or processed data.
Need new API be introduced to allow users to read and modify the attributes of IIO devices.
The text was updated successfully, but these errors were encountered: