Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CoreBluetooth: Refreshing local name of an already discovered Peripheral

I successfully discover a Peripheral and retrieve its local name:

[advertisementData objectForKey:CBAdvertisementDataLocalNameKey]

But if the Peripheral stops and restarts advertising with a different local name, the Client doesn't recognise the change. I guess

- (void)peripheralDidUpdateName:(CBPeripheral *)peripheral

only works if the two devices are paired. Is there a way to get an update without pairing?

like image 833
saeppi Avatar asked Nov 01 '12 15:11

saeppi


1 Answers

Apple's bug. Still present in iOS 6.1. Here is the trick how to reset CB cache:

  1. BackUP device to iCloud.
  2. Reset network settings.
  3. Delete your app and install it back via Xode
  4. At this point, your peripheral will appear with the new name.
  5. Restore your network settings manually or restore from iCloud.

Sorry.

like image 130
bioffe Avatar answered Sep 28 '22 07:09

bioffe