BACKGROUND

Field

Aspects of the present invention generally relate to communication technology.

Description of the Related Art

Recently, it has been observed that electronic devices, such as a digital camera, a printer, a cellular phone, smartphones, etc., are provided with a wireless communication function enabling them to connect to wireless networks. In particular, these devices are using their wireless communication functions to communicate with each other via a wireless local-area network (LAN).

To connect electronic devices to a wireless network, it is necessary to set various communication parameters, such as an encryption method, an encryption key, an authentication method, an authentication key, etc. As a technique for facilitating setting of these communication parameters, it has been proposed that a mobile terminal read a quick response (QR) Code® that indicates communication parameters and that is displayed by an electronic device, and set the read communication parameters to an access point (see Japanese Patent Laid-Open No. 2014-60623).

As described in Japanese Patent Laid-Open No. 2014-60623, capturing of an image of code information such as a two-dimensional code in which a large amount of information is encoded triggers setting of communication parameters. This alleviates troublesome input operations performed by a user. In Japanese Patent Laid-Open No. 2014-60623, a method is described in which a QR Code® including identification information for identifying a device presenting the QR Code® is displayed, and in which a device photographing the QR Code® specifies a target device to which communication parameters are to be set.

Identification information with which a device is identified can be dynamically changed. For example, an administrator or the like can rewrite a MAC address in a wireless LAN when necessary. In Wi-Fi Direct®, there are two types of identification information of a device, the P2P device address and P2P interface address. In Wi-Fi Direct®, protocol processing is performed to form a wireless network (P2P group). When a P2P group is to be formed, the P2P interface address is used to identify a device. After a P2P group is formed, the P2P interface address is used to identify a device in communication in the P2P group. Any value can be set to the P2P device address and P2P interface address in a device, and different values can be dynamically set to the P2P device address and P2P interface address.

When identification information of a device is thus allowed to be dynamically changed, a device capable of displaying a QR Code® for which information is dynamically changed can display its identification information that has been changed as appropriate. However, when a QR Code® is displayed on a label or the like, it is not possible to dynamically change information indicated by the QR Code®. Therefore, under such circumstances, it is not possible for a QR Code® to include information for identifying a device.

SUMMARY

Aspects of the present invention provide a communication apparatus that performs a communication-parameter setting process efficiently in accordance with whether identification information of an apparatus with which the communication-parameter setting process is to be performed has been obtained.

According to an aspect of the present invention, a communication apparatus includes an acquiring unit, a determination unit, and a transmitting unit. The acquiring unit acquires, from a different communication apparatus, information about a communication-parameter setting process. The determination unit determines whether the acquired information includes identification information for identifying the different communication apparatus. The transmitting unit transmits, when an authentication request used in an authentication process performed in the communication-parameter setting process is to be transmitted, if the determination unit determines that the identification information is included, the authentication request by unicast based on the identification information and by broadcast if the determination unit determines that the identification information is not included.

Further features of aspects of the present invention will become apparent from the following description of exemplary embodiments with reference to the attached drawings.

