A mobile terminal that measures a distance to an image forming apparatus, which transmits, at a constant interval, an advertisement packet, the mobile terminal comprising:
- at least one memory storing instructions;
- and
- at least one processor that executes the instructions to:
- receive, from the image forming apparatus at the constant interval, the advertisement packet, which includes information for performing a first distance measurement using a signal strength of received radio waves, to measure a first distance between the image forming apparatus and the mobile terminal;
- transmit, to the image forming apparatus, an inquiry wave for performing a second distance measurement using a time of arrival of radio waves, to measure a second distance between the image forming apparatus and the mobile terminal;
- receive, from the image forming apparatus, a response wave to be used for the second distance measurement;
- cause the image forming apparatus to stop outputting the advertisement packet in accordance with reception of the inquiry wave by the image forming apparatus;
- perform the second distance measurement to measure the second distance using the response wave received from the image forming apparatus;
- perform the first distance measurement to measure the first distance using the advertisement packet received from the image forming apparatus together with the received response wave;
- and
- determine presence or absence of an obstacle between the mobile terminal and the image forming apparatus based on a difference between the second distance and the first distance, wherein:
- in a case where a difference between the first and second distances exists, the obstacle is determined to be present;
- and
- in a case where no difference between the first and second distances exists, the obstacle is determined to be absent.