あなたは
NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES], CBCentralManagerScanOptionAllowDuplicatesKey, nil];
[self.centralManager scanForPeripheralsWithServices:@[[CBUUID UUIDWithString:SERVICE_UUID]]
options:options];
、私の場合には、それは完璧に動作し、あなたが関心のあるサービスのUUIDを見つける必要があり、それは同じサービスUUIDを宣伝する任意のデバイスを見つけるとき、それはで表示されますあなたが上で指摘した画面。このように
ハンドルdidDiscoverperipherel:
-(void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI{
_discoveredPeripheral = peripheral;
if(![self.mRemoteDevices containsObject:_discoveredPeripheral])
{
NSArray *peripherels = [self.centralManager retrievePeripheralsWithIdentifiers:@[_discoveredPeripheral.identifier]];
[self.mRemoteDevices addObject:[peripherels objectAtIndex:0]];
}
}
などの一部のiOSアプリケーションを使用して、BLEデバイス広告UUIDを取得することができます無料など – Paulw11
さて、ありがとう。 ペアになっている/接続されているBLEデバイスのリストを作成するためのソリューションとしてのガイドラインを教えてください。 –
@ Paulw11私は、切断されたデバイスをリストするAPIについて知らないので、私も興味があります。接続されたデバイスの場合、[ - retrieveConnectedPeripheralsWithServices:](https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/CBCentralManager_Class/index.html#//apple_ref/occ/instm/CBCentralManager/retrieveConnectedPeripheralsWithServices: )API。 – allprog