1. Field of the Invention
The present invention relates to a communication apparatus capable of notifying temporary disconnection from a network, a communication system, a method of controlling the communication apparatus, and a storage medium.
2. Description of the Related Art
In recent years, as a printing apparatus, such as a printer or a multifunction peripheral (MFP), there has been widely used one which has a wireless LAN function. The printing apparatus equipped with such a wireless LAN function is connected to an access point, as a client, and communicates with a personal computer (PC), a mobile terminal, and the like, via the access point.
The printing apparatus connected to the wireless LAN can notify other apparatuses, such as various types of servers which are connected to the wireless LAN of a state of the printing apparatus, whereby the servers can manage the printing apparatus. For example, Japanese Patent Laid-Open Publication No. H07-141261 discloses a technique in which when a predetermined communication apparatus connected to a network is powered off, information on the power-off is notified to a network monitoring apparatus.
On the other hand, in order to directly communicably connect a plurality of communication apparatuses, the standard of Wi-Fi Direct (registered trademark) is established by Wi-Fi Alliance. The Wi-Fi Direct defines a protocol for determining which role, an access point or a client, is to be assigned to each of communication apparatuses including printing apparatuses and PCs. By performing this protocol, it is possible to automatically determine a communication apparatus which is to be operated as the access point and a communication apparatus which is to be operated as the client. That is, by using the Wi-Fi Direct, it is unnecessary to provide an access point separately, and the communication apparatuses can directly communicate with each other.
Now, the outline of a processing sequence of the Wi-Fi Direct will be described hereafter. Here, a printing apparatus and a mobile terminal are taken as examples of the communication apparatuses, and it is assumed that both of them support the Wi-Fi Direct.
First, the printing apparatus and the mobile terminal mutually search for communication partners, and identify their communication partners. After identifying the communication partners, the printing apparatus and the mobile terminal determine which of them is to play the role of the access point (Group Owner) and which of them is to play the role of the client (Client). Here, it is assumed that the printing apparatus is determined to be the access point and the mobile terminal is determined to be the client.
Next, parameters for connecting the printing apparatus as the access point to the mobile terminal as the client are provided by using WPS (Wi-Fi Protected Setup) established by Wi-Fi Alliance. This processing causes the parameters to be shared between the printing apparatus and the mobile terminal, and the printing apparatus and the mobile terminal establish secure connection using the shared parameters.
When the secure connection has been completed, the printing apparatus and the mobile terminal perform addressing (IP connection) for performing IP communication. The printing apparatus (access point) operates as a DHCP server, and gives an IP address to the mobile terminal (client). By performing the above-described processing sequence, the printing apparatus and the mobile terminal can directly perform wireless communication using the Wi-Fi Direct without an access point separately provided.
An infrastructure mode in which the printing apparatus is communicably connected to the wireless LAN via the access point, and a Wi-Fi Direct mode in which the printing apparatus is communicably connected to another communication apparatus using the Wi-Fi Direct are normally operate in a mutually exclusive manner. Therefore, when the Wi-Fi Direct mode is set to the printing apparatus in the infrastructure mode, the connection of the printing apparatus to the wireless LAN is terminated, whereby it is impossible for another apparatus connected to the wireless LAN to communicate with the printing apparatus.
In the technique disclosed in Japanese Patent Laid-Open Publication No. H07-141261, the predetermined communication apparatus sends only a power-off notification. Therefore, when the predetermined communication apparatus shifts from the infrastructure mode to the Wi-Fi Direct mode to temporarily terminate the infrastructure mode, the predetermined communication apparatus cannot send an appropriate notification to the other apparatus connected to the wireless LAN.
For example, assuming that when the printing apparatus as an example of the predetermined communication apparatus shifts from the infrastructure mode to the Wi-Fi Direct mode, the printing apparatus transmits the same notification as when the printing apparatus is powered off, to the print server as an example of the other apparatus connected to the wireless LAN. In this case, when a print job is sent from the print server to the printing apparatus, a transmission error occurs, and the print job is terminated by the error. Further, in a case where a power management server connected to the wireless LAN manages the amount of power consumption of the printing apparatus, the power management server stops calculating the integral power consumption of the printing apparatus although the printing apparatus is operating in the Wi-Fi Direct mode. This makes it impossible to perform accurate power management of the printing apparatus.