我的问题是,iOS和各种Android手机从特定的ibeacon接收到BLE通告数据包的数量,例如,在特定信标的5分钟内,iOS接收到大约904个通告数据包,而android手机则接收到大约230至480之间的数据,具体取决于手机。
有谁知道是否有可以设置BLE模块扫描速率的设置?如果不是,还有什么可能导致此问题?
我使用“CBCentralManager”在iOS中使用BLE模块,在Android中使用“blutoothLeScanner”。
//Creating an instance of CBCentralManager
private let bluetoothManager = CBCentralManager(delegate: nil, queue: nil)
//Start Scanning
bluetoothManager.scanForPeripherals(withServices: nil, options: [CBCentralManagerScanOptionAllowDuplicatesKey:NSNumber(value: true)])
最佳答案
扫描参数在两个操作系统中都是硬编码的,但是在Android上,您可以选择以下三种模式:
请注意,如果您在后台扫描,则无论您选择什么,都将使用SCAN_MODE_LOW_POWER。