| // Copyright 2020 The Chromium Authors. All rights reserved. |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| |
| module arc.mojom; |
| |
| enum AttributeIOResult { |
| SUCCESS = 0, |
| ERROR_CHANNEL_NOT_FOUND = 1, |
| ERROR_ATTRIBUTE_NOT_FOUND = 2, |
| ERROR_IO = 3, |
| }; |
| |
| // SensorService provides access to all sensor devices. |
| interface SensorService { |
| // Returns the list of device names. |
| GetDeviceNames@0() => (array<string> names); |
| |
| // Binds the request to the specified device. |
| GetDeviceByName@1(string name, SensorDevice& request); |
| }; |
| |
| // SensorDevice provides an interface to interact with a sensor device. |
| interface SensorDevice { |
| // Returns the value of the specified device attribute. |
| GetAttribute@0(string name) => (AttributeIOResult result, string value); |
| |
| // Sets the specified device attribute. |
| SetAttribute@1(string name, string value) => (AttributeIOResult result); |
| |
| // Opens the device buffer. |
| OpenBuffer@2() => (handle? fd); |
| }; |