ios - Ble广告数据慢间隔时间

标签 ios iphone bluetooth-lowenergy core-bluetooth

目前,我正在将广告数据从 BLE 设备发送到我的 iOS 应用程序并打印它们的值。一开始我能够打印每个广告数据,但一段时间后,似乎不再一致地调用用于打印传入数据包的 didDiscoverPeripheral 方法,并且自应用程序启动以来,时间间隔增加了。

有什么理由吗? 谢谢,

最佳答案

由于我在未连接到 BLE 设备的情况下接收广告数据,因此未调用以下内容:

NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], CBCentralManagerScanOptionAllowDuplicatesKey, nil];

[_manager scanForPeripheralsWithServices:nil options:options];

上面的代码将在设备发送到 iPhone 的每个广告包中获得 didDiscoverPeripheral"回调。

希望对您有所帮助!

关于ios - Ble广告数据慢间隔时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27776885/

相关文章:

iphone - 在 cellForRowAtIndexPath 中更改 UITableViewCell 高度

bluetooth - 如何使用像 hcitool lescan 这样的 bluetoothctl 来报告重复的邻近信标

android - BluetoothGattCallBack 函数 onCharacteristicRead 仅调用一次

ios - Xcode 9.0 iOS11 搞砸了正确的 UIBarButtonItem

ios - 默认大小类似乎只适用于 iPad (XCode 6)

iphone - 从后台返回时应用程序崩溃

iphone - Corona SDK 如何工作? Lua 是否转换为 Objective C?

c++ - 如何使用 Qt 检测蓝牙崩溃或关机?

ios - 使用 Parse 进行异步处理时遇到问题

ios - AFNetworking iOS 添加 curl