[][src]Function mynewt::hw::sensor::bindings::sensor_mgr_find_next

pub unsafe extern "C" fn sensor_mgr_find_next(
    arg1: sensor_mgr_compare_func_t,
    arg2: *mut c_void,
    arg3: *mut sensor
) -> *mut sensor

The sensor manager contains a list of sensors, this function returns the next sensor in that list, for which compare_func() returns successful (one). If prev_cursor is provided, the function starts at that point in the sensor list.

@warn This function MUST be locked by sensor_mgr_lock/unlock() if the goal is to iterate through sensors (as opposed to just finding one.) As the "prev_cursor" may be resorted in the sensor list, in between calls.

Return: A pointer to the first sensor found from prev_cursor, or NULL, if none found.