[][src]Function mynewt::hw::sensor::sensor_register_err_func

pub unsafe extern "C" fn sensor_register_err_func(
    sensor: *mut sensor,
    err_fn: sensor_error_func_t,
    arg: *mut c_void
) -> c_int

Register a sensor error callback. The callback is executed when the sensor manager fails to read from the given sensor.

  • sensor: The sensor to register an error callback on.
  • err_fn: The function to execute when a read fails.
  • arg: Optional argument to pass to the callback.

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