commit | dd8f9e7cffcf690386e492a3838d3424c3dd1bf4 | [log] [tgz] |
---|---|---|
author | Gwendal Grignou <gwendal@chromium.org> | Fri Sep 15 19:56:42 2023 |
committer | Copybara-Service <copybara-worker@google.com> | Wed Sep 27 11:19:16 2023 |
tree | 591863aa983d36eb84da3c605963a6f121998f26 | |
parent | 0977a8659d8ebcb15ac35cd7cc9a41119e7d5819 [diff] |
libmems: Remove test library from rootfs image /usr/lib64/libmems_test_support.so is only needed for unit test. Make sure it is compiled only when USE test flag is set. BUG=b:285404429 TEST=CQ - check build-package with and without `FEATURES=test` Cq-Depend: chromium:4869217 Change-Id: I11ddd603659f7522ed39c27bae61063780e60be5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/4869135 Auto-Submit: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Gwendal Grignou <gwendal@chromium.org> Reviewed-by: Harvey Yang <chenghaoyang@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> NOKEYCHECK=True GitOrigin-RevId: 69b7ce5f52f90c3e0dd3f60f2761285537890363
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.