iPhone 如何通过无线或蓝牙访问另一台非 iPhone 设备?

发布于 2024-07-25 09:52:46 字数 1570 浏览 3 评论 0 原文

我试图弄清楚 iPhone 是否可以通过无线或蓝牙连接到另一台非 iPhone 设备,但发现了相互矛盾的信息。 我发现的大部分内容都是在 SDK 3.0 版本发布之前发现的,当时这肯定是不可能的。 查看堆栈溢出问题,例如 iPhone 3.0 SDK 可以提供对蓝牙设备(耳机)的完全访问吗? 提到您无法连接到任意设备,除非它是“Works for iPhone”设备的一部分。 我需要该程序中包含的硬件吗?

浏览Apple文档,点对点连接,它提到连接两部 iPhone,而不是 iPhone 到另一个蓝牙设备。 然后还有类似 iPhone SDK 的文章焦点:蓝牙增强功能,包括这句话

...新宣布的“标准支持”应该允许 iPhone 和计算机之间以及附近的 iPhone 之间进行文件传输

另一个堆栈溢出问题,iPhone SDK 3.0 中的 GameKit,提到BonjourApple Bonjour 的文档讨论了连接到 Bonjour 设备,但是 iPhone 可以连接到任何 Bonjour 设备吗? 是否必须有 Wi-Fi 连接,还是可以使用蓝牙?

我相信,即使我可以使用蓝牙连接到其他设备,第一代 iPhone 和 iTouch 也无法使用它。 那是对的吗? 我正在考虑一个 iPhone 应用程序,它需要与该区域的其他非 iPhone 设备进行通信,可能使用蓝牙,但也可能是直接无线连接。 这种方法的可能性和局限性是什么? iPhone 不能连接任意蓝牙设备吗? 其他设备是否必须位于无线 Bonjour 网络上? 我试图弄清楚这是否可行,或者是否不值得付出努力。

I'm trying to figure out if an iPhone can connect to another non-iPhone device over wireless or Bluetooth and have seen conflicting information. Much of what I've found was before version 3.0 of the SDK came out, when it certainly wasn't possible. Looking at Stack Overflow questions, like Can the iPhone 3.0 SDK provide full access to Bluetooth devices (headsets)? mention you can't connect to an arbitrary device unless if it's part of the "Works for iPhone" device. Do I need hardware that is part of this program?

Looking through the Apple documentation, Peer-to-Peer Connectivity, it mentions connecting two iPhones, not an iPhone to another Bluetooth device. Then there are articles like iPhone SDK focus: Bluetooth enhancements that includes this quote

...and with the newly-announced "standard support" should allow file transfer between the iPhone and a computer, as well as between nearby iPhones

Another Stack Overflow question, GameKit in iPhone SDK 3.0, mentions Bonjour, and the Apple documentation for Bonjour talks about connecting to Bonjour devices, but can an iPhone connect to any Bonjour device? Does it have to have a Wi-Fi connection, or can it use Bluetooth?

Even if I could use Bluetooth to connect to another device, it won't be available on first generation iPhones and iTouches, I believe. Is that correct? I'm thinking of an iPhone application that would need to communicate with other non-iPhone devices in the area, probably using Bluetooth, but possibly a direct wireless connection. What are the possibilities and limitations of this approach? Is it not possible to have an iPhone connect to an arbitrary Bluetooth device? Does the other device have to be on a wireless Bonjour network that? I'm trying to figure out if it's even possible for this to work or if it's not worth the effort.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

人海汹涌 2024-08-01 09:52:46

通过 外部附件 框架是指它们位于 专为 iPod 配件制作 计划。 尽管它们通过标准蓝牙连接进行通信,但配件需要特殊的硬件才能处理来自 iPhone / 的数据流iPod touch。 不幸的是,这意味着您与通用蓝牙设备通信的想法将无法在 iPhone OS 3.0 上运行。

如果您想要交谈的设备可通过 Wi-Fi 进行 Bonjour 发现,则它们不会无需加入 Made for iPod 计划。 然而,这听起来不像你的情况。

在不久的将来,第三方开发商可能会生产通过 30 针底座端口连接并访问现有蓝牙设备的适配器。 如果这些开发人员开放他们的通信协议,则可能会实现您与这些设备通信的目标。

The only way to communicate with other Bluetooth devices via the External Accessory framework in iPhone OS 3.0 is if they are in the Made for iPod accessory program. Even though they communicate through standard Bluetooth connections, accessories need special hardware in order to process the data stream coming from the iPhone / iPod touch. Unfortunately, this means that your idea of communicating with generic Bluetooth devices won't work on iPhone OS 3.0.

If the devices you want to talk to are Bonjour-discoverable via Wi-Fi, they don't need to be part of the Made for iPod program. However, that doesn't sound like your case.

Third-party developers in the near future may produce dongles that connect through the 30-pin dock port and give access to existing Bluetooth devices. If these developers opened up their communication protocol, that might enable your goal of communicating with these devices.

许仙没带伞 2024-08-01 09:52:46

您可以使用 NSStream 打开IPv4/IPv6 套接字。 您连接的设备不一定是 iPhone,也不一定使用 Wi-Fi。 由于网络通信协议的设计方式,您根本不必关心 iPhone 正在与哪种设备进行通信。

另一方面,Bonjour 在内部使用 NSStream。 它基本上是一个漂亮的小包装,允许自动发现。 您需要在想要参与自动发现过程的所有设备上安装 Bonjour 协议。 甚至还有针对 Windows 的实现。

You can use NSStream for opening IPv4/IPv6 sockets on the iPhone. The devices to which you're connecting do not have to be iPhones or use Wi-Fi necessarily. Because of how network communication protocols are laid out, you simply don't have to care what kind of device your iPhone is communicating with.

Bonjour, on the other hand, uses NSStream internally. It's basically a nifty little wrapper which allows for auto-discovery. You need the Bonjour protocol installed on all devices which you want to participate in the auto-discovery process. There is even an implementation for Windows.

旧梦荧光笔 2024-08-01 09:52:46

作为 iPhone OS 3.0 SDK 的一部分,Apple 宣布能够通过蓝牙或底座连接器控制硬件配件。 坞站连接器支持标准协议(即播放、暂停等)以及开发人员想要实现的任何自定义协议。

至于通过蓝牙连接,您可以与其他 iPhone 或其他设备通话。 例如,您可以使用立体声蓝牙连接兼容的蓝牙立体声耳机、车载套件或其他配件。

至于哪些设备支持蓝牙通信,除了第一代 iPod Touch 之外,其他都应该没问题。

另请参阅 Apple 有关 iPhone 操作系统配件的页面

As part of the iPhone OS 3.0 SDK, Apple announced the ability to control hardware accessories through either Bluetooth or the dock connector. The dock connector supports standard protocols (that is, play, pause, etc.) as well as any custom protocols the developer wants to implement.

As far as connecting via Bluetooth, you can talk to other iPhones or other devices. For example, you can use stereo Bluetooth to connect compatible Bluetooth stereo headphones, car kits, or other accessories.

As far as what devices support Bluetooth communication, everything except the first generation iPod Touch should be okay.

See also Apple's page on iPhone OS accessories.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文