commit | b16c9ce7ca70e9c9e366ef43e292208633c22cf4 | [log] [tgz] |
---|---|---|
author | Gwendal Grignou <[email protected]> | Fri Mar 28 04:01:05 2025 |
committer | Copybara-Service <[email protected]> | Fri Mar 28 19:12:28 2025 |
tree | 47c9d8a1ba175459aaf9f255c44f91df349864ab | |
parent | 1b3ce68eac58bb5993533f4502ca8a78ca974010 [diff] |
libmems: Fix limit ODR Fix initialization error that crash libmems in the iio_context constructor. Fix type. BUG=b:353354908,b:406277521 TEST=Unit test, Check `cros-health-tool diag sensitive_sensor_v2` on dewatt. Fixes: 0f9d0fd0a74 ("libmems: limit ODR") Change-Id: Id8e955a2bae0f6821bd08c9f48378e41aea3c30f Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/6405837 Reviewed-by: Byron Lee <[email protected]> Auto-Submit: Gwendal Grignou <[email protected]> Reviewed-by: Harvey Yang <[email protected]> Commit-Queue: ChromeOS Auto Retry <[email protected]> Tested-by: Gwendal Grignou <[email protected]> NOKEYCHECK=True GitOrigin-RevId: fb4d891064a33f4ce97aeb9af2f170af0bd15ef5
Project goal and motivation
This library provides a set of wrapper and test helpers around libiio.
It is meant to provide a common foundation for Chrome OS to access and interface IIO sensors, with:
At the root of the hierarchy, there exists the IioContext
, which represents the IIO devices currently available on the system. These can be retrieved by name and inspected, via instances of IioDevice
.
An IioDevice
allows reading and writing attributes of an IIO device via type-safe helper APIs. It also offers support for configuring the buffer and trigger of an IIO device, which we use in order to allow the Chrome UI to read accelerometer data and support screen rotation.
An IioDevice
also exposes a list of IioChannel
s, which can individually be enabled and disabled.
Useful mocks for the core classes are provided, such that a test author can focus on the logic of the unit tests and share a common testing language with other engineers working in this space. Sharing the foundation of testing IIO sensor access helps ensure that any improvement in this area can benefit all clients.