Patent ID: 7085876

Claim:
A method for a USB controlling apparatus including at least one connection port having a set of USB data lines for connecting to a USB device or a USB cable for data transfer, a path switch connected to a host controller, a device function circuit and said USB data lines, a power switch having one end connected to a power line on a motherboard and another end connected to a power adapting line, and a series connection of a pull-up resistor and a pull-up switch connected between said power adapting line and one of said set of USB data lines, said method comprising following steps: setting a host function mode as a default operation mode of said USB controlling apparatus, setting said host function mode includes connecting said data lines to said host controller by said path switch and turning on said power switch and turning off said pull-up switch; detecting whether a first connection port of said at least one connection ports is being used by said host controller; when said first connection port is being used by said host controller, said USB controlling apparatus is operated in said host function mode; when said first connection port is not being used by said host controller, said USB controlling apparatus is switched to operate in a device function mode, operating in said device function mode includes connecting said data lines to said device function circuit by said path switch and turning off said power switch and turning on said pull-up switch; providing a predetermined waiting time; detecting whether a connection is established through said first connection port for said USB controlling apparatus; when said connection is established through said first connection port, said USB controlling apparatus is operated in said device function mode; and, when said connection is not established through said first connection port, examining whether said connection is established within said predetermined waiting time for reconfiguration of said first connection port responsive thereto.