使用 Rxtx 库向 USB 连接的手机发送消息会导致计算机锁定/崩溃 ߞ为什么?
最终,我想使用 Java 程序从通过 USB 插入的手机发送和接收消息。我可以使用 C# 程序来完成此操作,但是我想要发送和接收消息的程序是用 Java 编写的。为此,我使用 Rxtx 库(但使用 Cloudhopper 的 Windows x64 编译版本) 。但每当我尝试通过 USB 向手机发送任何命令时,我的计算机就会完全锁定,我必须硬重启它。
我正在运行的代码在这里:与串行端口的双向通信。我认为它成功建立了一个链接,因为它到达了从控制台接受输入的阶段,尽管当我按 Enter 键并发送输入时,计算机会锁定。
我正在运行 Windows 7 x64,使用 Eclipse。感谢您的帮助。
Ultimately I would like to use a Java program to send and receive messages from a phone that I have plugged in via USB. I can do this using a C# program, however the program I want to send and receive messages is written in Java. To do this I am using the Rxtx library (but using the Windows x64 compiled version from Cloudhopper). But whenever I try and send any commands to the phone via USB my computer completely locks up and I have to hard-restart it.
The code I am running is here: Two way communication with the serial port. I think that it successfully establishes a link since it gets to the stage where it accepts input from the console, though when I press enter, and the input is sent, the computer locks up.
I am running Windows 7 x64, using Eclipse. Thank you for any help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从代码中很难看出,但这里有一些调试技巧:
祝你好运!
A little hard to tell from the code, but here are some debugging tips:
Good luck!