[英]Bluetooth RFCOMM connection: read serial data from com port in Windows 7
I am working with the Android Bluetooth Chat sample application. 我正在使用Android蓝牙聊天示例应用程序。 I am trying to read serial data from the Android device in Windows 7.
我正在尝试从Windows 7中的Android设备读取串行数据。
I have been able to pair the Android device to the Bluetooth adapter on my laptop. 我已经能够将Android设备与笔记本电脑上的蓝牙适配器配对。 I replaced the UUID in the sample application with the following per some other discussions:
在其他一些讨论中,我将示例应用程序中的UUID替换为以下内容:
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. 当我运行Android应用程序时,我可以连接到笔记本电脑。 In the "Hardware" properties of my Android device there is a "Device Function" entry called "Standards Serial over Bluetooth link (COM10)".
在我的Android设备的“硬件”属性中,有一个“设备功能”条目,称为“蓝牙标准串行链接(COM10)”。 When I attempt to connect CoolTerm to COM10 I receive "error 1168" (there is no additional description for the error).
当我尝试将CoolTerm连接到COM10时,我收到“错误1168”(该错误没有其他描述)。
Am I misunderstanding something about the process of sending serial data via Bluetooth to a Windows com port? 我是否对通过蓝牙将串行数据发送到Windows com端口的过程有误解?
You have to use the proper Bluetooth API from your Windows application to call and connect to your Android device, that is: 您必须使用Windows应用程序中正确的Bluetooth API来调用并连接到Android设备,即:
Be sure that you are selecting the correct COM. 确保选择正确的 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.
在我的上一个需要SPP(串行端口配置文件)蓝牙通信的Android应用程序中,当Windows 7配对时,我打开了多个COM。
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). 如果COM10无法正常工作,请确认它是“传入” COM(或者可能是传出的COM,我记不清b / c已经几个月了)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.