1 /* 2 * Copyright (c) 2021-2024 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_REPORT_SYS_EVENT_H 17 #define USB_REPORT_SYS_EVENT_H 18 19 #include <string> 20 #include "v1_0/usb_types.h" 21 #include "usb_interface.h" 22 #include "usb_device.h" 23 #include "usb_host_manager.h" 24 #include "usb_endpoint.h" 25 26 namespace OHOS { 27 namespace USB { 28 typedef std::map<std::string, UsbDevice *> MAP_STR_DEVICE; 29 class UsbReportSysEvent { 30 public: 31 static void ReportTransferFaultSysEvent(const std::string transferType, 32 const HDI::Usb::V1_0::UsbDev &tmpDev, const HDI::Usb::V1_0::UsbPipe &tmpPipe, 33 int32_t ret, const std::string description, MAP_STR_DEVICE &devices); 34 static void CheckAttributeReportTransferFaultSysEvent(const std::string transferType, 35 const HDI::Usb::V1_0::UsbDev &tmpDev, const HDI::Usb::V1_0::UsbPipe &tmpPipe, const USBEndpoint &ep, 36 int32_t ret, const std::string description, MAP_STR_DEVICE &devices); 37 static bool GetUsbInterfaceId(const HDI::Usb::V1_0::UsbDev &tmpDev, const HDI::Usb::V1_0::UsbPipe &tmpPipe, 38 int32_t interfaceId, MAP_STR_DEVICE &devices, UsbInterface &itIF, UsbDevice &dev); 39 }; 40 41 } // namespace USB 42 } // namespace OHOS 43 44 #endif //USB_REPORT_SYS_EVENT_H