This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

iOS CoreBluetooth reconnecting device with pair

now,i pairing my peripheral and Communication read/write data. but have some issue for disconnect/reconnect .

1.disconnect: when i disconnect (call didDisconnectPeripheral) the iOS not disconnect my peripheral why that not disconnect ? how to disconnect ?

2.reconnect: other i turn off my peripheral , and re-connect (connectperipheral) but can't read/write how to solve " 2013-12-05 21:16:52.206 Alarm Clock 1.0[1542:60b] CoreBluetooth[WARNING] is not a valid characteristic for peripheral "

iWatchApp.zip

Parents
  • hi, i need explain question again,

    same as this questio:TitleI OS Bluetooth LE : unable to connect using stored pairing data

    i connect my device with pair and bond, and that is success work(read/write characteristics data)

    when issue it is wrong : devices: 1.reset power , then re-Advertising (by BLE_GAP_ADV_TYPE_ADV_DIRECT_IND) when i do it ,my iOS will be auto connect my device ,event no App work. it it right? if it is right, how to get the peripheral service uuid and characteristic ?

    iOS: 1.on my app, call "cancelPeripheralConnect:self.currentPeripheral.peripheral]; to disconnect with my device,but it will not action. (my device go to disconnect,only have i delete the Bluetooth pair information)

    Is there someone with experience with Bluetooth LE and IOS to help me?

Reply
  • hi, i need explain question again,

    same as this questio:TitleI OS Bluetooth LE : unable to connect using stored pairing data

    i connect my device with pair and bond, and that is success work(read/write characteristics data)

    when issue it is wrong : devices: 1.reset power , then re-Advertising (by BLE_GAP_ADV_TYPE_ADV_DIRECT_IND) when i do it ,my iOS will be auto connect my device ,event no App work. it it right? if it is right, how to get the peripheral service uuid and characteristic ?

    iOS: 1.on my app, call "cancelPeripheralConnect:self.currentPeripheral.peripheral]; to disconnect with my device,but it will not action. (my device go to disconnect,only have i delete the Bluetooth pair information)

    Is there someone with experience with Bluetooth LE and IOS to help me?

Children
  • I'm sorry, but I'm having some trouble understanding the problem here.

    First of all, as the person below says, you should not use directed advertising with iOS devices, as that will not work correctly.

    Secondly, from your app you should just do a regular service discovery each time you connect. If you are already bonded, iOS will most likely just return the cached values, without doing anything over the air.

    Thirdly, as I said, doing a cancelPeripheralConnection will not necessarily actually disconnect the link.

    If you still can't get things working, I'd be happy if you could upload your complete source code, either here or in a regular support case. It's not really possible to help you without it.

Related