2014-03-03 81 views
3

我正在使用iBeacon技术,我无法找到任何有关地址类型的特定点的答案。 我发现文档(蓝牙规范)解释什么是地址类型,但我似乎无法找到如何选择两种类型(公共和随机)。蓝牙LE:地址类型

下面是一个例子,我发现它(这是由iBeacon显示在树莓PI传输的数据包嗅探):

http://i.stack.imgur.com/QF5gf.pnghttp://i.stack.imgur.com/NHY6x.png(抱歉,我不能发表图片还没有因为我的名气)

让我们试着问问题,使之更加具体:

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

  • 如果以上情况属实:命令是什么?以及如何回滚(到主要公共地址)?

  • 还是有一个“开关”,允许之间选择(有效)的公共地址或生成一个随机的吗?

谢谢。

回答

1

下面是一个看起来非常像你想要的命令。 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的隐私功能是根据目前的积极发展,可能尚不完整。 See this commit from 2014/02/18。如果你想用最新的更新来试试这个,你必须从源代码编译BlueZ。

+0

谢谢你指出这一点,我想这正是我正在寻找的! – ySiggen