A mode switch method of an portable electronic device includes: when the electronic device is electrically connected to a host, setting the electronic device to start to be operated under a first mode; when the host has installed a operating system, detecting whether the host has a driver of the electronic device or not; when the host has the driver of the electronic device, the electronic device continues to be operated under the first mode; and when the host does not have the driver of the electronic device, switching the electronic device to be operated under a second mode.

Patent
   9274988
Priority
Aug 24 2012
Filed
Jan 21 2013
Issued
Mar 01 2016
Expiry
Jan 21 2033
Assg.orig
Entity
Large
20
20
currently ok
1. A mode switching method of an electronic device, comprising:
setting the electronic device to start operating in a first mode when the electronic device is electrically connected to a host;
detecting whether the host has a driver of the electronic device installed therein or not, by the electronic device, when the host has an operating system installed therein;
maintaining the electronic device to be operated in the first mode when the electronic device determines that the host has the driver installed therein;
switching the electronic device to be operated in a second mode when the electronic device determines that the host does not have the driver installed therein; and
after switching the electronic device to the second mode: determining whether the electronic device is switched to the second mode under an operation of the operating system of the host;
maintaining the electronic device in the second mode when the electronic device is switched to the second mode under the operation of the operating system of the host; and
when the electronic device is not switched to the second mode under the operation of the operating system of the host, switching the electronic device to the first mode, and determining whether the host has the driver of the electronic device installed therein to decide whether to maintain the electronic device in the first mode or switch the electronic device to the second mode again for installation of the driver;
wherein the second mode is a storage device mode for installation of the driver;
wherein the step of determining whether the electronic device is switched to the second mode under the operation of the operating system of the host comprises: recording a time point at which the electronic device is switched to the second mode;
receiving a resetting signal from the host and recording a time point at which the resetting signal is received; and
determining whether the electronic device is switched to the second mode under the operation of the operating system of the host according to the time point at which the electronic device is switched to the second mode and the time point at which the resetting signal is received;
wherein the step of determining whether the electronic device is switched to the second mode under the operation of the operating system of the host comprises: referring to a time difference between the time point at which the electric device is switched to the second mode and the time point at which the resetting signal is received to determine whether the electronic device is switched to the second mode under the operation of the operating system of the host;
determining that the electronic device is not switched to the second mode under the operation of the operating system of the host when the time difference is lamer than a threshold value; and
determining that the electronic device is switched to the second mode under the operation of the operating system of the host when the time difference is smaller than a threshold value.
9. An electronic device, comprising:
a storage unit, arranged for storing a driver;
a controller, coupled to the storage unit;
wherein the controller controls the electronic device to start operating in a first mode when the electronic device is electrically connected to a host; the controller detects whether the host has the driver of the electronic device installed therein or not when the host has an operating system installed therein; the controller maintains the electronic device to be operated in the first mode when the controller determines that the host has the driver installed therein; and the controller switches the electronic device to be operated in a second mode when the controller determines that the host does not have the driver installed therein; wherein the second mode is a storage device mode for installation of the driver;
wherein after switching the electronic device to the second mode, the controller determines whether the electronic device is switched to the second mode under an operation of the operating system of the host; and the controller maintains the electronic device in the second mode when the electronic device is switched to the second mode under the operation of the operating system of the host, and switches the electronic device to the first mode when the electronic device is not switched to the second mode under the operation of the operating system of the host;
wherein after switching the electronic device to the first mode due to that the electronic device is not switched to the second mode under the operation of the operating system of the host, the controller determines whether the host has the driver of the electronic device installed therein to decide whether to maintain the electronic device in the first mode or switch the electronic device to the second mode again for installation of the driver;
wherein the controller records a time point at which the electronic device is switched to the second mode, and records a time point at which a resetting signal is received from the host; and the controller refers to the time point at which the electronic device is switched to the second mode and the time point at which the resetting signal is received to determine whether the electronic device is switched to the second mode under the operation of the operating system of the host;
wherein determining whether the electronic device is switched to the second mode under the operation of the operating system of the host comprises: the controller referring to a time difference between the time point at which the electric device is switched to the second mode and the time point at which the resetting signal is received to determine whether the electronic device is switched to the second mode under the operation of the operating system of the host;
the controller determining that the electronic device is not switched to the second mode under the operation of the operating system of the host when the time difference is lamer than a threshold value; and
the controller determining that the electronic device is switched to the second mode under the operation of the operating system of the host when the time difference is smaller than a threshold value.
2. The mode switching method of claim 1, wherein the electronic device is a universal serial bus (USB) electronic device, the electronic device has a plurality of functions, and the first mode and the second mode correspond to different functions in the electronic device.
3. The mode switching method of claim 2, wherein the electronic device is a USB network adapter, the first mode is a network function mode.
4. The mode switching method of claim 1, further comprising:
detecting whether the host has the operating system installed therein; and
maintaining the electronic device in the first mode when the host does not have the operating system installed therein.
5. The mode switching method of claim 4, wherein the step of detecting whether the host has the operating system installed therein comprise:
determining whether a query command from the host is received during a predetermined time period;
determining that the host has the operating system installed therein when the query command from the host is received during the predetermined time period; and
determining that the host does not have the operating system installed therein when the query command from the host is not received during the predetermined time period.
6. The mode switching method of claim 1, wherein the step of detecting whether the host has the driver of the electronic device installed therein comprise:
determining whether a setting message from the host is received during a predetermined time period;
determining that the host has the driver installed therein when the setting message from the host is received during the predetermined time period; and
determining that the host does not have the driver installed therein when the setting message from the host is not received during the predetermined time period.
7. The mode switching method of claim 1, wherein the driver is stored in the electronic device, and the mode switching method further comprises:
after switching the electronic device to the second mode: receiving a specific command from the host to determine whether the host has utilized the driver stored in the electronic device to complete installation of the driver, and accordingly determining whether to switch the electronic device back to the first mode.
8. The mode switching method of claim 1, wherein the resetting signal is a command signal corresponding to the electronic device that is immediately generated when the host detects the electronic device.
10. The electronic device of claim 9, wherein the electronic device is a universal serial bus (USB) electronic device, the electronic device has a plurality of functions, and the first mode and the second mode correspond to different functions in the electronic device.
11. The electronic device of claim 10, wherein the electronic device is a USB network adapter, the first mode is a network function mode.
12. The electronic device of claim 9, wherein the controller further detects whether the host has the operating system installed therein; and the controller maintains the electronic device in the first mode when the host does not have the operating system installed there.
13. The electronic device of claim 9, wherein the controller determines whether a setting message from the host is received during a predetermined time period; and determines that the host has the driver program installed therein after receiving the setting message from the host.
14. The electronic device of claim 9, wherein after switching the electronic device to the second mode, the controller receives a specific command from the host to determine whether the host has utilized the driver stored in the electronic device to complete installation of the driver, and accordingly determines whether to switch the electronic device back to the first mode.

1. Field of the Invention

The present invention is related to an electronic device, and more particularly, to a mode switching method of an electronic device with multiple functions and the related electronic device.

2. Description of the Prior Art

The universal serial bus (USB) is a very popular device interface nowadays, and many electronic devices employ this kind of device interface. However, drivers of some USB devices are not built in the operation system employed by the host. Therefore, the user needs to install the driver to the host first and then uses the USB device via the host, which limits the convenience of using the USB device.

To solve the aforementioned driver installation problem, a composite USB device is developed. The composite USB device includes many functions, where one function is to make the composite USB device simulate a storage device to be used as the installation source of the driver, so that the host can install the driver needed by the composite USB device when the composite USB device is connected to the host. However, no matter whether the host has installed the driver, each time the composite USB device is connected to the host, a pop-up window will be displayed on the screen to ask the user whether to install the driver. Hence, it would be inconvenient for the user to manually close this pop-up window.

Therefore, an objective of the present invention is providing a mode switching method of the electronic device which can avoid the display of a pop-up driver installation window when the host has already installed the driver, to solve the aforementioned problem.

According to an embodiment of the present invention, a mode switching method of an electronic device includes: when the electronic device is electrically connected to a host, the electric device is set to operate in a first mode; when the host has an operating system, detecting whether the host has installed a driver of the electric device; when the host has installed the driver, maintaining the electric device in the first mode; and when the host does not have the driver, switching the electric device to a second mode.

According to another embodiment of the present invention, an electric device includes a storage unit and a controller, where the storage unit is used to store a driver. When the electronic device is electrically connected to a host, the controller sets the electronic device to start operating in a first mode; when the host has installed an operating system, the controller detects whether the host has installed a driver of the electronic device; when the host has the driver, the controller remains the electric device in the first mode; and when the host does not have the driver, the controller switches the electric device to a second mode.

These and other objectives of the present invention will no doubt become obvious to those of ordinary skill in the art after reading the following detailed description of the preferred embodiment that is illustrated in the various figures and drawings.

FIG. 1 is a diagram illustrating an electronic device according to an embodiment of the present invention.

FIG. 2 is a flowchart illustrating a mode switching method of the electronic device according to an embodiment of the present invention.

FIG. 3 is a flowchart illustrating the step of determining whether the electronic device is switched to the second mode under the operation of the operating system according to an embodiment of the present invention.

Please refer to FIG. 1, which is a diagram illustrating an electronic device 100 according to an embodiment of the present invention. As shown in FIG. 1, the electronic device 100 includes an interface 102, a controller 104 and a storage unit 106, where the interface 102 is used to electrically connect to an interface 122 of a host 120, and the storage unit 106 stores a driver 108 to be installed in the host 120. In this embodiment, the electronic device 100 is an universal serial bus (USB) electronic device, the interface 102 is an USB interface, the electronic device 100 supports multiple functions and the interface 102 also supports the corresponding multiple functions; besides, the host 120 can be any host having an operating system and supporting the USB function, like a desktop computer, a notebook, a tablet, etc., and the interface 122 is also a USB interface.

Additionally, in an embodiment, the electronic device 100 may be a USB network adapter and support at least the network function and the storage device function. That is, the electronic device 100 can provide network communication and related functions to the host 120, and can also be taken as a storage device by the host 120.

Please refer to FIG. 2, which is a flowchart illustrating a mode switching method of the electronic device 100 according to an embodiment of the present invention, where the flowchart shown in FIG. 2 is the operation of the electronic device 100 after the electronic device 100 is just plugged into the host 120, or the operation of the electronic device 100 after the host 120 reboots under the condition that the electronic device 100 has been plugged into the host 120. Additionally, the flowchart shown in FIG. 2 is performed by the controller 104 according to hardware or software (firmware). Referring to FIG. 1 and FIG. 2, the flowchart is described in the following.

At first, in step 200, when the electronic device 100 is just plugged into the host 120 or when the host 120 reboots under the condition that the electronic device 100 is already plugged into the host 120, the controller 104 would set the electronic device 100 to directly operate in a first mode. In this embodiment, it is assumed that the electronic device 100 supports two functions, such as the network function and the storage device function. Hence, the first mode can be a network function mode in this case. Besides, the electronic device 100 does not operate in a second mode at this moment, that is, the storage device function supported by the electronic device 100 is not enabled at this moment.

Next, in step 202, the controller 104 detects whether a query command is received from the host 120, where the query command is a command particularly transmitted to the electronic device 100 for querying information such as a product identification (PID), a vendor identification (VID), a class, a sub-class, etc. For example, the query command can be a device descriptor DEVICE_DESCRIPTOR as defined in the query type control transfer of the USB specification. In an embodiment, the controller 104 can determine whether the query command is received from the host 120 by checking if the query command is received within a predetermined time (e.g., 3 seconds). If the controller 104 receives the query command from the host 120, it means that the host 120 has the operating system installed therein and is a USB host. Hence, the flow goes to step 206 to determine that the electronic device 100 is indeed connected to an USB host having the operating system installed therein. However, if the controller 104 does not receive the query command from the host 120, it means that the host 120 does not have the operating system installed therein, and the electronic device 100 is probably merely connected to a power supplier. Hence, the flow goes to step 204 to determine that the electronic device 100 is connected to a power supplier, and then goes to step 214 to make the electronic device 100 remain operating in the first mode.

After the flow proceeds with step 206 to determine that the electronic device 100 is indeed connected to a USB host having the operating system installed therein, the flow goes to step 208 to determine whether a setting message is received from the host 120, where the setting message is a message which is transmitted to the electronic device 100 only when the host 120 has the driver of the electronic device 100. For example, the setting message can be a set configuration SET_CONFIGURATION as defined in the set type control transfer of the USB specification. In an embodiment, the controller 104 can determine whether the setting message is received from the host 120 by checking if the setting message is received within a predetermined time (e.g., 3 seconds). If the controller 104 receives the setting message from the host 120, it means that the host 120 has the driver of the electronic device 100, and thus the flow goes to step 214 to remain operating in the first mode. However, if the controller 104 does not receive the setting message from the host 120, the flow goes to step 210.

In step 210, the controller 104 switches the electronic device 100 to operate in the second mode, where the second mode is the storage device mode. When the electronic device 100 operates in the second mode, a new window (not shown) will be displayed on the screen of the host 120 for allowing the use to enable the installation of the driver. After the host 120 uses the driver 108 in the electronic device 100 to complete the installation of the driver, the host 120 will transmit a specific command to the electronic device 100 to inform that the host 120 has completed the installation of the driver. Therefore, the controller 104 can determine whether the host 120 has completed the installation of the driver by checking if the specific command is received from the host 120. After the controller 104 determines that the host 120 has completed the installation of the driver, the electronic device 100 is switched to operate in the first mode, and then the flow goes to step 214 to make the electronic device 100 remain operating in the first mode.

As mentioned above, although the electronic device 100 supports two functions, the storage device function is not enabled in the beginning. Specifically, the storage device function is not enabled for allowing the user to use the driver 108 stored in the electronic device 100 to accomplish the driver installation until the controller 104 determines that the host 120 does not have the driver of the electronic device 100. Compared to the prior art, the present invention therefore can prevent the user from closing the pop-up driver installation window each time the electronic device is powered on, thus improving the convenience for the user.

Additionally, when the host 120 supports the USB flash disk booting function, the basic input/output system (BIOS) in the host 120 can also support the USB device. Therefore, when the host 120 reboots under the condition that the electronic device 100 has been plugged into the host 120, because the BIOS operates first, the electronic device 100 will take BIOS as a USB host and make the electronic device 100 follow successive steps 200, 202, 206, 208 shown in FIG. 2 to enter step 210 such that the electronic device 100 operates in the second mode (storage device mode). After the operating system of the host 120 completes the booting regularly, because the electronic device 100 has operated in the second mode (storage device mode), a pop-up window would still be displayed on the screen of the host 120 to ask the user about whether the driver is needed to be installed. Hence, the user needs to close the pop-up window, resulting in inconvenience for the user.

To solve this problem, please refer to FIG. 3, which is a flowchart illustrating the step of determining whether the electronic device is switched to the second mode (storage device mode) under the operation of the operating system according to an embodiment of the present invention. The flow shown in FIG. 3 is performed immediately after step 210 shown in FIG. 2. That is, after step 210 is entered, besides waiting for the completion of the driver installation to go to step 212, the flow also goes to step 300 shown in FIG. 3 automatically. Referring to FIG. 1-FIG. 3 together, the flow is summarized as follows.

In step 300, the controller 104 records the time point t0 that the electronic device 100 is switched to the second mode (that is, the time point of going to step 210 shown in FIG. 2). Next, in step 302, the controller 104 waits for a resetting signal, and records the time point t1 of receiving the resetting signal. In this embodiment, the resetting signal is a command signal corresponding to the electronic device 100 that is immediately generated when the operating system of the host 120 detects the electronic device 100. Besides, the resetting signal can also be a command signal immediately generated when the operating system of the host 120 performs the operating system switching, interface switching or the mode switching of the electronic device 100.

Next, in step 304, a time difference between the time point t0 at which the electronic device 100 is switched to the second mode and the time point t1 of receiving the resetting signal is calculated and compared with a threshold value Tth, to thereby determine whether the electronic device 100 is switched to the second mode under the operation of the operating system of the host 120. In detail, because the resetting signal is transmitted when the operating system of the host 120 detects the electronic device 100, if the electronic device 100 is switched to the second mode under the operation of the operating system of the host 120, the time difference (t1−t0) should be very short. However, if the electronic device 100 is switched to the second mode under the operation of the BIOS, the time difference would be very long because the time difference (t1−t0) is close to the booting time of the host 120. As mentioned above, if step 304 determines that the time difference (t1−t0) is smaller than the threshold value Tth (the threshold value Tth can be any preset value (e.g., i.e. 5-10 seconds) smaller than the booting time of the host 120), this implies the electronic device 100 is switched to the second mode under the operation of the operating system of the host 120, and thus the flow goes back to step 302. However, if step 304 determines that the time difference (t1−t0) is larger than the threshold value Tth, this implies the electronic device 100 is switched to the second mode under the operation of BIOS rather than the operation of the operating system of the host 120, and thus the flow goes to step 306.

In step 306, the controller 104 switches the electronic device 100 back to the first mode, and the flow goes back to step 200 shown in FIG. 2 to restart the flow shown in FIG. 2.

Besides, it should be noted that the flow shown in FIG. 3 is only for illustrative purposes, and not meant to be a limitation to the present invention. In other embodiment of the present invention, the controller 104 can also determine whether the electronic device 100 is switched to the second mode under the operation of the operating system of the host 120 by using other determining methods, and accordingly determine whether the flow shown in FIG. 2 should be restarted.

In summary, the mode switching method of the electronic device of the present invention is applied to a multi-function USB device, and is capable of determining whether the electronic device enters the storage device mode by checking if the host has the driver installed. In this way, the pop-up driver installation window displayed on the screen each time the user connects the electronic device to the host can be avoided, thus improving the convenience for the user.

Those skilled in the art will readily observe that numerous modifications and alterations of the device and method may be made while retaining the teachings of the invention. Accordingly, the above disclosure should be construed as limited only by the metes and bounds of the appended claims.

Hsu, Chin-Yu, Chen, Yi-Huai

Patent Priority Assignee Title
10172669, Oct 09 2009 Cilag GmbH International Surgical instrument comprising an energy trigger lockout
10314638, Apr 07 2015 Cilag GmbH International Articulating radio frequency (RF) tissue seal with articulating state sensing
10603117, Jun 28 2017 Cilag GmbH International Articulation state detection mechanisms
10751109, Dec 22 2014 Cilag GmbH International High power battery powered RF amplifier topology
10751117, Sep 23 2016 Cilag GmbH International Electrosurgical instrument with fluid diverter
10779876, Oct 24 2011 Cilag GmbH International Battery powered surgical instrument
10799284, Mar 15 2017 Cilag GmbH International Electrosurgical instrument with textured jaws
10856934, Apr 29 2016 Cilag GmbH International Electrosurgical instrument with electrically conductive gap setting and tissue engaging members
10959771, Oct 16 2015 Cilag GmbH International Suction and irrigation sealing grasper
10959806, Dec 30 2015 Cilag GmbH International Energized medical device with reusable handle
10987156, Apr 29 2016 Cilag GmbH International Electrosurgical instrument with electrically conductive gap setting member and electrically insulative tissue engaging members
11033323, Sep 29 2017 Cilag GmbH International Systems and methods for managing fluid and suction in electrosurgical systems
11033325, Feb 16 2017 Cilag GmbH International Electrosurgical instrument with telescoping suction port and debris cleaner
11090103, May 21 2010 Cilag GmbH International Medical device
11484358, Sep 29 2017 Cilag GmbH International Flexible electrosurgical instrument
11490951, Sep 29 2017 Cilag GmbH International Saline contact with electrodes
11497546, Mar 31 2017 Cilag GmbH International Area ratios of patterned coatings on RF electrodes to reduce sticking
11839422, Sep 23 2016 Cilag GmbH International Electrosurgical instrument with fluid diverter
11957342, Nov 01 2021 Cilag GmbH International Devices, systems, and methods for detecting tissue and foreign objects during a surgical operation
ER5091,
Patent Priority Assignee Title
6085277, Oct 15 1997 International Business Machines Corporation Interrupt and message batching apparatus and method
7039738, Nov 16 1998 RPX Corporation Method and system for handling device driver interrupts
7058836, Dec 28 2000 Intel Corporation Method and apparatus facilitating direct access to a parallel ATA device by an autonomous subsystem
7069456, Dec 28 2000 Intel Corporation Method and apparatus facilitating direct access to a serial ATA device by an autonomous subsystem
7107379, Sep 05 2001 Moeller GmbH Method for connecting an expansion module to a programmable electric switching device
7120709, May 10 2004 Hitachi, Ltd. Disk-array device having storage-device recognition and indentification of a storage area network link environment
7174397, Feb 28 2003 Kabushiki Kaisha Toshiba Information processing apparatus that displays image data
7209982, Oct 31 2003 Kabushiki Kaisha Toshiba Electronic apparatus including plural processors
7269630, Oct 17 2001 LENOVO INTERNATIONAL LIMITED Automatically switching shared remote devices in a dense server environment thereby allowing the remote devices to function as a local device
7328333, Dec 07 2001 Lenovo PC International Apparatus, method and program product for selectively starting one of a plurality of operating systems and secondary storage according to whether or not a predetermined peripheral is connected to the system
7380039, Dec 30 2003 Computer Associates Think, Inc Apparatus, method and system for aggregrating computing resources
7886136, May 21 2004 Samsung Electronics Co., Ltd. Computer system, method, and medium for switching operating system
8321617, May 18 2011 Hitachi, Ltd.; Hitachi, LTD Method and apparatus of server I/O migration management
8595533, Oct 01 2010 VIA LABS, INC Power management system, method thereof and storage medium
20060085583,
20080276012,
20090307380,
20110258348,
20120179845,
TW328743,
///
Executed onAssignorAssigneeConveyanceFrameReelDoc
Jan 16 2013HSU, CHIN-YURealtek Semiconductor CorpASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS 0296620063 pdf
Jan 16 2013CHEN, YI-HUAIRealtek Semiconductor CorpASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS 0296620063 pdf
Jan 21 2013Realtek Semiconductor Corp.(assignment on the face of the patent)
Date Maintenance Fee Events
Apr 19 2019M1551: Payment of Maintenance Fee, 4th Year, Large Entity.
Apr 17 2023M1552: Payment of Maintenance Fee, 8th Year, Large Entity.


Date Maintenance Schedule
Mar 01 20194 years fee payment window open
Sep 01 20196 months grace period start (w surcharge)
Mar 01 2020patent expiry (for year 4)
Mar 01 20222 years to revive unintentionally abandoned end. (for year 4)
Mar 01 20238 years fee payment window open
Sep 01 20236 months grace period start (w surcharge)
Mar 01 2024patent expiry (for year 8)
Mar 01 20262 years to revive unintentionally abandoned end. (for year 8)
Mar 01 202712 years fee payment window open
Sep 01 20276 months grace period start (w surcharge)
Mar 01 2028patent expiry (for year 12)
Mar 01 20302 years to revive unintentionally abandoned end. (for year 12)