Re-connecting to a paired device
Re-connecting to a paired device
- Subject: Re-connecting to a paired device
- From: Thomas Engelmeier <email@hidden>
- Date: Mon, 12 May 2014 18:08:31 +0200
Hi,
I have an application running on Mavericks that connects to TI SensorTags. I have problems to reconnect to an paired and connected periperial.
The MBP I use has no BLE compatible BlueTooth interface, so I use an USB Broadcom interface.
It works fine in the following setting:
- When no tag is paired, the app is started, I start scanning when centralManagerDidUpdateState: gets called with CBCentralManagerStatePoweredOn and then I turn on the SensorTag, everything works fine.
- in centralManager:didDiscoverPeripherial:, I try to connect to the periperial
- In centralManager:didConnectPeriperial:, I retrieve and save the device UUID for reconnecting
Now when the app crashes / exits / gets killed by Xcode, the sensor tag keeps connected (visible in the Bluetooth status bar item). The SensorTag remains also visible in the Bluetooth explorer „Bluetooth status“ window as „active“.
When I relaunch, I call [centralManger retrieveConnectedPeripherials] and [centralManager retrievePeriperialsWithIdentifier:] and get an
a.) centralManager:didRetrievePeripherial: gets invoked with all UUIDs I feed in, none of them have a name set, and all are disconnected (INCLUDING the one I paid just before)
b.) centralManager:didRetrieveConnectedPeripherial: gets invoked with an empty array
I’d expect b.) to return the (visible in the menu bar) connected, paired peripheral.
When I turn the Bluetooth interface off and on again, the app starts scanning on the „power on“ transition, discovers the SensorTag and everything works fine..
What’s going wrong???
TIA,
Thomas
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Bluetooth-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden