The older deprecated version of the method you are using. retrievePeripherals: Retrieves a list of known peripherals by their UUIDs. (Deprecated in iOS 7.0. Use the retrievePeripheralsWithIdentifiers: method instead.) - (void)retrievePeripherals:(NSArray *)peripheralUUIDs Parameters peripheralUUIDs An array of CFUUIDRef objects from which CBPeripheral objects can be retrieved. Because CBUUID objects represent Bluetooth-specific universally unique identifiers (UUIDs) (used for Bluetooth GATT attributes such as services and characteristics), CBPeripheral objects use standard CFUUIDRefUUIDs as their unique identifiers. Discussion This method retrieves a list of peripherals that the central manager is able to match to the provided UUIDs. Upon retrieving the list of known peripherals, the central manager object calls the centralManager:didRetrievePeripherals: method of its delegate object. If no matches are made, the central manager object passes an empty array of peripherals to the centralManager:didRetrievePeripherals: method. On Wed, Jul 2, 2014 at 7:22 PM, Rick Mann <rmann@latencyzero.com> wrote:
So, I just noticed that it returns an array, and my peripheral is in there. But then what is -centralManager:didRetrievePeripherals: for?
On Jul 2, 2014, at 16:46 , Jason Conn <conn@apple.com> wrote:
- [CBCentralManager retrievePeripheralsWithIdentifiers:] is a synchronous method.
On Jul 2, 2014, at 4:21 PM, Rick Mann <rmann@latencyzero.com> wrote:
I'm remembering the last-connected peripheral by storing the identifier in NSUserDefaults, then trying to retrieve that peripheral on the next launch.
Store:
NSString* uuid = self.peripheral.identifier.UUIDString; // Store uuid in NSUserDefaults
Retrieve:
NSUUID* uuid = [[NSUUID alloc] initWithUUIDString: inPeripheralIdentifier]; [self.cm retrievePeripheralsWithIdentifiers: @[ uuid ]];
But -centralManager:didRetrievePeripherals: is never called (at all, even with an error).
Am I doing something wrong? Thanks!
-- Rick
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/conn%40apple.com
This email sent to conn@apple.com
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/rmann%40latencyzero.co...
This email sent to rmann@latencyzero.com
-- Rick
_______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/christopher.cotton%40g...
This email sent to christopher.cotton@gmail.com
-- Christopher _______________________________________________ Do not post admin requests to the list. They will be ignored. Bluetooth-dev mailing list (Bluetooth-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/bluetooth-dev/site_archiver%40lists.... This email sent to site_archiver@lists.apple.com