Abstract:
The present invention provides a novel communications apparatus that includes a plurality of wired LAN functions and wireless LAN functions and facilitates determining which network interface is to be enabled more flexibly. The communications apparatus of this invention switches a plurality of wired LAN functions and wireless LAN functions and includes a network interface control unit that enables and disables wired LAN and wireless LAN, a wired LAN communication availability status acquisition unit that detects that there is a change in the status of communication availability of wired LAN and acquires the status of communication availability of wired LAN, and a network interface determining unit that enables only one network interface from communication availability status of wired LAN acquired by the wired LAN communication availability status acquisition unit and a plurality of operating states of the apparatus.

Description:
CROSS-REFERENCE TO RELATED APPLICATIONS 
     This patent application is based on and claims priority pursuant to 35 U.S.C. §119 to Japanese Patent Application No. 2012-000931, filed on Jan. 6, 2012, in the Japan Patent Office, the entire disclosure of which is hereby incorporated by reference herein. 
     BACKGROUND OF THE INVENTION 
     1. Field of the Invention 
     The present invention relates to a communications apparatus and method, and more particularly to an apparatus that facilitates switching from wired LAN to wireless LAN and vice versa. 
     2. Description of the Background Art 
     Conventionally, in communications apparatuses that include a wired communication function (wired LAN) and a wireless communication function (wireless LAN), configurations such as using both wired LAN and wireless LAN together, and enabling only one of wired LAN or wireless LAN exclusively to cut energy consumption have been conceived and are well-known. 
     A technology of a network terminal that includes wired LAN and wireless LAN and switches between wired LAN and wireless LAN automatically by detecting the connection status of a wired LAN cable solely by monitoring the insertion and the removal of the wired LAN cable to save time and effort has been proposed (e.g., JP-H10-164114-A.) 
     In the technology described in JP-H10-164114-A, switching between wired LAN and wireless LAN is determined by detecting the connection status of the wired LAN cable. However, it cannot be determined which one, wired LAN or wireless LAN, is to be enabled based on multiple different operating states of the apparatus. 
     SUMMARY OF THE INVENTION 
     The present invention provides a novel communications apparatus that includes a plurality of wired LAN functions and wireless LAN functions and facilitates determining which network interface is to be enabled more flexibly. 
     More specifically, the present invention provides a communications apparatus that switches between wired LAN functions and wireless LAN functions and includes a network interface control unit that enables and disables wired LAN and wireless LAN, a wired LAN communication availability status acquisition unit that detects that there is a change in the status of communication availability of wired LAN and acquires the status of communication availability of wired LAN, and a network interface determining unit that enables only one network interface from communication availability status of wired LAN acquired by the wired LAN communication availability status acquisition unit and a plurality of operating states of the apparatus. 
     In the present invention, in the communications apparatus that includes a plurality of wired LAN functions and wireless LAN functions, it can be flexibly determined which network interface is to be enabled by considering not only connection status of wired LAN cable but also a plurality of operating states of the apparatus in case only one network interface is enabled exclusively. 
    
    
     
       BRIEF DESCRIPTION OF THE SEVERAL VIEWS OF THE DRAWINGS 
       A more complete appreciation of the disclosure and many of the attendant advantages thereof will be readily obtained as the same becomes better understood by reference to the following detailed description when considered in conjunction with the accompanying drawings. 
         FIG. 1  is a diagram illustrating a software configuration according to an embodiment of the present invention. 
         FIG. 2  is a chart correlating wired LAN communication availability and enabled network interface according to an embodiment of the present invention. 
         FIG. 3  is a chart correlating examples of network settings and enabled network interface. 
         FIG. 4  is a diagram illustrating examples of possible power statuses and network communication availability in each power status. 
         FIGS. 5A ,  5 B,  5 C, and  5 D are charts that illustrate which network interface gets enabled when change in the status of wired LAN communication availability, change in network settings, and change of the power status occurs as the switching event of network interface occurs. 
         FIG. 6  is a flowchart illustrating changing which network interface gets enabled depending on the setting of network interface. 
         FIG. 7  is a flowchart illustrating checking the power status before determining which network interface ultimately gets enabled. 
         FIG. 8  is a flowchart illustrating checking whether or not device error occurs in the network interface which is to be enabled. 
         FIG. 9  is a flowchart illustrating determining whether or not network interface is switched after waiting for a predefined period of time in case of detecting change in the status of wired LAN communication availability. 
     
    
    
     DETAILED DESCRIPTION OF THE INVENTION 
     In describing preferred embodiments illustrated in the drawings, specific terminology is employed for the sake of clarity. However, the disclosure of this patent specification is not intended to be limited to the specific terminology so selected, and it is to be understood that each specific element includes all technical equivalents that operate in a similar manner and achieve a similar result. 
     An embodiment of the present invention will be described in detail below with reference to the drawings. 
       FIG. 1  is a diagram illustrating a software configuration in this embodiment. A network interface control unit  2 , a wired LAN communication availability acquisition unit  3 , a network setting acquisition unit  4 , a power status acquisition unit  5 , an error status acquisition unit  6 , and a time measuring unit  7  are connected to a network interface determining unit  1 . 
     The network interface determining unit  1  determines which network interface gets enabled by considering wired LAN communication availability status, network setting, power status of the apparatus, and error status of the apparatus. 
     The network interface control unit  2  allocates IP addresses for wired LAN and wireless LAN so that they can execute IP communication (enables network interface), and switches wired LAN and wireless LAN to the status not available for IP communication (disables network interface). 
     The wired LAN communication availability acquisition unit  3  detects any change in the status of wired LAN communication availability. Also, the wired LAN communication availability acquisition unit  3  acquires the status of wired LAN communication availability. The network setting acquisition unit  4  detects change in network settings. Also, the network setting acquisition unit  4  acquires network settings set in the apparatus. It should be noted that network settings are user settings necessary for network communication, such as DHCP availability, IP address setting, subnet mask, and SSID. 
     The power status acquisition unit  5  detects change in the power status of the apparatus. Also, the power status acquisition unit  5  acquires the power status of the apparatus. The error status acquisition unit  6  detects any error that occurs in the apparatus. The time measuring unit  7  determines that a predefined period of time has elapsed. 
       FIG. 2  is a chart correlating wired LAN communication availability and enabled network interface. More specifically,  FIG. 2  shows an example of the logic used in determining which network interface gets enabled depending on wired LAN communication availability in the communications apparatus that includes a plurality of network interfaces. In  FIG. 2 , an example in which wired LAN gets enabled if wired LAN communication is available and wireless LAN gets enabled if wired LAN communication is not available is shown. The wired LAN communication availability acquisition unit  3  detects change in the status of wired LAN communication availability and acquires the status of wired LAN communication availability with reference to an example such as that shown in  FIG. 2 , and the network interface determining unit  1  switches network interface. 
       FIG. 3  is a chart correlating examples of network settings and enabled network interface.  FIG. 3  shows an example of settings for deciding priority to determine which network interface gets enabled in the communications apparatus that includes a plurality of network interfaces. How network interface is switched is determined by settings set by a user. The network setting acquisition unit  4  detects change in the network settings and acquires the network settings, and the network interface determining unit determines whether or not it switches network interface. 
     Switching network interface is determined automatically only if wired LAN and wireless LAN are used exclusively, so in case a user wants to keep on using either network, the unintended switching process of network interface is not executed even if the user connects or removes a wired LAN cable for greater convenience. 
       FIG. 4  is a diagram illustrating examples of possible power statuses and network communication availability in each power status. The power status acquisition unit  5  detects change in the power status of the apparatus and acquires the power status with considering power status such as shown in  FIG. 4 , and the network interface determining unit  1  determines whether or not network interface is switched. 
     Switching process of network interface is not executed needlessly since a situation in which the network interface cannot be switched due to the power status of the apparatus after trying to switch network interface when the status of wired LAN communication availability is changed does not occur, and that improves efficiency. 
     Also, switching to wired LAN or wireless LAN is not executed needlessly in a situation in which the network interface cannot be switched due to the power status or the apparatus after trying to switch from wireless LAN to wired LAN or from wired LAN to wireless LAN does not occur, and that improves efficiency. 
       FIGS. 5A ,  5 B,  5 C, and  5 D are charts that illustrate which network interface gets enabled when change in the status of wired LAN communication availability, change in network settings, and change of the power status occurs as the switching event of network interface. 
     Other network switching events in addition to events described above are conceivable. Determining whether or not network interface is switched automatically with reference to a plurality of conditions and switching network interface automatically if necessary is the technical feature of this embodiment. 
       FIG. 6  is a flowchart illustrating changing which network interface gets enabled depending on the setting of network interface. 
     If the status of wired LAN communication availability is changed after a network switching event occurs (step S 1 ), the wired LAN communication availability acquisition unit  3  detects the status of wired LAN communication availability (S 2 ). If the network setting is changed, the network setting acquisition unit  4  detects change in the network settings (S 3 ) and determining which network interface gets enabled is started (S 4 ). 
     The network setting acquisition unit  4  sets network setting (S 5 ). If the network setting set in the apparatus is wired LAN (S 6 ), the network interface determining unit  1  determines whether or not wired LAN is available by checking the wired LAN communication availability acquisition unit  3  (S 10 ). If wired LAN is available (YES in S 10 ), the network interface control unit  2  enables wired LAN (S 11 ). If wired LAN is not available (NO in S 10 ), the process returns to the beginning. 
     If the network setting is prioritizing wired LAN (S 7 ), the network interface determining unit  1  determines whether or not wired LAN is available by checking the wired LAN communication availability acquisition unit  3  (S 12 ). If wired LAN is available (YES in S 12 ), the network interface control unit  2  enables wired LAN (S 11 ). If wired LAN is not available (NO in S 10 ), the network interface control unit  2  enables wireless LAN (S 13 ). 
     If the network setting is set to wireless LAN (S 8 ), the network interface control unit  2  enables wireless LAN (S 13 ). If the network setting is set to disable (S 9 ), the process returns to the beginning. 
       FIG. 7  is a flowchart illustrating checking the power status before determining which network interface ultimately gets enabled. 
     If the status of wired LAN communication availability is changed after network switching event occurs (S 21 ), the wired LAN communication availability acquisition unit  3  detects the status of wired LAN communication availability (S 22 ). If the network setting is changed, the network setting acquisition unit  4  detects change in the network settings (S 23 ). The power status acquisition unit  5  detects change in the power status if the power status is changed (S 24 ), and determining which network interface gets enabled is started (S 25 ). 
     The network setting acquisition unit  4  sets network setting (S 26 ). If the network setting set in the apparatus is wired LAN (S 27 ), the network interface determining unit  1  determines whether or not wired LAN is available by checking the wired LAN communication availability acquisition unit  3  (S 31 ). If wired LAN is not available (NO in S 31 ), the process returns to the beginning. 
     If wired LAN is available (YES in S 31 ), the network interface determining unit  1  determines whether or not the power status is one in which wired LAN can be enabled by checking the power status acquisition unit  5  (S 32 ). If the power status is one in which wired LAN can be enabled (YES in S 32 ), the network interface control unit  2  enables wired LAN (S 33 ). Otherwise (NO in S 32 ), the process returns to the beginning. 
     If the network setting is set to prioritizing wired LAN (S 28 ), the network interface determining unit  1  determines whether or not wired LAN is available by checking the wired LAN communication availability acquisition unit  3  (S 34 ). If wired LAN is available (YES in S 34 ), the network interface determining unit  1  determines whether or not the power status is one in which wired LAN can be enabled by checking the power status acquisition unit  5  (S 32 ). The following steps are the same as described above. 
     If wired LAN is not available (NO in S 34 ), the network interface determining unit  1  determines whether or not the power status is one in which wireless LAN can be enabled by checking the power status acquisition unit  5  (S 35 ). If the power status is one in which wireless LAN can be enabled (YES in S 35 ), the network interface control unit  2  enables wireless LAN (S 36 ). Otherwise (NO in S 35 ), the process returns to the beginning. 
     If the network setting is set to wireless LAN (S 29 ), the network interface determining unit  1  determines whether or not wireless LAN is available by checking the power status acquisition unit  5  (S 35 ). The following steps are the same as described above. If the network setting is set to disable (S 30 ), the process returns to the beginning. 
       FIG. 8  is a flowchart illustrating checking whether or not device error occurs in the network interface which is to be enabled. The same steps as in  FIG. 7  are given the same reference numerals and a description thereof is omitted. 
     The network setting acquisition unit  4  sets network setting (S 26 ). If the network setting set in the apparatus is wired LAN (S 27 ), the network interface determining unit  1  determines whether or not wired LAN is available by checking the wired LAN communication availability acquisition unit  3  (S 31 ). If wired LAN is not available (NO in S 31 ), the process returns to the beginning. If wired LAN is available (YES in S 31 ), the network interface determining unit  1  determines whether or not device error occurs in wired LAN by checking the error status acquisition unit  6  (S 41 ). If device error occurs in wired LAN (NO in S 41 ), the process returns to the beginning. 
     If device error does not occur in wired LAN (YES in S 41 ), the network interface determining unit  1  determines whether or not the power status is one in which wired LAN can be enabled by checking the power status acquisition unit  5  (S 32 ). If the power status is one in which wired LAN can be enabled (YES in S 32 ), the network interface control unit  2  enables wired LAN (S 33 ). Otherwise (NO in S 32 ), the process returns to the beginning. 
     If the network setting is set to prioritizing wired LAN (S 28 ), the network interface determining unit  1  determines whether or not wired LAN is available by checking the wired LAN communication availability acquisition unit  3  (S 34 ). If wired LAN is available (YES in S 34 ), the network interface determining unit  1  determines whether or not device error occurs in wired LAN by checking the error status acquisition unit  6  (S 42 ). If device error does not occur in wired LAN (YES in S 42 ), the network interface determining unit  1  determines whether or not the power status is one in which wired LAN can be enabled by checking the power status acquisition unit  5  (S 32 ). The following steps are the same as described above. 
     If wired LAN is not available (NO in S 34 ) or device error occurs in wired LAN (NO in S 42 ), the network interface determining unit  1  determines whether or not device error occurs in wireless LAN by checking the error status acquisition unit  6  (S 43 ). If device error occurs in wireless LAN (NO in S 43 ), the process returns to the beginning. 
     If device error does not occur in wireless LAN (YES in S 43 ), the network interface determining unit  1  determines whether or not the power status is one in which wireless LAN can be enabled with reference to the power status acquisition unit  5  (S 35 ). If the power status is one in which wireless LAN can be enabled (YES in S 35 ), the network interface control unit  2  enables wireless LAN (S 36 ). Otherwise (NO in S 35 ), the process returns to the beginning. 
     If the network setting is set to wireless LAN (S 29 ), the network interface determining unit  1  determines whether or not device error occurs in wired LAN by checking the error status acquisition unit  6  (S 43 ). The following steps are the same as described above. If the network setting is set to disable (S 30 ), the process returns to the beginning. 
     In the embodiment described above, switching process of network interface is not executed needlessly since situation in which network interface cannot be switched due to the error status of the apparatus after trying to switch network interface when the status of wired LAN communication availability is changed does not occur, and that improves efficiency. 
     Also, switching process to wired LAN or wireless LAN is not executed needlessly since situation in which network interface cannot be switched due to the error status or the apparatus after trying to switch from wireless LAN to wired LAN or from wired LAN to wireless LAN does not occur, and that improves efficiency. 
       FIG. 9  is a flowchart illustrating determining whether or not network interface is switched after waiting for a predefined period of time in case of detecting change in the status of wired LAN communication availability. The same steps as in  FIG. 8  are given the same reference numerals and descriptions thereof are omitted. 
     If the status of wired LAN communication availability is changed after network switching event occurs (S 21 ), the wired LAN communication availability acquisition unit  3  detects that the status of wired LAN communication availability is changed (S 22 ) and the time measuring unit  7  measures the passage of a predefined period of time. After the time measuring unit  7  waits for a predefined period of time (S 51 ), the network interface determining unit  1  starts determining which network interface gets enabled (S 25 ). The following steps are the same as described above. 
     For example, if speed setting of wired LAN is changed, negotiation process on the data link layer level is executed temporarily and it is impossible to communicate by using wired LAN during that time. In this situation, the status of wired LAN availability makes the transition from available, not available, to available. 
     In the embodiment described above, switching process to wired LAN or wireless LAN is not executed needlessly since it is not necessary to switch network interface each time the status changes in case the status of wired LAN communication availability changes continuously during predefined period of time, and that improves efficiency of the communications apparatus. 
     Numerous additional modifications and variations are possible in light of the above teachings. It is therefore to be understood that, within the scope of the appended claims, the disclosure of this patent specification may be practiced otherwise than as specifically described herein. 
     As can be appreciated by those skilled in the computer arts, this invention may be implemented as convenient using a conventional general-purpose digital computer programmed according to the teachings of the present specification. Appropriate software coding can readily be prepared by skilled programmers based on the teachings of the present disclosure, as will be apparent to those skilled in the software arts. The present invention may also be implemented by the preparation of application-specific integrated circuits or by interconnecting an appropriate network of conventional component circuits, as will be readily apparent to those skilled in the electrical engineering arts.