通过 WiFi/BT 传输 iPhone RS232 数据
我想编写一个简单的应用程序来显示从秤发送的重量值。
秤通过RS232端口发送数据(使用定义的协议):考虑到我无法将iPhone连接到串行端口,我正在考虑使用RS232/WiFi适配器(或RS232/BT适配器)。
iPhone 应充当主设备,而秤充当从设备:iPhone 向秤发送命令(简单的文本字符串),秤则以重量值进行响应。
WiFi/BT 是否是 iPhone 和体重秤之间交换串行数据的可能解决方案?
如果是,如何与秤建立连接并与其交换数据?
我是新手,所以我需要非常基本的信息,可能还需要一些教程或示例代码的链接来了解如何编写这个应用程序。
谢谢。
I would like to write a simple app that displays weight values sent from a scale.
The scale sends data (with a defined protocol) through RS232 port: considering that I cannot connect the iPhone to the Serial port, I was thinking to use a RS232/WiFi adapter (or RS232/BT adapter).
The iPhone should act as a Master and the scale a Slave: the iPhone sends a command (a simple text string) to the scale and the scale answers with the weight value.
Is the WiFi/BT a possibile solution to exchange the serial data between the iPhone and the scale ?
If yes, how can I establish the connection with the scale and then exchange the data with it ?
I'm a newbie so I would need very basic information and possibly some links to tutorials or sample code to understand how to write this app.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您听说过使用音频插孔作为数据接收器吗?
iPhone @ 1200波特率
Have you heard about using the audio jack as a receiver of data?
iPhone @ 1200BAUD
对于 Wifi,这是不可能的,因为 iOS 不支持点对点。不确定是否可以通过 BT 做到这一点 - 您必须定期配对并通过可用的配置文件进行传输。
With Wifi it's not possible cause iOS is not supporting peer-to-peer. Not sure you can do that with BT - you will have to do regular pairing and transmit over the available profiles.
它不是无线的,但您可以查看 http://www.redpark.com/c2db9.html。
我推荐的另一个选项是添加以太网串行服务器,然后您可以使用 iPhone 上的浏览器访问秤。
It's not wireless but you can checkout http://www.redpark.com/c2db9.html.
The other option I would recommend is to add a ethernet serial server, then you can access the scale with the browser on your iPhone.