commit | 02eae65fca3e59dba406dcd8e41a883f1557ec4b | [log] [tgz] |
---|---|---|
author | Harvey Yang <chenghaoyang@chromium.org> | Wed Dec 08 03:05:56 2021 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Mar 22 14:27:08 2022 |
tree | 41f71be015aabb82c9cc3180606b5aced4946f8e | |
parent | e0ceaaed23141e95a5ae0710b1f123fc0a4132b3 [diff] |
libmems: Add iio event support Adds iio event support in libmems with fake classes. BUG=b:176431550 TEST=none Change-Id: I72d3a0e44b6d719996d8ea680b4739318481e9ac Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/3322433 Tested-by: Cheng-Hao Yang <chenghaoyang@chromium.org> Auto-Submit: Cheng-Hao Yang <chenghaoyang@chromium.org> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Cheng-Hao Yang <chenghaoyang@chromium.org> NOKEYCHECK=True GitOrigin-RevId: 8f2b3ecab9bacc26ac3d0b0a19f07ddd8ae67337
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.