1/*
2 * Copyright (C) 2017 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17package android.frameworks.sensorservice@1.0;
18
19/**
20 * An IEventQueue is an interface to manage an event queue created by
21 * ISensorManager.
22 */
23interface IEventQueue {
24    /**
25     * Enable the selected sensor with a specified sampling period and
26     * max batch report latency. If enableSensor is called multiple times on the
27     * same sensor, the previous calls must be overridden by the last call.
28     *
29     * @param  sensorHandle the sensor to enable. Must be a sensor acquired from
30     *                      the ISensorManager that creates this IEventQueue.
31     * @param  samplingPeriodUs
32     *                      sampling period in microseconds.
33     * @param  maxBatchReportLatencyUs
34     *                      max batch report latency in microseconds.
35     * @return result       OK if successful, or
36     *                      PERMISSION_DENIED, BAD_VALUE, INVALID_OPERATION,
37     *                      NO_INIT for errors.
38     */
39    enableSensor(int32_t sensorHandle,
40                 int32_t samplingPeriodUs,
41                 int64_t maxBatchReportLatencyUs)
42      generates (Result result);
43
44    /**
45     * Disable the selected sensor.
46     *
47     * @param  sensorHandle the sensor to disable. Must be a sensor acquired from
48     *                      the ISensorManager that creates this IEventQueue.
49     * @return result       OK if successful,
50     *                      BAD_VALUE or NO_INIT for errors.
51     */
52    disableSensor(int32_t sensorHandle) generates (Result result);
53};
54