Not working call to centralManager: didDiscoverPeripheral: advertisementData: RSSI: function

对着背影说爱祢 提交于 2019-12-11 03:14:25

问题


After app open, and Press ON BLE Device.

centralManagerDidUpdateState function is working.

    CBUUID *uuid = [CBUUID UUIDWithString:@"8A1FEA41-3A2F-7860-568D-2325D6C31C91"];
    NSArray *services = [NSArray arrayWithObjects:uuid, nil];
    NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithBool:NO] forKey:CBCentralManagerScanOptionAllowDuplicatesKey];
    [central scanForPeripheralsWithServices:services options:options];

Would not call to didDiscoverPeripheral: function.

-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI{
}

But if call nill value to scanForPeripheralsWithServices than will call to didDiscoverPeripheral: function.

[central scanForPeripheralsWithServices:nil options:options];

What is issue? Please.

来源:https://stackoverflow.com/questions/21826693/not-working-call-to-centralmanager-diddiscoverperipheral-advertisementdata-rs

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!