计算android中蓝牙设备之间的距离
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11846506/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Calculate distance Between Bluetooth device in android
提问by Stack Overflow User
I want to calculate distance Bluetooth Paired device from android mobile. I am new in Android Bluetooth Concept can any one suggest me it's possible or not possible in android sdk.if it's possible post any code or tutorial link!
我想从安卓手机计算蓝牙配对设备的距离。我是 Android 蓝牙概念的新手,任何人都可以建议我在 android sdk 中可能或不可能。如果可能,请发布任何代码或教程链接!
回答by alex
The Bluetooth signal strengthdistance relation depends on the devices (built-in Bluetooth device, antenna, actual orientation of device), current way the persons hold their devices, objects in-between... You could measure this for a pair of devices for a given situation and use these information.
该蓝牙信号强度距离关系取决于设备上(内置蓝牙设备,天线,设备的实际方向),电流方式的人持有他们的设备,物体之间......你可以衡量此一对设备进行给定的情况并使用这些信息。
A larger and more general solution would incorporate an external Bluetooth network. Bluetooth triangulationis the basic concept, that will help. The link will give an insight on certainties that are achievable with such a setup. Take is as an upper limit, a device to device approach will be worse.
更大和更通用的解决方案将包含外部蓝牙网络。蓝牙三角测量是基本概念,这将有所帮助。该链接将深入了解此类设置可实现的确定性。以是作为上限,设备到设备的方法会更糟。
回答by Saasha
You can't. Maybe, you can get approximate value from signal indicator but it's too much subject because of envirounment - is there something between connected devices, some reflection surfaces, etc.
你不能。也许,您可以从信号指示器中获得近似值,但由于环境的原因,主题太多了 - 连接的设备、某些反射表面等之间是否存在某些问题。
回答by Tomá? Hübelbauer
The EE Stack Exchange site has a more complete answerwhich includes a mention of Apple using 802.11v for determining if Apple Watch is close to a MacBook.
EE Stack Exchange 站点有一个更完整的答案,其中提到 Apple 使用 802.11v 来确定 Apple Watch 是否接近 MacBook。
Bluetooth uses radio, and radio travels at the speed of light. A 1cm round trip will take less than 100ps. Timing something that short will be tricky, probably you'll want a 10GHz clock, though there are other options. But even then, Bluetooth isn't designed to instantly echo the radio message. If you receive, process and re-transmit the message, then the processing delay will be much longer than the time of flight, and will vary randomly by at least the period of the clock used with the Bluetooth chip.
蓝牙使用无线电,无线电以光速传播。1 厘米的往返行程将花费不到 100 ps。对这么短的时间进行计时会很棘手,尽管还有其他选择,但您可能需要 10GHz 时钟。但即便如此,蓝牙也并非旨在立即响应无线电消息。如果您接收、处理并重新传输消息,那么处理延迟将比飞行时间长得多,并且至少会随机变化蓝牙芯片使用的时钟周期。
回答by raynnier
There is a way you can research, is coding a response time. just calculate the bluethooth response time in nano secs, physically measure the distance between the devices and make a tree rule... is the same concept of GPS. This is a Laboratory work. I have a project that i have to develop it, in schedule i will taking it in a month.
有一种方法可以研究,是编码响应时间。只需计算以纳秒为单位的蓝牙响应时间,物理测量设备之间的距离并制定树规则......与 GPS 的概念相同。这是一项实验室工作。我有一个项目,我必须开发它,我将在一个月内按计划进行。
回答by Nuum
OFC, its possible. It just requires ultra precise app, build to calculate "pings" between the two objects - kinda like ekko-location or laser distance measurement - its about how much time a specific signal travels back and forth.
OFC,它可能。它只需要超精确的应用程序,构建来计算两个物体之间的“ping”——有点像 ekko 定位或激光距离测量——它关于特定信号来回传播的时间。