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