1# FAQs 2 3<!--Kit: Basic Services Kit--> 4<!--Subsystem: USB--> 5<!--Owner: @hwymlgitcode--> 6<!--Designer: @w00373942--> 7<!--Tester: @dong-dongzhen--> 8<!--Adviser: @w_Machine_cc--> 9 10## What should I do if the device list obtained by using usbManager.getDevices is empty when the device is connected to a PC using a USB cable? 11 12### Symptom 13 14After a device is connected to a PC using a USB cable, the device list obtained by **usbManager.getDevices** is empty, and the PC is not identified as a USB device. 15 16### Possible Causes 17 18USB devices are classified into two types: host and device. The USB host takes charge of data transmission and USB port management, and USB devices are managed by the USB host. 19 20If the current device functions as the USB host, the **usbManager.getDevices** API can be used to obtain the list of connected USB devices. 21 22Based on the preceding description: 23 24- When a device, for example, a phone, is connected to a PC using a USB cable, the PC is the USB host by default, and the phone is a USB device. It is normal if the device list obtained by calling **usbManager.getDevices** on the phone is empty. 25- When a device, for example, a phone, is connected to a mouse or keyboard using a USB cable, the phone is the USB host by default, and the mouse or keyboard is the USB device. In this case, you can call the **usbManager.getDevices** API on the phone to obtain the device list. 26 27### Solution 28 29Ensure that the current device is the USB host and the connected device is the USB device. (Some devices can serve both as the USB host and USB device. In this case, you need to set such devices as USB devices so that the device list can be obtained by the USB host.) 30 31## What should I do if garbled characters are displayed when data is transferred through the USB? 32 33### Symptom 34 35Garbled characters are displayed during data transfer. 36 37### Possible Causes 38 39The baud rate does not match. 40 41### Solution 42 43Check whether the baud rates at both ends are the same. If not, reconfigure the baud rates. 44 45## What should I do if communication fails when data is transferred through the USB? 46 47### Symptom 48 49The connection cannot be set up between the two ends. No data is transferred or received, or the transferred data frames are incomplete (for example, only some bytes are received). 50 51### Possible Causes 52 53The parity bit or stop bit is incorrectly configured. 54 55### Solution 56 57Check whether the settings of the parity bit or stop bit at both ends are the same as those required by the device. 58 59## What should I do if packet loss occurs when data is transferred through the USB? 60 61 62### Symptom 63 64Occasional packet loss occurs during data transfer. 65 66### Possible Causes 67 68Noise interference or insufficient stop bit. 69 70### Solution 71 72Check whether interference exists. Modify the stop bit to improve the anti-interference capability (for example, change the stop bit from 1 to 2). 73