Parallel Port Java Programming

你说的曾经没有我的故事 提交于 2019-12-12 03:12:18

问题


how to control data bits of a parallel port via java.actually i am making a project on " WEB BASED POWER HANDLING" in which i have to control devices remotely from other machines over internet through parallel port progrmming.any help?


回答1:


There is not a standard Java API for handling the parallel port so you will have to have the underlying operating system help you.

Most operating system allows talking to external devices - Windows through the "PRN" magic name, Linux through various /dev/files - so if you can do what you want through that, then you are fine.

If not, you will need to find native code that can do what you need, and link it into your Java application through JNI, which can be a very interesting experience. If so, you might get a better result by using a native technology to the platform in question to do this. Most modern languages have web servers as a standard component.




回答2:


Java does not support parallel ports - or any other kind of hardware port, for that matter - out of the box. You will need an external library that contains the native code necessary to communicate with the port of your choice.

You might want to have a look at the RXTX library. It seems that it supports parallel ports to a degree...




回答3:


Do yourself a favour, forget the antique and obsolete Printer port. Since a couple of yea5rs, most computers don't even have one any longer. Check out USB-connected gadgets, such as Arduino: Make a USB Device, Control It In Java



来源:https://stackoverflow.com/questions/9537846/parallel-port-java-programming

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!