Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Last active July 27, 2018 08:07
Show Gist options
  • Save SunXiaoShan/43d54908fd69ac02575be54e7fe1e54a to your computer and use it in GitHub Desktop.
Save SunXiaoShan/43d54908fd69ac02575be54e7fe1e54a to your computer and use it in GitHub Desktop.
- (void)peripheralManager:(CBPeripheralManager *)peripheral
central:(CBCentral *)central
didSubscribeToCharacteristic:(CBCharacteristic *)characteristic {
if (![self.centralM containsObject:central]) {
[self.centralM addObject:central];
}
[self updateCharacteristicValue];
[self stopAdvertising];
}
- (void)peripheralManager:(CBPeripheralManager *)peripheral
central:(CBCentral *)central
didUnsubscribeFromCharacteristic:(CBCharacteristic *)characteristic {
[self startAdvertising];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment