Why use coreBluetooth connectPeripheral did not call delegate methods in IOS8

前端 未结 3 499
孤街浪徒
孤街浪徒 2020-12-11 02:19

I want use CoreBluetooth.framework in IOS8 to achieve data transfer, i did discover peripheral in the follow method and try connect the per

3条回答
  •  臣服心动
    2020-12-11 03:13

    I am using TemperatureSensor iOS sample app which didDiscoverPeripheral did not called. By reference the flow of Heart Rate Monitor Mac sample app. Please make sure the run sequence of code is:

    1. centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:dispatch_get_main_queue()];
    2. - (void) centralManagerDidUpdateState:(CBCentralManager *)central
    3. [centralManager scanForPeripheralsWithServices:... 
    

    - (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:... will be called afterwards.

提交回复
热议问题