• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2025 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef USBPORTINFO_H
17 #define USBPORTINFO_H
18 
19 namespace OHOS {
20 namespace HDI {
21 namespace Usb {
22 namespace Port {
23 
24 #define PORT_NONE "none"
25 #define SUPPORTED_MODE "drp"
26 
27 #define PORT_MODE_UFP "UFP"
28 #define PORT_MODE_DFP "DFP"
29 #define PORT_MODE_DRP "DRP"
30 
31 #define POWER_ROLE_SOURCE "source"
32 #define POWER_ROLE_SINK "sink"
33 
34 #define DATA_ROLE_HOST "host"
35 #define DATA_ROLE_DEVICE "device"
36 
37 enum class PortMode:int32_t {
38     NONE = 0,
39     UFP = 1,
40     DFP = 2,
41     DRP = 3,
42     NUM_MODES = 4
43 };
44 
45 enum class PowerRole:int32_t {
46     NONE = 0,
47     SOURCE = 1,
48     SINK = 2,
49     NUM_POWER_ROLES = 3
50 };
51 
52 enum class DataRole:int32_t {
53     NONE = 0,
54     HOST = 1,
55     DEVICE = 2,
56     NUM_DATA_ROLES = 3
57 };
58 } // namespace Port
59 } // namespace Usb
60 } // namespace HDI
61 } // namespace OHOS
62 #endif
63