Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
您能建议在iOS上查找任何蓝牙设备吗?_Ios_Bluetooth - Fatal编程技术网

您能建议在iOS上查找任何蓝牙设备吗?

您能建议在iOS上查找任何蓝牙设备吗?,ios,bluetooth,Ios,Bluetooth,我尝试在iOS上制作程序来检测不确定的蓝牙设备 设备扫描工作正常,但无法检测到任何设备。然而,在Ipad的基本选项中,蓝牙设备被很好地检测到。下面显示我的代码。请建议解决一些问题 - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. //CB setup _centralManager = [[CBCentralManager al

我尝试在iOS上制作程序来检测不确定的蓝牙设备

设备扫描工作正常,但无法检测到任何设备。然而,在Ipad的基本选项中,蓝牙设备被很好地检测到。下面显示我的代码。请建议解决一些问题

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    //CB setup
    _centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:dispatch_get_main_queue()];
}

- (void)centralManagerDidUpdateState:(CBCentralManager *)central {
    // You should test all scenarios
    if (central.state != CBCentralManagerStatePoweredOn) {
        return;
    }

    if (central.state == CBCentralManagerStatePoweredOn) {
        _scan_state = 1;
    }

    [self deviceScan];

}
- (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI{
    NSLog(@"dicovered: %@", peripheral.name);

    if(![self.BTNames containsObject:peripheral]){
        [self.BTNames addObject:peripheral];
    }


    _num_cell = self.BTNames.count;

    [self.BTList reloadData];

}

- (void) deviceScan{
    if(_scan_state){
/*        [_centralManager scanForPeripheralsWithServices:nil options:@{ CBCentralManagerScanOptionAllowDuplicatesKey : @NO }];*/
        [_centralManager scanForPeripheralsWithServices:nil options:nil];
        NSLog(@"Scan Starting");
    }
}

这是什么样的设备?CoreBluetooth只能发现蓝牙低能/BT 4.0设备。系统设置可以显示传统蓝牙设备,如耳机,Core Bluetooth不会报告这些设备。谢谢您的回答。有没有办法检测较低版本的蓝牙设备?没有。可以通过AV框架访问蓝牙设备,如耳机和A2DP,但用户必须通过设置完成配对。其他设备类型(如SPP配置文件设备)必须通过MFi程序。谢谢。我还有一个问题。实际上,我使用android智能手机作为目标设备,它具有蓝牙4.0模块。当然,我的手机允许使用搜索模式。然而,它也没有被发现。你能查一下我上面的密码吗?有什么错误吗?乍一看还可以。我建议使用app Store中的免费浅蓝色应用程序,尝试检测您的android设备,以验证它是否在广告服务