-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
I've spent some time playing with the new sensor framework, and I'm much less skeptical about this approach (previous discussion here #10077). It seems to me that with some changes, it can be a good universal solution. Unfortunately, the lack of documentation causes some misunderstanding. Most information about framework can be found in the discussion under #2039 and #2215. Somehow I missed this before :)
Some ideas for improvement from my side:
-
We should stop referring to this sensor framework as
uorb.uorbis optional and is part of the apps. Referring touorbon the kernel side gives the false impression that uorb is required. -
Make sensor register path configurable. Now it is
/dev/uorb(changed in c4bed9e) but asuorbis application-specific property, this should be configurable. -
Add options to disable some framework functionality. This can save memory on small systems. For example, disabling polling logic and relying only on the
fetchinterface saves some space and gives the user full control over sensor sampling. Another thing istimestamp; in many cases, timestamp doesn't matter for user. -
The biggest problem I see now is forcing the user to use
float. This is not the best solution for applications without FPU (e.g. CM0 which are often used in sensor nodes). What if we made the sensor data type configurable? It would be nice if we had an interface that return data in RAW format, but this may unnecessarily complicate the framework. Support for fixedmath type seems to be a good compromise (b16_t?).
If there is consent to these changes, I can take care of them.