[−][src]Function mynewt::hw::sensor::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.
compare_func
: The comparison function to use against sensors in the list.arg
: The argument to provide to that comparison functionprev_cursor
: The previous sensor in the sensor manager list, in case of iteration. If desire is to find first matching sensor, provide a NULL value.
Return: A pointer to the first sensor found from prev_cursor, or NULL, if none found.