IOS BLE 缓存清除

问题

在做一款基于蓝牙BLE通信的智能硬件,设备的蓝牙服务是动态变化的,发现 IOS 存在蓝牙服务缓存。
具体表现是,IOS 搜索发现过硬件的蓝牙服务后,断开蓝牙连接,设备重启更新了蓝牙服务, IOS 再次搜索,扫描到的蓝牙服务仍然是旧的。

原因

事实上,缓存现象不是 IOS 独有的,在 BLE 规范中定义了缓存标准,参考 蓝牙4.0规范 vol 3, Part G, 2.5.2 Attribute Caching。这是为了优化,在客户端重新连接服务端时,可以重用上次发现的蓝牙服务信息。

Attribute caching is an optimization that allows the client to discover the Attribute information such as Attribute Handles used by the server once and use
the same Attribute information across reconnections without rediscovery. Without caching the Attribute information, the client shall rediscover the Attribute
information at each reconnection. With caching, time is saved and a significant
amount of packets exchanged between the client and server is not required.
The Attribute information that shall be cached by a client is the Attribute H

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值