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.
|
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
3. The mode switching method of
4. The mode switching method of
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
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
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
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
10. The electronic device of
11. The electronic device of
12. The electronic device of
13. The electronic device of
14. The electronic device of
|
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.
Please refer to
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
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
To solve this problem, please refer to
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
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
Besides, it should be noted that the flow shown in
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.
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 on | Assignor | Assignee | Conveyance | Frame | Reel | Doc |
Jan 16 2013 | HSU, CHIN-YU | Realtek Semiconductor Corp | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 029662 | /0063 | |
Jan 16 2013 | CHEN, YI-HUAI | Realtek Semiconductor Corp | ASSIGNMENT OF ASSIGNORS INTEREST SEE DOCUMENT FOR DETAILS | 029662 | /0063 | |
Jan 21 2013 | Realtek Semiconductor Corp. | (assignment on the face of the patent) | / |
Date | Maintenance Fee Events |
Apr 19 2019 | M1551: Payment of Maintenance Fee, 4th Year, Large Entity. |
Apr 17 2023 | M1552: Payment of Maintenance Fee, 8th Year, Large Entity. |
Date | Maintenance Schedule |
Mar 01 2019 | 4 years fee payment window open |
Sep 01 2019 | 6 months grace period start (w surcharge) |
Mar 01 2020 | patent expiry (for year 4) |
Mar 01 2022 | 2 years to revive unintentionally abandoned end. (for year 4) |
Mar 01 2023 | 8 years fee payment window open |
Sep 01 2023 | 6 months grace period start (w surcharge) |
Mar 01 2024 | patent expiry (for year 8) |
Mar 01 2026 | 2 years to revive unintentionally abandoned end. (for year 8) |
Mar 01 2027 | 12 years fee payment window open |
Sep 01 2027 | 6 months grace period start (w surcharge) |
Mar 01 2028 | patent expiry (for year 12) |
Mar 01 2030 | 2 years to revive unintentionally abandoned end. (for year 12) |