Electronic device for determining location of external electronic device, and operation method of electronic device
An electronic device may include a communication circuit configured to perform communication via an ultra-wide band (UWB) band, and a processor. The processor may be configured to determine a first distance between the electronic device and an external electronic device based on first signals exchanged while the electronic device operates in a two-way ranging mode, switch from the two-way ranging mode to a one-way ranging mode in response to determining the first distance, determine a second distance between the electronic device and the external electronic device based on the first distance and second signals received from the external electronic device while the electronic device operates in the one-way ranging mode, and switch from the one-way ranging mode to the two-way ranging mode in response to determining that a specified condition related to distance between the electronic device and the external electronic device is satisfied.
1 . An electronic device comprising:
a communication circuit configured to perform data transmission and/or reception via an ultra-wide band (UWB); and
at least one processor,
wherein the at least one processor, individually and/or collectively, is configured to:
determine a first distance between the electronic device and an external electronic device based on first signals exchanged between the external electronic device and the electronic device while the electronic device operates in two-way ranging mode;
switch from the two-way ranging mode to a one-way ranging mode in response to determining the first distance between the electronic device and the external electronic device;
receive, from the external electronic device, second signals while the electronic device operates in the one-way ranging mode for determining an amount of change of distance between the electronic device and the external electronic device;
determine a second distance between the electronic device and the external electronic device based on the first distance and the amount of change of the distance; and
switch from the one-way ranging mode to the two-way ranging mode in response to determining that a specified condition related to distance between the electronic device and the external electronic device is satisfied.
2 . The electronic device of claim 1 , wherein the at least one processor, individually and/or collectively, is configured to switch from the one-way ranging mode to the two-way ranging mode in response to a number of receptions of the second signals being a specified number of times.
3 . The electronic device of claim 1 , wherein the at least one processor, individually and/or collectively, is configured to:
switch from the one-way ranging mode to the two-way ranging mode based on that the second distance between the electronic device and the external electronic device is more than a specified value.
4 . The electronic device of claim 1 , wherein the at least one processor, individually and/or collectively, is configured to switch from the one-way ranging mode to the two-way ranging mode based on that an amount of change in distance between the electronic device and the external electronic device is more than a specified value.
5 . The electronic device of claim 4 , wherein the at least one processor, individually and/or collectively, is configured to control to transmit a message indicating a switch from the one-way ranging mode to the two-way ranging mode to the external electronic device.
6 . The electronic device of claim 1 , wherein the at least one processor, individually and/or collectively, is configured to not switch to the one-way ranging mode when the first distance between the electronic device and the external electronic device is not determined while the electronic device operates in the two-way ranging mode.
7 . The electronic device of claim 1 , wherein the at least one processor, individually and/or collectively, is configured to check a switching condition of the one-way ranging mode, and configure the specified condition based on the switching condition of the one-way ranging mode.
8 . The electronic device of claim 1 , wherein the at least one processor, individually and/or collectively, is configured to:
in the two-way ranging mode, determine the first distance between the electronic device and the external electronic device based on the first signals,
determine, in the one-way ranging mode, an amount of change in a distance between the electronic device and the external electronic device, and
determine, in the one-way ranging mode, the second distance between the electronic device and the external electronic device based on the amount of change in the distance and the first distance between the electronic device and the external electronic device.
9 . The electronic device of claim 8 , wherein the at least one processor, individually and/or collectively, is configured to:
determine, in the two-way ranging mode, an error in the first distance between the electronic device and the external electronic device based on a specified time interval between first signals received from the external electronic device and a difference in reception times of the first signals, and
determine the amount of change in the distance based on the error, the specified time interval between the second signals, and the reception times of the second signals.
10 . An operation method of an electronic device, the method comprising:
determining a first distance between the electronic device and an external electronic device based on first signals exchanged between the external electronic device and the electronic device while the electronic device operates in a two-way ranging mode;
switching from the two-way ranging mode to a one-way ranging mode in response to determining the first distance between the electronic device and the external electronic device;
receiving, from the external electronic device, second signals while the electronic device operates in the one-way ranging mode for determining an amount of change of distance between the electronic device and the external electronic device;
determining a second distance between the electronic device and the external electronic device based on the first distance and the amount of change of the distance; and
switching from the one-way ranging mode to the two-way ranging mode in response to determining that that a specified condition related to distance between the electronic device and the external electronic device is satisfied.
11 . The operation method of claim 10 , wherein the switching to the two-way ranging mode comprises switching from the one-way ranging mode to the two-way ranging mode in response to a number of times the second signal is received reaching a specified number of times.
12 . The operation method of claim 10 , wherein the switching from the one-way ranging mode to the two-way ranging mode comprises:
switching from the one-way ranging mode to the two-way ranging mode based on the second distance between the external electronic device and the electronic device is more than a specified value.
13 . The operation method of claim 10 , wherein the switching to the two-way ranging mode comprises switching from the one-way ranging mode to the two-way ranging mode based on that an amount of change in the distance between the electronic device and the external electronic device is more than a specified value.
14 . The operation method of claim 13 , further comprising transmitting a message indicating a switch from the one-way ranging mode to the two-way ranging mode to the external electronic device.