Hi, I successfully discover a Peripheral and retrieve its local name with [advertisementData objectForKey:CBAdvertisementDataLocalNameKey]
But if the Peripheral stops and restarts advertising with a different local name, the Client doesn't recognise the change right away. It takes a random amount of time (from 2 seconds to 5 min) until
- (void) centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI
is called and the change detected. In a GKSession such a change was quickly recognised after initialising a new session and calling
peerListAvailable = [[NSMutableArray alloc] initWithArray:[currentSession peersWithConnectionState:GKPeerStateAvailable]];
and
for (NSString *peer in peerListAvailable) { [currentSession displayNameForPeer:peer]; }
I guess in CBluetooth
- (void)peripheralDidUpdateName:(CBPeripheral *)peripheral
only works when the devices are paired. My question therefore is: Is there way to get an update without pairing?
|