Sensor Notifier API¶
-
int
sensor_register_notifier
(struct sensor *sensor, struct sensor_notifier *notifier)¶ Register a sensor notifier.
This allows a calling application to receive callbacks any time a requested event is observed.
- Return
0 on success, non-zero error code on failure.
- Parameters
sensor
: The sensor to register the notifier onnotifier
: The notifier to register
-
int
sensor_unregister_notifier
(struct sensor *sensor, struct sensor_notifier *notifier)¶ Un-register a sensor notifier.
This allows a calling application to stop receiving callbacks for events on the sensor object.
- Return
0 on success, non-zero error code on failure.
- Parameters
sensor
: The sensor object to un-register the notifier onnotifier
: The notifier to remove from the notification list