是否可以在IOS6.0,IOS6.1,IOS6.1.2上使用CoreBluetooth? [英] Dose CoreBluetooth work on IOS6.0,IOS6.1,IOS6.1.2?

查看:59
本文介绍了是否可以在IOS6.0,IOS6.1,IOS6.1.2上使用CoreBluetooth?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用bluetooth4.0,但是我发现CoreblueTooth无法在iOS 6+上运行,我的iphone4s是IOS 6.1.2。

i am working on bluetooth4.0 , but i found that CoreblueTooth cannot run on iOS 6+,my iphone4s is IOS 6.1.2.

它找不到任何设备(我确定设备已打开电源),每次记录如下:

it cannot find any device(i am sure the device is power on), the Log as below every time:

CoreBluetooth [警告]未打开

CoreBluetooth[WARNING] is not powered on

有人遇到过这个问题吗?

Dose anyone have encounter this issue?

推荐答案

状态CBCentralManagerStatePoweredOn不仅意味着蓝牙已打开,而且您的CBCentralManager或CBPeripheralManager实例已可以使用。您必须初始化管理器,然后等待其状态更改后再使用。例如,如果您充当Central,则可以使用以下命令对其进行初始化:

The status CBCentralManagerStatePoweredOn means not only that Bluetooth is turned on, but also that your instance of CBCentralManager or CBPeripheralManager is ready to use. You must initialize your manager, then wait for its state to change before using it. For example, if you are acting as a Central, you would initialize it with the following:

centralManager = [[CBCentralManager alloc] initWithDelegate:self queue:nil];

并实现委托方法 centralManagerDidUpdateState:

- (void)centralManagerDidUpdateState:(CBCentralManager *)central
{
    if (central.state == CBCentralManagerPoweredOn)
    {
        //do your stuff, it's ready
    }
}

这篇关于是否可以在IOS6.0,IOS6.1,IOS6.1.2上使用CoreBluetooth?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆