iOS 蓝牙中央管理器

标签 ios bluetooth bluetooth-lowenergy core-bluetooth cbcentralmanager

我正在 iPhone 上试用 iOS 蓝牙中央管理器。

- (void)centralManagerDidUpdateState:(CBCentralManager *)central
{
    // Determine the state of the peripheral
    if ([central state] == CBCentralManagerStatePoweredOff) {
        NSLog(@"CoreBluetooth BLE hardware is powered off");
    }
    else if ([central state] == CBCentralManagerStatePoweredOn) {
        NSLog(@"CoreBluetooth BLE hardware is powered on and ready");
    }
    else if ([central state] == CBCentralManagerStateUnauthorized) {
        NSLog(@"CoreBluetooth BLE state is unauthorized");
    }
    else if ([central state] == CBCentralManagerStateUnknown) {
        NSLog(@"CoreBluetooth BLE state is unknown");
    }
    else if ([central state] == CBCentralManagerStateUnsupported) {
        NSLog(@"CoreBluetooth BLE hardware is unsupported on this platform");
    }
}

总是出现硬件不支持的选择。

此外,我可以通过蓝牙在 Android 手机之间发送图片,但是当我尝试发送到 iPhone 时,它​​被拒绝了。 iOS蓝牙是封闭式的吗?它无法与其他蓝牙设备配合使用吗?

最佳答案

听起来您的 iOS 设备不支持低功耗蓝牙。

唯一支持的 iOS 设备是 iPhone 4S、iPhone 5、iPhone 5c、iPhone 5s、iPad 第 3 代、iPad 第 4 代、iPad Air、iPad mini 和 iPod Touch 第 5 代(以及更新的设备)。

关于iOS 蓝牙中央管理器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21666513/

相关文章:

ios - Swift 元组到可选赋值

ios - iCloud 和 Web 应用程序

ios - 如何在每次切换文本时执行不同的 Action ?

ios - 在不使用 Cocoa pod 的情况下集成 firebase SDK 时,未发现获取框架(MLVision/MLVisionTextModel)问题

bluetooth - 无法连接到 Raspberry Pi 上的 BLE 设备

android - 通过蓝牙将字符串发送到 Arduino 上的 Android 设备

c# - .Net 中的低功耗蓝牙 (C#)

ios - 数据值溢出

更改 UUID 后,Android 蓝牙未发现该特性

ios - 方法外设 : didWriteValueForCharacteristic: error: is not called