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.hardware.usb.gadget@1.0;
18
19import IUsbGadgetCallback;
20
21interface IUsbGadget {
22    /**
23     * This function is used to set the current USB gadget configuration.
24     * Usb gadget needs to teared down if an USB configuration is already
25     * active.
26     *
27     * @param functions list of functions defined by GadgetFunction to be
28     *                  included in the gadget composition.
29     * @param callback IUsbGadgetCallback::setCurrentUsbFunctionsCb used to
30     *                 propagate back the status.
31     * @param timeout The maximum time (in milliseconds) within which the
32     *                IUsbGadgetCallback needs to be returned.
33     */
34    oneway setCurrentUsbFunctions(bitfield<GadgetFunction> functions,
35                                  IUsbGadgetCallback callback,
36                                  uint64_t timeout);
37
38    /**
39     * This function is used to query the USB functions included in the
40     * current USB configuration.
41     *
42     * @param callback IUsbGadgetCallback::getCurrentUsbFunctionsCb used to
43     *                 propagate the current functions list.
44     */
45    oneway getCurrentUsbFunctions(IUsbGadgetCallback callback);
46
47};
48