• 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     static constexpr std::string_view FUNCTION_NAME_NCM {"ncm"};
33     enum PowerRole : int32_t {
34         POWER_ROLE_NONE,
35         POWER_ROLE_SOURCE,
36         POWER_ROLE_SINK,
37     };
38 
39     enum DataRole : int32_t {
40         DTA_ROLE_NONE,
41         DATA_ROLE_HOST,
42         DATA_ROLE_DEVICE,
43     };
44 
45     enum PortMode : int32_t {
46         PORT_MODE_NONE,
47         PORT_MODE_DEVICE,
48         PORT_MODE_HOST,
49     };
50 
51     enum Function : uint32_t {
52         FUNCTION_NONE = 0,
53         FUNCTION_ACM = 1,
54         FUNCTION_ECM = 1 << 1,
55         FUNCTION_HDC = 1 << 2,
56         FUNCTION_MTP = 1 << 3,
57         FUNCTION_PTP = 1 << 4,
58         FUNCTION_RNDIS = 1 << 5,
59         FUNCTION_NCM = 1 << 8,
60         FUNCTION_STORAGE = 1 << 9,
61     };
62 };
63 } // namespace USB
64 } // namespace OHOS
65 
66 #define USB_SRV_SUPPORT_H
67 #endif // USB_SRV_SUPPORT_H