蓝牙 RFCOMM 连接:在 Windows 7 中从 com 端口读取串行数据
我正在使用 Android 蓝牙聊天示例应用程序。我正在尝试从 Windows 7 中的 Android 设备读取串行数据。
我已经能够将 Android 设备与笔记本电脑上的蓝牙适配器配对。根据其他一些讨论,我将示例应用程序中的 UUID 替换为以下内容:
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
当我运行 Android 应用程序时,我能够连接到笔记本电脑。在我的 Android 设备的“硬件”属性中,有一个名为“标准蓝牙链接串行 (COM10)”的“设备功能”条目。当我尝试将 CoolTerm 连接到 COM10 时,我收到“错误 1168”(没有对该错误的附加说明)。
我是否误解了通过蓝牙将串行数据发送到 Windows com 端口的过程?
I am working with the Android Bluetooth Chat sample application. I am trying to read serial data from the Android device in Windows 7.
I have been able to pair the Android device to the Bluetooth adapter on my laptop. I replaced the UUID in the sample application with the following per some other discussions:
private static final UUID MY_UUID = UUID.fromString("00001101-0000-1000-8000-00805F9B34FB");
When I run the Android application I am able to connect to the laptop. In the "Hardware" properties of my Android device there is a "Device Function" entry called "Standards Serial over Bluetooth link (COM10)". When I attempt to connect CoolTerm to COM10 I receive "error 1168" (there is no additional description for the error).
Am I misunderstanding something about the process of sending serial data via Bluetooth to a Windows com port?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
确保您选择正确 COM。在我上一个需要 SPP(串行端口配置文件)蓝牙通信的 Android 应用程序中,当 Windows 7 配对时,我打开了几个 COM。
如果 COM10 无法正常工作,请验证它是否是“传入”COM (或者可能是外向,我不记得已经几个月了)。
Be sure that you are selecting the correct COM. In my last Android application that required SPP (Serial Port Profile) Bluetooth communication, when Windows 7 paired I had several COM's open up.
If COM10 is not working, verify that it is the "incoming" COM (or maybe it's outgoing, I can't remember b/c it's been a few months).
您必须在 Windows 应用程序中使用正确的蓝牙 API 来调用并连接到您的 Android 设备,即:
You have to use the proper Bluetooth API from your Windows application to call and connect to your Android device, that is: