- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用 jssc 与设备通信。
在 Windows 和 Linux 中,该程序正常,但我遇到了病毒问题,我格式化了我的电脑,然后该程序不适用于 Windows,但在 Linux 中该程序运行良好。
我不知道为什么程序停止工作。
程序代码为:
try {
command = new String(commandSend);
serialPort.writeBytes(command.getBytes());
logger.info("Sending to port " + a.getPort() + " " + command);
Thread.sleep(1000);//Wait 0.8 seconds
retorno = serialPort.readString();
} catch (Exception e) {
logger.error("Problems with send/receive command with the analyzer");
logger.error(e.getMessage());
logger.error(e.toString());
e.printStackTrace();
}
最佳答案
格式化PC后,请安装UART IC的驱动。
关于linux - jssc windows 和 linux,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33294453/
在 SerialPort.java 中,我想了解以下有关 writeBytes 和 readBytes 方法的信息: 那些会阻止吗? 如何解释 return --boolean-- 代码? 最佳答案
我正在使用 JSSC 串行端口包在我的应用程序和连接到串行端口的设备之间交换数据。我制作了一个简单的应用程序,可以将识别消息发送到设备并打印响应。我希望它能够抵抗连接错误(例如在通信过程中拔掉电缆后)
我正在使用 jssc 库通过串行端口与设备进行通信。在标准 java SerialComm 库中有两个方法 getInputStream() 和 getOutputStream()。 为什么我需要这个
我正在尝试读取 RFID 的 UID 并将其发送到 Netbeans,但是当我尝试显示字符串时,它只显示最后一位。例如,当我扫描RFID时,UID是C945AA2A,但是当显示在文本字段上时,它只显示
我知道串行端口不太好,但仍然有一点希望...我正在使用 JSSC 库进行通信。 JSSC 库是否有方法来检测已建立的连接何时因硬件移除而丢失? 最佳答案 jssc 没有热插拔或设备移除等机制。提供您的
我在跨平台应用程序中使用 jSSC-2.6.0。 Windows 机器(32/64 位)上返回的端口列表是正确的,但是 MacOSX(v10.6 和 10.7)应用程序不返回任何串行设备。如果我在终端
我正在尝试使用串行端口在两台计算机之间进行通信,并且我是该领域的新手。我需要将请求从一台计算机(例如 A)发送到另一台计算机(例如 B)并接收所发送请求的响应。我正在使用响应更新 Java Swing
我正在使用 Eclipse IDE。随着 jssc-0.9.0 版本的发布,我已经正确地将 jssc.jar 添加到引用库中。但是当我运行它时,它总是终止。说“主要 [Java 应用程序]/usr/l
我正在使用 jssc 与设备通信。 在 Windows 和 Linux 中,该程序正常,但我遇到了病毒问题,我格式化了我的电脑,然后该程序不适用于 Windows,但在 Linux 中该程序运行良好。
我正在尝试在我的java应用程序中借助Com端口来实现数据传输。首先,我决定像这样创建 SerialPort 对象。 SerialPort serialPort = new SerialPort("
我在编写 jSSC 函数时遇到问题。我的 Arduino Uno 板似乎无法从我的 Java 程序获取数据。 我有一个由 Arduino Uno 板控制的步进电机。我制作了一个有 2 个按钮的简单程序
我正在尝试使用 jSSC 在 Java 中使用串口。我的代码: import jssc.SerialPortList; .... String[] ports = SerialPortList.get
我正在尝试与 JSSC 合作。我根据此链接构建了我的应用程序: https://code.google.com/p/java-simple-serial-connector/wiki/jSSC_exa
使用 Java Simple Serial Connector (jSSC) 时图书馆,SerialPort.getInputBufferBytesCount()即使缓冲区中有字节,也始终返回零。 可
我需要与具有 rs232 输出的设备通信,但我的笔记本电脑没有有一个RS232端口,然后我买了一个RS232转USB转换器,现在我想听用于数据的 USB 端口,我可以使用 jssc 来实现此目的吗?
我正在制定一个工作计划。该程序只是一个通过串口连接设备的终端,在这个特定的设备中,它需要您同时按 Ctrl 和 P 才能进入菜单。目前,我的临时解决方案是使用 JSwing 的 Robot,这正是我不
我们正在创建一个可运行的 java jar 以在 beagle bone black(运行 ubuntu)上运行。 我们已经创建了一个可运行的 jar,它可以在我们的 mac 和 pc(windows
我正在通过串口从硬件读取数据,并且使用jssc的readString()方法。 我使用了计时器来连续获取数据。因此,每当我更改命令时,接收到的数据都是与先前命令和当前命令相关的组合。 在使用 C# 时
这是我的 Java 代码: /* * To change this template, choose Tools | Templates * and open the template in th
如何使用 jssc ( java-simple-serial-connector) 获取串口的设备描述符? getPortName() 方法提供端口名称(例如 COM2),但描述符会更有帮助。 如果需
我是一名优秀的程序员,十分优秀!