1/*
2 * Copyright (C) 2016 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@1.1;
18
19import android.hardware.usb@1.0;
20
21// NOTE: suffix '_1_1' is for legacy ABI compatibility. It cannot be
22// changed to 'PortMode' which the convention dictates.
23@export
24enum PortMode_1_1 : PortMode {
25    /*
26     * Indicates that the port supports Audio Accessory mode.
27     */
28    AUDIO_ACCESSORY = 1 << 2,
29
30    /*
31     * Indicates that the port supports Debug Accessory mode.
32     */
33    DEBUG_ACCESSORY = 1 << 3,
34
35    NUM_MODES_1_1 = 1 << 4,
36};
37
38/*
39 * Used as the container to report data back to the caller.
40 * Represents the current connection status of a single USB port.
41 */
42// NOTE: suffix '_1_1' is for legacy ABI compatibility. It cannot be
43// changed to 'PortStatus' which the convention dictates.
44struct PortStatus_1_1 {
45    /*
46     * The supportedModes and the currentMode fields of the status
47     * object should be set to NONE.
48     */
49    PortStatus status;
50
51    /*
52     * Identifies the modes supported by the port.
53     * Refer to PortMode_1_1 for the significance of the individual bits.
54     */
55    bitfield<PortMode_1_1> supportedModes;
56
57    /*
58     * Indicates the current mode in which the port is operating.
59     */
60    PortMode_1_1 currentMode;
61};
62