commit | 7acd55c547ac1d9b3ddac7c08fcb074cfb4bdbeb | [log] [tgz] |
---|---|---|
author | Harvey Yang <chenghaoyang@google.com> | Mon Jun 06 05:24:28 2022 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Jun 07 16:58:42 2022 |
tree | 6ed97df8defff98402f77ccced581e5862729960 | |
parent | 139f606e63295aaf5b7734c901bc92bacb3ccf02 [diff] |
Add libmems::IioDevice::GetAbsoluteSysPath Move GetAbsoluteSysPath from iioservice to libmems, so that mems_setup can utilize the function as well. BUG=b:176431550 TEST=unit tests Change-Id: Icfb9ed3ff6ee0d81b5c50b602d51a98a026bc71e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform2/+/3689004 Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Commit-Queue: Cheng-Hao Yang <chenghaoyang@chromium.org> Tested-by: Cheng-Hao Yang <chenghaoyang@chromium.org> Auto-Submit: Cheng-Hao Yang <chenghaoyang@chromium.org> NOKEYCHECK=True GitOrigin-RevId: 7c759b9fe85f4a7f989b64478e0fbfdf895e7827
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.