1 /*
2 * Copyright (c) 2023 Huawei Device Co., Ltd.
3 *
4 * HDF is dual licensed: you can use it either under the terms of
5 * the GPL, or the BSD license, at your option.
6 * See the LICENSE file in the root of this repository for complete details.
7 */
8
9 #include "usb_wrapper.h"
10
11 #include "hdf_log.h"
12 #include "hdf_usb_pnp_manage.h"
13
14 #ifdef USB_ENABLE_HISYSEVENT
15 #include "hisysevent.h"
16
17 using namespace OHOS::HiviewDFX;
18
19 #endif
20
UsbDDKDriverMatchFailEvent(const struct UsbPnpNotifyMatchInfoTable * infoTable)21 void UsbDDKDriverMatchFailEvent(const struct UsbPnpNotifyMatchInfoTable *infoTable)
22 {
23 #ifdef USB_ENABLE_HISYSEVENT
24 HiSysEventWrite(HiSysEvent::Domain::HDF_USB, "RECOGNITION_FAIL", HiSysEvent::EventType::FAULT,
25 "DEVICE_NAME", std::to_string(infoTable->busNum) + "-" + std::to_string(infoTable->devNum),
26 "DEVICE_PROTOCOL", infoTable->deviceInfo.deviceProtocol, "DEVICE_CLASS", infoTable->deviceInfo.deviceClass,
27 "VENDOR_ID", infoTable->deviceInfo.vendorId, "PRODUCT_ID", infoTable->deviceInfo.productId,
28 "VERSION", "1.0.0", "FAIL_REASON", 1, "FAIL_INFO", "Driver matching failed");
29 #endif
30 }
31
32