使用scanForPeripheralsWithServices:选项时,我可以在使用时发现服务
// Scanning with nil services will return all devices.
NSLog(@"Looking for any service.");
[self.centralManager scanForPeripheralsWithServices:nil options:nil];
Run Code Online (Sandbox Code Playgroud)
但是,当使用通过以下代码从蓝牙设备获得的服务标识符预先指定服务时,我无法发现该设备.
#define DEVICE_INFO_SERVICE_UUID @"180a"
NSArray *services = [NSArray arrayWithObjects:[CBUUID UUIDWithString:DEVICE_INFO_SERVICE_UUID], nil];
[self.centralManager scanForPeripheralsWithServices:services options:nil];
Run Code Online (Sandbox Code Playgroud)
怎么了?