简体   繁体   English

跨平台的方式来监听USB连接?

[英]Cross-Platform way to listen for USB connections?

I'm building a cross-platform Java program, and I need it to be able to recognize when a USB device is connected or disconnected. 我正在构建一个跨平台的Java程序,我需要它能够识别连接或断开USB设备的时间。 I don't need to do anything with the device, I just need to know if/when it happens. 我不需要对设备做任何事情,我只需要知道是否/何时发生。 I've looked at jUSB, but that's Windows-only and unnecessarily big. 我看过jUSB,但这只是Windows的,不必要的大。 Is there any simple way to do this? 有没有简单的方法可以做到这一点?

To the best of my knowledge information and belief, the answer is that there is no simple way to do that. 据我所知和所信,答案是没有简单的方法可以做到这一点。 Fundamentally, the Java Virtual Machine (JVM) is an abstraction from your real hardware (not to mention that Java predates USB). 从根本上讲,Java虚拟机(JVM)是​​您实际硬件的抽象(更不用说Java早于USB)。

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

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