Abstract:
A device switching method is provided. The method includes the following steps. An operation instruction is received by a computer system. In response to the instruction, a switching signal is sent from the computer system to an integrated peripheral device connected via a port to the computer, thus the active device of the integrated peripheral device is switched from a first device to a second device.

Description:
BACKGROUND OF THE INVENTION 
       [0001]    1. Field of the Invention 
         [0002]    The invention relates to computer techniques, and more particularly to device switching methods and systems. 
         [0003]    2. Description of the Related Art 
         [0004]    Universal Serial Bus (USB) is a type of serial bus standard for peripheral device connection with personal computers (PC). USB has substantially replaced serial and parallel port connectors in personal computers (PC). 
         [0005]    USB can connect peripherals such as pointing devices, keyboards, gamepads and joysticks, scanners, digital cameras, printers, external storage devices, networking components, and others. Various USB devices may be integrated into one device for connection to a computer via one USB port. A digital camera, for example, when connected to a computer and switched to the appropriate mode, may serve as a webcam, a card reader, a storage device, or similar. A mode switching function of the digital camera may switch between various camera functions. As the number of camera functions increases, the mode switching device design becomes more complicated, thus increasing the difficulty of the mechanical design of the switch and reducing convenience. 
       BRIEF SUMMARY OF THE INVENTION 
       [0006]    Device switching methods without hardware switch are provided. An exemplary embodiment of a device switching method comprises the following steps. An operation instruction is received by a computer system from an input device thereof. In response to the operation instruction, a first switching signal is transmitted from the computer system to an integrated peripheral device connected to the computer via a port, thus switching from a first device to a second device as the active device of the integrated peripheral device. 
         [0007]    Integrated peripheral devices without hardware switch are provided. An exemplary embodiment of an integrated peripheral device is coupled to a computer system through a port and comprises a first device, a second device, and a switching device. The first device is connected to the computer system, and serves as the active device of the integrated peripheral device to provide a first function. The second device is different from the first device, and disconnected from the computer system when the first device is the active device. The switching device switches from a first device to a second device as the active device of the integrated peripheral device in response to a first switching signal received from the computer system. 
         [0008]    A detailed description is given in the following embodiments with reference to the accompanying drawings. 
     
    
     
       BRIEF DESCRIPTION OF THE DRAWINGS 
         [0009]    The invention can be more fully understood by reading the subsequent detailed description and examples with references made to the accompanying drawings, wherein: 
           [0010]      FIG. 1  is a block diagram of the configuration of an exemplary embodiment of a computer system and an integrated peripheral device; 
           [0011]      FIG. 2  is a flowchart showing an exemplary embodiment of a device switching method; 
           [0012]      FIG. 3  is a flowchart showing another exemplary embodiment of a device switching method; 
           [0013]      FIG. 4  is a schematic view showing the format for private commands; 
           [0014]      FIG. 5  is a schematic view showing the format for vendor commands; and 
           [0015]      FIG. 6  is a flowchart showing another exemplary embodiment of a device switching method. 
       
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
       [0016]    The following description is of the best-contemplated mode of carrying out the invention. This description is made for the purpose of illustrating the general principles of the invention and should not be taken in a limiting sense. The scope of the invention is best determined by reference to the appended claims. 
         [0017]    In  FIG. 1 , computer system  100  comprises processor  1 , main memory  2 , display  3 , input device  4 , host controller  5 , and storage device  6 . Host controller  5  is connected to USB port  7 . Integrated peripheral device  120  comprises internal devices  123 - 125  providing various functions, and a USB connector  122  (or plug) connected to USB port  7 . Switching device  121  can connect or disconnect devices  123 - 125  to or from computer system  100  respectively. Note that at least one of devices  123 - 125  reserves the capability of receiving and recognizing switching signals to accordingly control switching device  121 . In integrated peripheral device  120 , device  123  connected to computer system  100  serves as the default active device therein which can communicate with computer system  100  and receive device switching commands therefrom for controlling switching device  121 , thus switching to another device  124  or  125  as the active device in integrated peripheral device  120 . 
         [0018]    Storage device  6  stores application programs  61  and  62  and operating system (OS)  63 . Application programs  61  and  62  are respectively associated with and correspond to devices  124  and  125 . Drivers  611  and  612  drive devices  124  and  125  respectively. Processor  1  loads application programs  61  and  62 , OS  63 , and drivers  611  and  612  to main memory  2  for execution by operating system (OS)  63 . One of the devices  123 - 125  may be predetermined as the default active device of integrated peripheral device  120 . In the following description, it is assumed that device  123  includes a USB mass storage class storage device and is predetermined as the default active device of integrated peripheral device  120 , other devices (devices  124  and  125 ) are disconnected from (or not in active communication with) computer system  100 , device  124  may be a webcam, and device  125  may be a television receiver. Note that an integrated peripheral device may comprise various devices and connect to a computer via USB interface, but is not limited thereto. An integrated peripheral device may connect to a computer through other interfaces, such as Firewire. 
         [0019]    When computer system  100  receives an operation instruction from input device  4 , processor  1  transmits a switching signal from computer system  100  to integrated peripheral device  120  in response to the operation instruction, thus switching from device  123  to device  124  or device  125  as the active device of the integrated peripheral device  120 . Processor  1  may automatically transmit switching signals for switching to a new active device as directed by an executing application program. For example, the device switching is automatically performed in response to initiation or termination of an application program, or a device is selected as the active device according to the active window in the operating system. Examples are given in the following. 
         [0020]    With reference to  FIG. 2 , when integrated peripheral device  120  is connected to computer system  100 , computer system  100  identifies storage device  123 , the default active device of integrated peripheral device  120  (step S 200 ). Input device  4  receives an operation instruction from a user for activating application program  61  associated with device  124 , which is stored in computer system  100 . When processor  1  executes application program  61  (step S 202 ), application program  61  transmits a first switching signal though host controller  5  and USB port  7  to integrated peripheral device  120  (step S 204 ). The first switching signal may be a private command conforming to the USB mass storage class standard.  FIG. 4  shows a schematic diagram of the private command format. Payload of the first switching signal may be recorded in the fifteenth through thirtieth bytes of the private command. 
         [0021]    When the integrated peripheral device  120  receives the first switching signal, storage device  123  controls switching device  121  based on the first switching signal, to disconnect device  123  from computer system  100 , and establish a connection between device  124  and computer system  100 . Thus, integrated peripheral device  120  sets device  124 , as a substitute for device  123 , as the active device of the integrated peripheral device  120  in response to the first switching signal. Note that, in some embodiments, OS  63  may operate in conjunction with a driver  611  of device  124  to transmit the first switching signal. 
         [0022]    Next, computer system  100  identifies (step S 206 ) and communicates (step S 208 ) with device  124  (a webcam), as the new active device of the integrated peripheral device  120 . Input device  4  receives an operation instruction from a user for terminating application program  61  associated with device  124 , running in computer system  100 . When processor  1  terminates application program  61  (step S 210 ), application program  61  transmits a second switching signal (step S 212 ). The second switching signal may be a vendor command conforming to the USB standard.  FIG. 5  shows a schematic diagram of the vendor command format. Payload of the second switching signal may be recorded in the first byte of the vendor command. 
         [0023]    Device  124  controls switching device  121  based on the private command, for switch to storage device  123  as the active device of the integrated peripheral device  120 . Note that, in some embodiments, OS  63  or driver  611  of device  124  may transmit the second switching signal. Computer system  100  identifies device  123  as the active device of the integrated peripheral device  120  (step S 214 ). 
         [0024]    Integrated peripheral device  120  may change to a new active device before application program  61  is terminated, an example of which is given in the following. 
         [0025]    With reference to  FIG. 3 , when integrated peripheral device  120  is connected to computer system  100 , computer system  100  identifies storage device  123 , the default active device of integrated peripheral device  120  (step S 300 ). Input device  4  receives an operation instruction form a user for activating application program  61  associated with device  124 , which is stored in computer system  100 . When processor  1  executes application program  61  (step S 302 ), application program  61  transmits a third switching signal though host controller  5  and USB port  7  to integrated peripheral device  120  (step S 304 ). When the integrated peripheral device  120  receives the third switching signal, storage device  123  controls switching device  121  based on the third switching signal, to disconnect device  123  from computer system  100 , and establish a connection between device  124  and computer system  100 . 
         [0026]    Next, computer system  100  identifies (step S 306 ) and interacts (step S 308 ) with device  124  (a webcam), the active device of the integrated peripheral device  120 . Input device  4  receives an operation instruction from a user for initiating an application program  62  associated with device  125 , which is stored in computer system  100 . When processor  1  initiates application program  62  (step S 310 ), application program  62  transmits a fourth switching signal (step S 312 ). Device  124  controls switching device  121  based on the fourth switching signal, to switch on storage device  125  (a TV receiver) as the active device of the integrated peripheral device  120 . Note that, in some embodiments, OS  63  or driver  612  of device  125  may transmit the fourth switching signal. Computer system  100  identifies device  125  as the active device of the integrated peripheral device  120  (step S 314 ). Processor  1  terminates application program  61  (step S 316 ). 
         [0027]    In step S 316 , even if a vendor command for controlling device  124  to switch to device  123  as the active device is delivered after termination of application program  61 , the current active device is device  125 , thus, the vendor command of device  124  is not recognized, preventing from switch to device  123  as the active device, ensuring normal operation of the active device. 
         [0028]    Computer system  100  may automatically change the active device according to the active window in the operating system, as described in the following for example. 
         [0029]    With reference to  FIG. 6 , OS  63  determines if the active window has changed (step S 600 ). If so, OS  63  identifies the application program of the active window (step S 602 ) and an internal device of integrated peripheral device  120  associated with the application program (step S 604 ), and transmits a device switching signal to integrated peripheral device  120  to switch to the identified device as the active device associated with the active window (step S 606 ). 
         [0030]    While the invention has been described by way of example and in terms of preferred embodiment, it is to be understood that the invention is not limited thereto. To the contrary, it is intended to cover various modifications and similar arrangements (as would be apparent to those skilled in the art). Therefore, the scope of the appended claims should be accorded the broadest interpretation so as to encompass all such modifications and similar arrangements.