蓝牙LE:地址类型 [英] Bluetooth LE : Address Type

查看:351
本文介绍了蓝牙LE:地址类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究iBeacon技术,找不到关于地址类型的特定问题的任何答案. 我找到了说明蓝牙类型的文档(蓝牙规范),但是我似乎找不到如何在两种类型(公共和随机)之间进行选择的方法.

I am working on the iBeacon technology and I can't find any answer to a particular point concerning the address type. I found the documenation (bluetooth specification) explaining what are the address types but I can't seem to find how to chose between the two types (public and random).

这是我找到它的一个示例(这是iBeacon在Raspberry PI上传输的嗅探数据包):

Here is an example where I found it (it is a sniffed packet transmitted by an iBeacon on a Raspberry PI) :

http://i.stack.imgur.com/QF5gf.png http://i.stack.imgur.com/NHY6x.png (对不起,我由于我的声誉而无法发布图片)

http://i.stack.imgur.com/QF5gf.png and http://i.stack.imgur.com/NHY6x.png (sorry I can't post images yet because of my reputation)

让我们尝试提出问题,并使其更加具体:

Let's try to ask questions and make it more specific :

  • 由于公共地址必须有效,因此可能是有一个生成随机地址的命令(但在格式化地址时正确)以将其分配给相关设备?

  • Since a public address has to be valid, might it be that there is a command to generate a random one (yet correct in formatting the address) to assign it to the concerned device?

如果上述内容正确,那么命令是什么?以及如何回滚(到主要公共地址)?

If the above is true : what would be the command? and how do you roll back (to the primary public address)?

或者是否有一个开关"可以在(有效的)公共地址之间进行选择或生成一个随机的地址?

Or is there a "switch" that allows to chose between the (valid) public address or to generate a random one?

谢谢.

推荐答案

这里的命令看起来很像您想要的命令. 有关详细信息,请参见此处.

Here's a command that looks pretty much like what you want. See here for details.

Set Static Address Command
==========================

Command Code:       0x002B
Controller Index:   <controller id>
Command Parameters: Address (6 Octets)
Return Parameters:

This command allows for setting the static random address. It is
only supported on controllers with LE support. The static random
address is suppose to be valid for the lifetime of the
controller or at least until the next power cycle. To ensure
such behavior, setting of the address is limited to when the
controller is powered off.

The special BDADDR_ANY address (00:00:00:00:00:00) can be used
to disable the static address.

When a controller has a public address (which is required for
all dual-mode controllers), this address is not used. Only when
the controller information reports BDADDR_ANY (00:00:00:00:00:00),
it is required to configure a static address first.

If privacy mode is enabled and the controller is single mode
LE only without a public address, the static random address is
used as identity address.

This command generates a Command Complete event on success or a
Command Status event on failure.

Possible errors:    Rejected
            Not Supported
            Invalid Parameters
            Invalid Index

在我看来,BlueZ的隐私功能正在积极开发中,可能尚未完成. 从2014/02/18起查看此提交.如果要尝试使用最新更新,则必须从源代码编译BlueZ.

It looks to me like the privacy features of BlueZ are under current active development and may not be complete yet. See this commit from 2014/02/18. If you want to try this with the latest updates, you will have to compile BlueZ from source.

这篇关于蓝牙LE:地址类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆