[−][src]Function mynewt::hw::sensor::register_listener
pub fn register_listener(
sensor: *mut sensor,
listener: sensor_listener
) -> MynewtResult<()>
Register a sensor listener. This allows a calling application to receive
callbacks for data from a given sensor object. This is the safe version of sensor_register_listener()
that copies the listener locally before passing to Mynewt.
For more information on the type of callbacks available, see the documentation
for the sensor listener structure.
sensor: The sensor to register a listener on.
listener: The listener to register onto the sensor.
Returns Ok() on success, Err() containing MynewtError error code on failure.