Xcode中的iPhone模拟器是否支持蓝牙低功耗? [英] Does the iPhone simulator in Xcode support Bluetooth Low Energy?

查看:969
本文介绍了Xcode中的iPhone模拟器是否支持蓝牙低功耗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在新的Mac mini上尝试了一些iOS测试应用程序,它支持蓝牙低功耗。其中使用了 CoreBluetooth 框架。但是,我无法在iPhone模拟器中使用蓝牙,这是Xcode的一部分。

I'm trying some iOS test applications on the new Mac mini, that supports Bluetooth Low Energy. The CoreBluetooth framework is used in those. However, I'm not able to get Bluetooth working in the iPhone simulator, that is part of Xcode.

当我分配一个新的 CBCentralManager ,centralManagerDidUpdateState:接收 CBCentralManagerStatePoweredOff 代表蓝牙目前已关机。

When I allocate a new CBCentralManager, centralManagerDidUpdateState: receives CBCentralManagerStatePoweredOff which stands for Bluetooth is currently powered off.

我第一次运行文本应用程序时,会打开一个框看起来很糟糕(只使用语言变量,而不是实际文本)和两个按钮。第一个让我进入设置面板,其中有一个启用蓝牙的选项。然而,在我告诉它启用蓝牙后,它只显示旋转动画,它不会完成或取消。即使在重新启动Mac之后,仍然只有旋转动画。这个盒子也不再打开了。

The first time I ran the text application, a box was then opened up that looked pretty bugged (only language variables were used, not the actual texts) and with two buttons. The first led me to the settings panel where there was an option to enable Bluetooth. However, after I told it to enable Bluetooth, it just shows the spinning animation, and it won't either complete or cancel. Even after rebooting the Mac, there is still only the spinning animation. The box also does not open up anymore.

基本上,我认为iPhone模拟器应该支持蓝牙低功耗。否则,模拟器上的设置应用程序中有一个选项并不合理。此外,中央管理器状态是 CBCentralManagerStatePoweredOff 但不是 CBCentralManagerStateUnsupported 哪个代表平台不支持低功耗蓝牙。这也希望可以支持。

Essentially, I think that the iPhone simulator should support Bluetooth Low Energy. Otherwise, it does not really make sense that there is an option in the settings application on the simulator. Also, the central manager state is CBCentralManagerStatePoweredOff but not CBCentralManagerStateUnsupported which would stand for The platform doesn't support Bluetooth Low Energy. This gives also hope that support could exist.


  • iPhone模拟器是否支持蓝牙低功耗?

  • 如果是,我该如何启用它?

推荐答案

模拟器支持蓝牙低功耗(4.0)。唯一的问题是,即使你的计算机里面装有BLE,你也无法将模拟器与它一起使用,因为(我认为)你占用BLE上的可用性,让其他设备发现你的计算机,从而限制了Mac的功能。

The simulator does support Bluetooth Low Energy (4.0) according to this appnote from Apple. The only problem is that even if you have a computer with BLE inside, you will not be able to use the simulator together with it, because (I think) you occupy the availability on BLE for other devices to discover your computer, thereby restricting the functionality of the Mac.

因此,如果您自己购买BLE USB加密狗,您将可以在模拟器中使用它。

So if you go get yourself a BLE USB dongle you will be able to use it in simulator.

编辑:从@JoeShaw添加信息:

Adding information from @JoeShaw:


不幸的是,似乎从iOS 7的模拟器中删除了Core Bluetooth支持。 doubleencore.com/2013/09/whats-new-in-bluetooth-le-ios-7。此外,链接的技术说明似乎已被删除。

Unfortunately it appears as though Core Bluetooth support has been dropped from the simulator for iOS 7. Reference: doubleencore.com/2013/09/whats-new-in-bluetooth-le-ios-7. In addition, the linked technote seems to have been removed.

这篇关于Xcode中的iPhone模拟器是否支持蓝牙低功耗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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