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.

Parameters:
  • sensor – The sensor to register the notifier on

  • notifier – The notifier to register

Returns:

0 on success, non-zero error code on failure.

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.

Parameters:
  • sensor – The sensor object to un-register the notifier on

  • notifier – The notifier to remove from the notification list

Returns:

0 on success, non-zero error code on failure.