how to restore Broadcom WICED Bluetooth LE communication after connection attempt to dead peripheral - communication

After attempt to connect to a Bluetooth address for a peripheral that just powered off (battery died), central can no longer connect to any other powered-up peripherals. (This would occur if central scans for and detects peripheral, but peripheral then is powered off before central connects to it.)
Peripheral with Bluetooth address '000000000001' is powered on, and peripheral '000000000002' is powered off.
Central connects to P1 okay and gets notifications. Then disconnects.
Central tries to connect to peripheral '000000000002'.
Central disconnects.
Central tries to connect to '000000000001' again, but does not even get the connUp callback.
Why can't central re-connect with peripheral '000000000001' ?

Solution is to scan for the peripheral first, and only attempt connection if peripheral is NOT dead.

Related

Bluetooth Peripheral detect connected state

I created a function which turns an iPad without gps chip into a bluetooth peripheral and any device (iPhone or iPad) with gps chip into a broadcaster.
These 2 devices then connect with each other without asking to pair (as intended). (see this post for the code I wrote)
However I want to show the connected state in both the peripheral and broadcaster. The broadcaster has a function to check the connection state. The peripheral doesn't seem to have this.
Does anyone know of a way to determine at the peripheral side if the connection is still connected or not.

Failed to retrieve services of a CBPeripheral after restart the peripheral

I have a problem while trying to reconnect with a paired peripheral, it connects but I can not find the services.
The steps are as follows.
Turn on the peripheral device and open app.
Find the peripheral after scan. OK
Connect to the peripheral. OK
Save peripheral id for future reconnection.
Find the services / Characteristics. OK
Now I disabled the bluetooth from IOS and turned it on again to test the reconnection.
Find the peripheral after scan. OK
Connect to the peripheral with saved id. OK
Find the services / Characteristics. OK
Now I closed the app and reopen to test again.
Find the peripheral after scan. OK
Connect to the peripheral with saved id. OK
Find the services / Characteristics. OK
Now turn off the peripheral and then turn on again.
Find the peripheral after scan. OK
Connect to the peripheral with saved id. OK
Find the services / Characteristics. DOES NOT WORK NEVER MORE.
After step 4 if i repeat steps 1,2 and 3 they will not find services, the problem is when I restart the peripheral.
I'm setting the self.manager.delegate=self and implementing CBCentralManagerDelegate and CBPeripheralDelegate correctly, and I'm using self.manager.retrievePeripherals (withIdentifiers: [UUID]) to connect to the paired peripheral.
Any idea? I will be very grateful.

Continuous connectivity of bluetooth peripheral

After connecting with CBPeripheral, it displays services & characteristics of peripheral, after few minutes it disconnects the peripheral without any user interaction. I want the continuous connection with device until user disconnects it.
I have used the demo: Fullband
Any help will be appreciated regarding the continuous connectivity with CBPeripheral.

How long central manager scan for peripherals?

I start working with CoreBluetooth for a week, but I dont know how to reconnect to the peripheral after losing connection.
For example, my CBCentralManager connect to peripheral A, the real manager on iPhone said 'Connected', then I go away for awhile, the CBCentralManager lost connection to the peripheral A, the real manager on iPhone said 'Not Connected'. Then I go back, the CBCentralManager doesn't reconnect to peripheral A, but the real manager on iPhone said 'Connected'.
How can I make my CBCentralManager reconnect automatically?
Sorry for my bad English.

iOS CoreBluetooth and preventing other devices to connect to your peripheral

I am creating a core bluetooth application and connecting to a peripheral device, is there a way for the peripheral to reject which centrals may connect to it? What if a random person scanned and found my peripheral devices broadcasted UUID and then broadcasted that UUID and tried to connect to it, how would I prevent this?
No, the iOS peripheral cannot prohibit centrals from connecting to it. However it has some tricks to disable the connection. When a dynamic characteristic is read:
return an error instead of the value of the characteristic,
don't respond to the request. This will cause the connection to stall and then break up after about 30 seconds.
Think of the advertisement as a real advertisement in the media. As many can see it as want. This is the same for iBeacons. You shouldn't rely any security on being hidden. (Wifi SSID broadcasting can be turned off but if your hotspot is not encrypted and authenticated, people with find you.)

Resources