缓存ATT值是否呈蓝色,如何清除缓存? [英] Does blued cache ATT values, and how to clear the cache?

查看:204
本文介绍了缓存ATT值是否呈蓝色,如何清除缓存?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到有关上的蓝牙LE错误的任何解决方法OSX .特别是,我想知道OSX在读取Bluetooth LE GATT表时出了什么问题.因此,我正在从硬件IO的 PacketLogger中查看L2CAP数据包XCode工具.

I am trying to find any workarounds for a Bluetooth LE bug on OSX. In particular, I want to know where OSX goes wrong in reading the Bluetooth LE GATT table. Thus, I am viewing the L2CAP packets in PacketLogger from Hardware IO Tools for XCode.

当我使用Bluetooth Explorer连接到Bluetooth LE设备时,我希望看到3.4.4.9 按组类型请求读取(uuid = 0x2800«主要服务»,startingHandle = 0x0001,endingHandle = 0xffff)以发现主要服务(或按类型查找值请求(uuid = 0x2800,值:服务的uuid)),然后是3.4.4.1 按类型请求读取 (uuid = 0x2803«特征»)来发现特征.这是我从iPhone(使用CC2540)嗅探数据包时看到的.

When I use Bluetooth Explorer to connect to the Bluetooth LE device, I am expecting to see 3.4.4.9 Read By Group Type Request(uuid=0x2800 «Primary Service», startingHandle=0x0001, endingHandle=0xffff) to discover primary services (or Find By Type Value Request(uuid=0x2800, value:uuid of service)), followed by 3.4.4.1 Read By Type Request(uuid=0x2803 «Characteristic») to discover characteristics. This is what I see when I sniff the packets from an iPhone (using a CC2540).

但是在OSX上,连接后我在PacketLogger(和CC2540)中看到的唯一L2CAP请求是:

But on OSX, the only L2CAP requests that I see in PacketLogger (and the CC2540) after connecting are:

  1. 按类型请求读取(attributeType = 0x2803,startingHandle = 0x001a,endingHandle = 0x001a)
  2. 按类型请求读取(attributeType = 0x2802«Include»,startingHandle = 0x0001,endingHandle = 0x0004)
  3. 按类型请求读取(attributeType = 0x2802,startingHandle = 0x0005,endingHandle = 0x0009)
  4. 按类型请求读取(attributeType = 0x2802,startingHandle = 0x0010,endingHandle = 0x0019)
  5. 按类型请求读取(attributeType = 0x2802,startingHandle = 0x001a,endingHandle = 0x001a)
  6. 按类型请求读取(attributeType = 0x2803,startingHandle = 0x001a,endingHandle = 0x001a)
  7. 按类型请求读取(attributeType = 0x2802,startingHandle = 0x0021,endingHandle = 0x0027)
  8. 按类型请求读取(attributeType = 0x2802,startingHandle = 0x002b,endingHandle = 0x002e)
  1. Read By Type Request(attributeType=0x2803, startingHandle=0x001a, endingHandle=0x001a)
  2. Read By Type Request(attributeType=0x2802 «Include», startingHandle=0x0001, endingHandle=0x0004)
  3. Read By Type Request(attributeType=0x2802, startingHandle=0x0005, endingHandle=0x0009)
  4. Read By Type Request(attributeType=0x2802, startingHandle=0x0010, endingHandle=0x0019)
  5. Read By Type Request(attributeType=0x2802, startingHandle=0x001a, endingHandle=0x001a)
  6. Read By Type Request(attributeType=0x2803, startingHandle=0x001a, endingHandle=0x001a)
  7. Read By Type Request(attributeType=0x2802, startingHandle=0x0021, endingHandle=0x0027)
  8. Read By Type Request(attributeType=0x2802, startingHandle=0x002b, endingHandle=0x002e)

这些请求不足以发现服务,但是Bluetooth Explorer此时列出了所有服务UUID.这表明OSX已经知道服务在此Bluetooth LE设备上的位置.会缓存设备服务并在启动时读取它们吗?如果是这样,如何清除缓存?

These are not enough requests to discover the services, yet Bluetooth Explorer lists all the service UUIDs at this point. This indicates that OSX already knows where the services are on this Bluetooth LE device. Does blued cache device services and read them on startup? If so, how can I clear the cache?

我曾尝试过关闭蓝牙,消除蓝色并重新启动OSX,但是每次OSX都不会重新发现服务时.

I have tried turning off Bluetooth, killing blued, and restarting OSX, but every time OSX never rediscovers the services.

推荐答案

是的,blued会缓存Bluetooth LE GATT表.如果缓存不正确,请执行以下操作将其删除,这要感谢:

Yes, blued does cache the Bluetooth LE GATT table. If the cache is bad, do the following to delete it, thanks to "blued process is killing my CPU":

  1. 删除/Library/Preferences/com.apple.Bluetooth.plist.这将消除对所有绑定的Bluetooth和Bluetooth LE设备的了解.
  2. 杀死/usr/sbin/blued.它将通过启动重新启动.
  3. 再次运行Bluetooth LE程序.现在,PacketLogger将显示按组类型读取的请求,以重新发现主要服务.
  1. Delete /Library/Preferences/com.apple.Bluetooth.plist. This will remove knowledge of all bonded Bluetooth and Bluetooth LE devices.
  2. Kill /usr/sbin/blued. It will be restarted by launchd.
  3. Run Bluetooth LE program again. PacketLogger will now show Read By Group Type requests to rediscover the primary services.

根据蓝牙4.0第3卷G部分第2.5.2节属性缓存",当中心与外围设备(不仅仅是配对)建立绑定"时,允许缓存.我不确定如何验证中央确实与外围设备绑定,但是我认为确实如此.

Caching is allowed when the central has established a "bond" with the peripheral (not just paired), according to Bluetooth 4.0 Volume 3 Part G Section 2.5.2 Attribute Caching. I’m not sure how to verify that the central indeed bonded with the peripheral, but I assume that it did.

这篇关于缓存ATT值是否呈蓝色,如何清除缓存?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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