# [−][src]Type Definition mynewt::hw::sensor::bindings::sensor_read_func_t

    type sensor_read_func_t = Option<unsafe extern "C" fn(arg1: *mut sensor, arg2: sensor_type_t, arg3: sensor_data_func_t, arg4: *mut c_void, arg5: u32) -> c_int>;

Read a single value from a sensor, given a specific sensor type (e.g. SENSOR_TYPE_PROXIMITY).

- `sensor`: The sensor to read from
- `type`: The type(s) of sensor values to read. Mask containing that type, provide all, to get all values.
- `data_func`: The function to call with each value read. If NULL, it calls all sensor listeners associated with this function.
- `arg`: The argument to pass to the read callback.
- `timeout`: Timeout. If block until result, specify OS_TIMEOUT_NEVER, 0 returns immediately (no wait.)

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

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)