如何使用串口将iPhone与其他非iPhone设备集成?
有人知道如何使用串口将 iPhone 与其他非 iPhone 设备集成吗?
Anybody knows how to integrate iPhone with other non-iPhone devices using serial port?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
你不能直接。扩展坞连接器上可能有某种串行线(i2c),但它不是通过 SDK 公开的,
Made for iPhone
/ExternalAccessory.framework
内容只是适用于 USB 和 BT。你可以想象使用 WiFi/串行桥(这样的东西确实存在),因为你可以通过 TCP 隧道发送你想要的任何内容,但我怀疑这就是你想要的。
You can't directly. There may be some sort of serial line (i2c) on the dock connecter, but it is not exposed through the SDK, the
Made for iPhone
/ExternalAccessory.framework
stuff is only for USB and BT.You could conceivably use a WiFi/serial bridge (such things do exist) since you can send whatever you want over a TCP tunnel, but I doubt that is what you want.
30 引脚连接器的
ExternalAccessoryFramework
底层是真正的 UART 握手(使用 Tx、Rx、Gnd、Vcc 和一些检测引脚,无流量控制),但不是 USB。 USB 的这些引脚仅用于 iTunes、Xcode 和供电。 iOS应用程序不需要理解UART,只需要通过NSOutputStream
和NSInputStream
发送/接收字节。但您需要向 Apple 支付 MFi(Made For iPhone) 计划首先购买一些保密的IC,让你的配件能够与iOS进行通信。他们会要求您提出产品计划和预期销售额,并考虑是否接受您作为 MFi 制造商。
Underlying
ExternalAccessoryFramework
for 30-pin connector it's the real UART handshaking (using Tx, Rx, Gnd, Vcc and some detect pins and no flow control) but not USB. Those pins of USB are only used for iTunes, Xcode and powering. The iOS app does not need to understand UART and only needs to send/receive bytes throughNSOutputStream
andNSInputStream
.But you need to pay Apple for MFi(Made For iPhone) Program first and buy some confidential IC to enable your accessory to communicate with iOS. They will require you to propose a product plan and expected sales and consider whether they would accept you as a MFi manufacturer.
您可以从苹果的开发者门户获取有关使用ExternalAccessory框架的信息。
如果不加入 Made for iPhone 计划,您将无法获得所需的串行握手(?)信息。这要求您正在开发商业设备。
我曾尝试通过我的大学从苹果公司获取有关该协议的信息,但迄今为止失败了。
You can get the info on using the ExternalAccessory framework from apple's developer portal.
You can't get the required serial handshake(?) info without joining the Made for iPhone program. This requires that you are developing a commercial device.
I have tried to get information on this protocol from apple through my university and have thus far failed.
我成功地从 iPhone 上的 Arduino 接收到串行通信。我制作了一个谷歌文档来解释我的过程。
https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC -Dnuc58VIULa81Q/编辑
I successfully received serial communication from the Arduino on the iPhone. I made a google doc explaining my process.
https://docs.google.com/document/d/1Yi9_hcw8XSyYNCG2OJT9oHlTG-dC-Dnuc58VIULa81Q/edit