Re: Request to have generic sensor support

Davidoaia, Bogdan M <bogdan.m.davidoaia@...>

Hello Kasim,

The sensor types from sensor.h are in no way final, and new types can be
added as the need arises for new drivers.

Not sure if your driver could define a more specific type (that may be
useful for other future drivers) rather then a generic one, but a
generic data type can be easily added.

For sending generic data to the driver, you can add a
type and a void *user_data field in the union from struct sensor_value.

Sending generic data back to the application can be done by adding a
SENSOR_CHAN_USER_DATA channel (together with the generic sensor value
type and filed).

Best regards,

On Jo, 2016-09-01 at 14:19 +0000, kasim shibi wrote:

Hi All,

I happened to work on a sensor
driver in zephyr 1.4. The
"sensor.h" provides support for
very few sensors.
Moreover lack of support for any
custom/generic data to pass between
the application and driver.
Please correct me if i am wrong.

I am looking for an option to pass
an array (1024 bytes), where the
internal data format i can
define/manage between my driver and

If at all , only choice is to add
as a new sensor. Please share the
steps for the zephyr team to add
support for a new sensor.


Join to automatically receive all group messages.