# [−][src]Function mynewt::hw::sensor::bindings::sensor_read

    pub unsafe extern "C" fn sensor_read(
        sensor: *mut sensor,
        type_: sensor_type_t,
        data_func: sensor_data_func_t,
        arg: *mut c_void,
        timeout: u32
    ) -> c_int

Read the data for sensor type "type," from the given sensor and return the result into the "value" parameter.

- `sensor`: The sensor to read data from
- `type`: The type of sensor data to read from the sensor
- `data_func`: The callback to call for data returned from that sensor
- `arg`: The argument to pass to this callback.
- `timeout`: Timeout before aborting sensor read

Return: 0 on success, non-zero 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`)