BACKGROUND

Field

The present invention relates to a communication apparatus.

Description of the Related Art

There are communication apparatuses capable of operating in a plurality of communication modes, like performing wireless communication in an infrastructure mode and a direct mode in parallel, as discussed in Japanese Patent Application Publication Laid-Open No. 2014-216956.

The use of wireless communications has been increasing in recent years, and there has been a demand to improve the convenience of wireless communications.

The present disclosure is directed to improving the convenience of wireless communications.

SUMMARY

According to an aspect of the present invention, a communication apparatus that includes a communication unit configured to perform a first communication mode in which the communication unit communicates with a terminal apparatus via wireless communication with an external wireless base station and a second communication mode in which the communication unit directly performs wireless communication with the terminal apparatus without intervention of the external wireless base station, the communication apparatus includes a setting unit configured to enable at least either one of the first communication mode and the second communication mode, and a control unit configured to perform communication processing in the first communication mode and the second communication mode to set a communication period of the first communication mode per unit time to be longer than that of the second communication mode in a case where both the first communication mode and the second communication mode are enabled, a communication partner apparatus in the first communication mode is determined, and a communication partner apparatus in the second communication mode is not determined, and perform the communication processing in the first communication mode and the second communication mode to set the communication period of the second communication mode per unit time to be longer than that of the first communication mode in a case where both the first communication mode and the second communication mode are enabled, the communication partner apparatus in the second communication mode is determined, and the communication partner apparatus in the first communication mode is not determined.

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

