开发者

How can I Access COM Port in JAVA

I need to make an SMS transceiver that automatically inputs to a database every SMS that it receives. I am usin开发者_如何学Pythong a USB GSM Modem and able to use AT commands via HyperTerminal at COM Port 3.

Thanks.


The official API from sun/oracle for communication with serial/parallel ports is the Java Communication API ( www.oracle.com slash technetwork/java/index-jsp-141752.html ).

Be aware: this api just contains Java interfaces - no implementation classes. Sun/oracle suggests to use the rxtx library as implementation (licensed as LGPL).

I have been using the rxtx library successfully. The official webpage is not looking promising, but the implementation works fine for serial and parallel ports: http://users.frii.com/jarvi/rxtx/


You can take a look at SMSLib. It is Java library for interacting with GSM Devices. It should save you some time.

If this is not what you are looking for, check here.


If you don't want use lib then write your code in cpp and use JNA or JNI to invoke the function. Third party libaray depends on hardware, I am not sure these will behave well.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜