简体   繁体   English

使用usb / rs232转换器时,我可以使用javax.comm库吗?

[英]Can I use javax.comm library when usb/rs232 converter is used?

I want to transfer a number from java program which is on laptop (means there is no rs232 protocol pin is provided) to a pic microcontroller(where essentially I have to used rs232) .Therefore here I require usb /rsr232 converter. 我想从笔记本电脑上的java程序传输一个数字(意味着没有提供rs232协议引脚)到pic微控制器(基本上我必须使用rs232)。因此我需要usb / rsr232转换器。 Which Java library should I use ? 我应该使用哪个Java库? Will it work with javax.comm library? 它可以与javax.comm库一起使用吗?

The answer is it depends on the USB/RS232 converter you are using. 答案是它取决于您使用的USB / RS232转换器。 Most that I have used will expose the serial port as a virtual com port device on your operating system (see page 8 of this PDF document ). 我使用的大部分内容都会将串行端口暴露为操作系统上的虚拟COM端口设备(请参阅本PDF文档的第8页 )。 If that's the case, javax.comm will work fine. 如果是这样, javax.comm将正常工作。 If not, you will have to use a proprietary API for the hardware which should be provided by the manufacturer. 如果没有,您将不得不使用专有的API来为制造商提供的硬件。 If you have hardware like this, I would strongly recommend replacing it with a class-compatible USB device. 如果你有这样的硬件,我强烈建议用类兼容的USB设备替换它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM