iOS 到 Mac OS X [核心] 蓝牙数据传输

iOS to Mac OS X [core] bluetooth data transfer(iOS 到 Mac OS X [核心] 蓝牙数据传输)
本文介绍了iOS 到 Mac OS X [核心] 蓝牙数据传输的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的目标是通过蓝牙在运行 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 [核心] 蓝牙数据传输的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

Why local notification is not firing for UNCalendarNotificationTrigger(为什么没有为UNCalendarNotificationTrigger触发本地通知)
iOS VoiceOver functionality changes with Bundle Identifier(IOS画外音功能随捆绑包标识符而变化)
tabbar middle tab out of tabbar corner(选项卡栏中间的选项卡角外)
Pushing UIViewController above UITabBar(将UIView控制器推送到UITabBar上方)
How can I sync two flatList scroll position in react native(如何在本机Reaction中同步两个平面列表滚动位置)
Get an event when UIBarButtonItem menu is displayed(显示UIBarButtonItem菜单时获取事件)