问题描述
我的目标是通过蓝牙在运行 iOS 的设备和运行 Mac OS X 的设备之间建立连接.我知道我可能可以为此使用 CoreBluetooth,但我不明白怎么做,因为我没有看到在 iOS 设备 上设置服务并将其作为可用服务广播的方法运行 Mac OS X 的设备.换句话说,我只是想建立一个连接来让 iOS 设备 将数据发送到 Mac OS X 设备.另外,我将如何指定如何设置服务的属性.我试过研究这些东西,但大多数文档对我来说意义不大.数据传输很小,因此蓝牙足以胜任这项工作.我试图避免 Bonjour 和 P2P 的游戏中心框架,因为 OS X 无法处理(我认为).
My objective here is to create a connection between a device running iOS to a device running Mac OS X, via bluetooth. I know that I might be able to use CoreBluetooth for this but I don't understand how since I don't see a method to setup a service on the iOS device and broadcast it as an available service for a device running Mac OS X. In other words, I simply want to setup a connection to get the iOS device to send data to the Mac OS X device. Also, how would I go about to specify how to setup properties of the service. I've tried researching this stuff but most of the documentation makes little sense to me. The data transfer is small so bluetooth is good enough for the job. I'm trying to avoid Bonjour for this, and the Game center framework for P2P since OS X can't handle that (I think).
推荐答案
在 iOS6 中,iPhone 4S、5 和 New iPad 可以在蓝牙智能/低功耗模式下作为外围设备和中央设备工作.尝试从APP Store下载LightBlue"APP.它可以让您将 iPhone4S 或 5 设置为带有随机服务的外围模式,然后您可以从 Mac 上读取这些服务(如果您有更新的 BT Low Energy,我使用 Retina,但新的 iMac 和 Mac Mini 也有 BT低能量).
In iOS6 the iPhone 4S, 5 and New iPad can work both as Peripheral and as Central in Bluetooth Smart / Low Energy mode. Try downloading "LightBlue" APP from APP Store. It let's you put the iPhone4S or 5 into Peripheral mode with random Services which you can then read from the Mac (if you have a newer one with BT Low Energy, I use the Retina for that but also the new iMac and Mac Mini got BT Low Energy).
您是正确的,核心蓝牙仅允许访问不允许 MFI 芯片的低功耗蓝牙.
You are correct that Core Bluetooth only give access to Bluetooth Low Energy which doesn't allow for the MFI chip.
这篇关于iOS 到 Mac OS X [核心] 蓝牙数据传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!