Data transfer method for Universal Serial Bus device
A data transfer method for a Universal Serial Bus (USB) device is provided. The data transfer rate of a bulk transfer transmission in the USB is detected first for selecting a transfer transmission having a better data transfer rate between the bulk transfer transmission in the USB and an interrupt transfer transmission in the USB, so as to ensure the data transfer bandwidth in the USB is better utilized by the USB device.
1. A data transfer method for a USB device, comprising:
connecting a USB device to a USB;
determining whether a data transfer rate of a bulk transfer transmission in the USB is lower than a predetermined value; and
using the bulk transfer transmission in the USB to transfer the data in the USB device if the data transfer rate of the bulk transfer transmission in the USB is not lower than the predetermined value, and/or swapping to use an interrupt transfer transmission in the USB to transfer the data in the USB device if the data transfer rate of the bulk transfer transmission in the USB is lower than the predetermined value.
2. The data transfer method for the USB device of claim 1 , further comprising:
after using the interrupt transfer transmission in the USB to transfer the data in the USB device for a predetermined period of time, swapping to use the bulk transfer transmission in the USB to transfer the data in the USB device.
3. The data transfer method for the USB device of claim 1 , wherein the predetermined value is a data transfer rate which is guaranteed by the interrupt transfer transmission in the USB.
4. A data transfer method for a USB device, comprising:
determining whether a data transfer rate of a bulk transfer transmission in a USB connected to a USB device is lower than a predetermined value; and
using the bulk transfer transmission in the USB to transfer the data in the USB device when the data transfer rate of the bulk transfer transmission in the USB is not lower than the predetermined value, and/or using an interrupt transfer transmission in the USB to transfer data in the USB device if the data transfer rate of the bulk transfer transmission in the USB is lower than the predetermined value.
5. The data transfer method for the USB device of claim 4 , further comprising:
after using the interrupt transfer transmission in the USB to transfer the data in the USB device for a predetermined period of time, swapping to the bulk transfer transmission in the USB to transfer the data in the USB device.
6. The data transfer method for the USB device of claim 4 , wherein the predetermined value is a data transfer rate which is guaranteed by the interrupt transfer transmission in the USB.