• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2022 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 USB_SRV_SUPPORT_H
17 
18 #include <string>
19 
20 namespace OHOS {
21 namespace USB {
22 struct UsbSrvSupport {
23     static constexpr std::string_view CONNECTED {"connected"};
24     static constexpr std::string_view FUNCTION_NAME_NONE {"none"};
25     static constexpr std::string_view FUNCTION_NAME_HDC {"hdc"};
26     static constexpr std::string_view FUNCTION_NAME_ACM {"acm"};
27     static constexpr std::string_view FUNCTION_NAME_ECM {"ecm"};
28     static constexpr std::string_view FUNCTION_NAME_MTP {"mtp"};
29     static constexpr std::string_view FUNCTION_NAME_PTP {"ptp"};
30     static constexpr std::string_view FUNCTION_NAME_RNDIS {"rndis"};
31     static constexpr std::string_view FUNCTION_NAME_STORAGE {"storage"};
32     enum PowerRole : int32_t {
33         POWER_ROLE_NONE,
34         POWER_ROLE_SOURCE,
35         POWER_ROLE_SINK,
36     };
37 
38     enum DataRole : int32_t {
39         DTA_ROLE_NONE,
40         DATA_ROLE_HOST,
41         DATA_ROLE_DEVICE,
42     };
43 
44     enum PortMode : int32_t {
45         PORT_MODE_NONE,
46         PORT_MODE_DEVICE,
47         PORT_MODE_HOST,
48     };
49 
50     enum Function : uint32_t {
51         FUNCTION_NONE = 0,
52         FUNCTION_ACM = 1,
53         FUNCTION_ECM = 1 << 1,
54         FUNCTION_HDC = 1 << 2,
55         FUNCTION_MTP = 1 << 3,
56         FUNCTION_PTP = 1 << 4,
57         FUNCTION_RNDIS = 1 << 5,
58         FUNCTION_STORAGE = 1 << 9,
59     };
60 };
61 } // namespace USB
62 } // namespace OHOS
63 
64 #define USB_SRV_SUPPORT_H
65 #endif // USB_SRV_SUPPORT_H