Why use coreBluetooth connectPeripheral did not call delegate methods in IOS8

前端 未结 3 500
孤街浪徒
孤街浪徒 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 02:57

    Call the connect method only once and wait for the connection delegate response. The above code which you posted will call the connect method more often (when ever it discover the peripheral)

    if(!self.detectedBLE){ [self.centralManager stopScan]; self.detectedBLE = peripheral; [self.centralManager connectPeripheral:self.detectedBLE options:nil]; }

提交回复
热议问题