ios iPhone 到 RS-232 通过蓝牙

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7420717/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 21:31:31  来源:igfitidea点击:

iPhone to RS-232 via Bluetooth

iphoneiosbluetoothserial-port

提问by Kongress

I'm looking to connect my iPhone to an RS-232 serial device via Bluetooth. Has anyone implemented this successfully and can offer advice on hardware to use? It's kind of tricky because of the need for the Apple Authentication Processor with the device. The best potential device I've found is this guybut it only comes in an embedded package, its serial port interface is just logic-level UART rather than line-level RS-232, and I can't find a supplier with it in stock.
Any thoughts would be appreciated.

我希望通过蓝牙将我的 iPhone 连接到 RS-232 串行设备。有没有人成功地实现了这一点,并且可以提供有关使用硬件的建议?这有点棘手,因为设备需要 Apple 身份验证处理器。我发现的最好的潜在设备是这个家伙,但它只提供嵌入式封装,它的串行端口接口只是逻辑级 UART 而不是线路级 RS-232,我找不到它的供应商股票。
任何想法将不胜感激。

I'm considering just using WiFi to serial instead, but please ignore that possibility for the purposes of this question.

我正在考虑只使用 WiFi 进行串行,但请忽略此问题的可能性。

采纳答案by Matthias Bauch

most of the question was answered by yourself already.
Basically you have 5 (+2) choices.

大部分问题已经由你自己回答了。
基本上你有 5 (+2) 个选择。

  1. Join the MFi program. This might be hard to impossible if you are not part of a at least mid-size company.

  2. Buy the OEM Bluetooth Module. I'm not sure if this is even allowed by the apple policies.

  3. Use WiFi. Keep in mind that you want to use a wifi chipset that can act as at least ad-hoc access point. Those chipsets are quite expensive, and you have to think of a way to join existing networks (customers don't want to leave their home network to use your product). This will add a lot of cost to the BOM of your device.

  4. Jailbreak might be an option. I never tried to use accessories with a jailbreak, so I don't know if it's possible to use bluetooth without authentication.

  5. Work with a company that is member of the MFi program.

  6. (Maybe an option, and depending of the speed you want to have via RS232: Eventually you can convert the audio output of the head-phone Hyman to RS232 levels and vice versa)

  7. (Not really an option: develop for Android and do whatever you want)

  1. 加入 MFi 计划。如果您不是至少中型公司的一员,这可能很难甚至不可能。

  2. 购买 OEM 蓝牙模块。我不确定苹果政策是否允许这样做。

  3. 使用无线网络。请记住,您希望使用至少可以充当临时接入点的 wifi 芯片组。那些芯片组相当昂贵,你必须想办法加入现有网络(客户不想离开他们的家庭网络来使用你的产品)。这将为您的设备的 BOM 增加大量成本。

  4. 越狱可能是一种选择。我从来没有尝试过越狱时使用配件,所以我不知道是否可以在没有身份验证的情况下使用蓝牙。

  5. 与属于 MFi 计划成员的公司合作。

  6. (也许是一个选项,取决于您希望通过 RS232 获得的速度:最终您可以将耳机插孔的音频输出转换为 RS232 电平,反之亦然)

  7. (不是真正的选择:为 Android 开发并做任何你想做的事)

回答by mringwal

If you jailbreak your device, you can use BTstack.org (disclaimer: I'm the author of BTstack) to connect to a Bluetooth device that supports the Serial Port Profile. You can get Bluetooth Modules that implement SPP and provide UART level output. As David R. above points out, you then need a UART to RS232 converter, e.g. the MAX232.

如果您越狱了您的设备,您可以使用 BTstack.org(免责声明:我是 BTstack 的作者)连接到支持串行端口配置文件的蓝牙设备。您可以获得实现 SPP 并提供 UART 电平输出的蓝牙模块。正如上面的 David R. 指出的那样,您需要一个 UART 到 RS232 转换器,例如 MAX232。

回答by mringwal

Ok. Another option. There are one or two companies that sell RS232 cables for iOS, eg. Skywire here: http://www.southernstars.com/products/skywire/index.html

好的。另外一个选项。有一两家公司销售适用于 iOS 的 RS232 电缆,例如。Skywire在这里:http: //www.southernstars.com/products/skywire/index.html

Then, you could uses a Bluetooth RS232 extender, which consists of a RS232-to-SPP and a SPP-to-RS232 pair. Ugly, but within Apple's rules.

然后,您可以使用蓝牙 RS232 扩展器,它由 RS232-to-SPP 和 SPP-to-RS232 对组成。丑陋,但在苹果的规则之内。

回答by Eternal21

This product works: https://serialio.com/product/bluetooth-serial-adapter/bluesnap-smart-bluetooth-40-ble-rs232-adapter

本产品有效:https: //serialio.com/product/bluetooth-serial-adapter/bluesnap-smart-bluetooth-40-ble-rs232-adapter

The only downside is that the adapter requires power.

唯一的缺点是适配器需要电源。

enter image description here

在此处输入图片说明

回答by nmajin

It should be possibly I would think to create something in the middle that accept the bluetooth commands and convert them to serial, similar to what this does with TCP connections: https://www.npmjs.com/package/stellar-socks

我应该可能会考虑在中间创建一些接受蓝牙命令并将它们转换为串行的东西,类似于 TCP 连接:https: //www.npmjs.com/package/stellar-socks

回答by David R.

Well. It seems like my answer could be something you didnt ask for. But the guy you referred to is the answer. Buy his product and you are good to go, all you need is a MAX232 chip. Converts logic level UART to RS232. the diffrence high + voltage low zero voltage is converted to high +~10volts low -~10volts.

好。似乎我的回答可能是您没有要求的。但是你提到的那个人就是答案。购买他的产品,您就可以开始使用了,您只需要一个 MAX232 芯片。将逻辑电平 UART 转换为 RS232。差异高+电压低零电压转换为高+~10伏低-~10伏。

I use the MAX232 chip with my microprocessor, that uses logic level USART to communicate over RS232.

我使用 MAX232 芯片和我的微处理器,它使用逻辑电平 USART 通过 RS232 进行通信。

There is a lot of tutorials out there explaining how to hook things up.

有很多教程解释了如何连接。