简体   繁体   English

如何在Java中重置繁忙的串行端口

[英]How to reset busy serial ports in java

Im working on an application that will communicate with an external pin-pad through USB/Serial Port. 我正在开发将通过USB /串行端口与外部引脚板通信的应用程序。

Sometimes Im facing the problem that the operation wasn't finished properly and my pinpad gets stuck inside an unfinished transaction and i can't manage to start a new one. 有时,我面临着操作未正确完成且我的密码键盘卡在未完成的交易中的问题,而我无法设法开始新的交易。

What I'm looking for here is a way to kill all serial port connections and restart them within java code or an external script that could be called from my code when I get the 'busy port exception'. 我在这里寻找的是一种杀死所有串行端口连接并在java代码或外部脚本中重新启动它们的方法,当我收到“繁忙端口异常”时,可以从我的代码中调用这些脚本。

  • Im using JSSC for serial communication. 我正在使用JSSC进行串行通信。

Please describe the work flow I mean using the pin. 请描述我使用插针的工作流程。 Getting port busy exception means the way you have written code needs to be refined. 使端口繁忙异常意味着您需要改进编写代码的方式。 You can also try pyserial, serialpundit or fazecast libraries etc. 您也可以尝试pyserial,serialpundit或fazecast库等。

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

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