Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
We use essential cookies for the website to function, as well as analytics cookies for analyzing and creating statistics of the website performance. To agree to the use of analytics cookies, click "Accept All". You can manage your preferences at any time by clicking "Cookie Settings" on the footer. More Information.
HarmonyOS
After 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.
USB 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.
If the current device functions as the USB host, the usbManager.getDevices API can be used to obtain the list of connected USB devices.
Based on the preceding description:
Ensure 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.)
Garbled characters are displayed during data transfer.
The baud rate does not match.
Check whether the baud rates at both ends are the same. If not, reconfigure the baud rates.
The 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).
The parity bit or stop bit is incorrectly configured.
Check whether the settings of the parity bit or stop bit at both ends are the same as those required by the device.
Occasional packet loss occurs during data transfer.
Noise interference or insufficient stop bit.
Check whether interference exists. Modify the stop bit to improve the anti-interference capability (for example, change the stop bit from 1 to 2).
Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
Quick start
Helps you find desired resources with ease.