Skip to content

Instantly share code, notes, and snippets.

@SunXiaoShan
Created July 27, 2018 08:31
Show Gist options
  • Save SunXiaoShan/6f83175fc511721cc7d7ea67e22a9194 to your computer and use it in GitHub Desktop.
Save SunXiaoShan/6f83175fc511721cc7d7ea67e22a9194 to your computer and use it in GitHub Desktop.
- (void)centralManagerDidUpdateState:(CBCentralManager *)central {
if (central.state != CBCentralManagerStatePoweredOn) {
return;
}
[self scan:central];
}
- (void)scan:(CBCentralManager *)central {
CBUUID *uuid = [CBUUID UUIDWithString:kServiceUUID];
[central scanForPeripheralsWithServices:@[uuid]
options:@{CBCentralManagerScanOptionAllowDuplicatesKey:@YES}];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment