-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
202 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# USB Device Enumeration (Kotlin) | ||
|
||
This sample enumerates the connected USB devices and provides information about the interfaces and endpoints. | ||
|
||
## Prerequisites | ||
|
||
- Java 21 | ||
- Apache Maven | ||
- 64-bit operating system (Windows, macOS, Linux) | ||
|
||
## How to run | ||
|
||
### Install Java 21 | ||
|
||
Check that *Java 21* is installed: | ||
|
||
```shell | ||
$ java -version | ||
``` | ||
|
||
If not, download and install it, e.g. from [Azul](https://www.azul.com/downloads/?package=jdk). | ||
|
||
### Install Maven | ||
|
||
Check that *Maven* is installed: | ||
|
||
```shell | ||
$ mvn -version | ||
``` | ||
|
||
If it is not present, install it, typically using package manager like *Homebrew* on macOS, *Chocolately* on Windows and *apt* on Linux. | ||
|
||
### Build a self-contained jar file | ||
|
||
```shell | ||
$ cd JavaDoesUSB/examples/enumerate_kotlin | ||
$ mvn clean package | ||
``` | ||
|
||
### Run the jar | ||
|
||
```shell | ||
$ java --enable-preview --enable-native-access=ALL-UNNAMED -jar target/enumerate-0.7.0-jar-with-dependencies.jar | ||
Device: | ||
VID: 0xcafe | ||
PID: 0xceaf | ||
Manufacturer: JavaDoesUSB | ||
Product name: Loopback | ||
... | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# USB Device Monitoring (Kotlin) | ||
|
||
This sample enumerates the connected USB devices and provides information about the interfaces and endpoints. | ||
|
||
## Prerequisites | ||
|
||
- Java 21 | ||
- Apache Maven | ||
- 64-bit operating system (Windows, macOS, Linux) | ||
|
||
## How to run | ||
|
||
### Install Java 21 | ||
|
||
Check that *Java 21* is installed: | ||
|
||
```shell | ||
$ java -version | ||
``` | ||
|
||
If not, download and install it, e.g. from [Azul](https://www.azul.com/downloads/?package=jdk). | ||
|
||
### Install Maven | ||
|
||
Check that *Maven* is installed: | ||
|
||
```shell | ||
$ mvn -version | ||
``` | ||
|
||
If it is not present, install it, typically using package manager like *Homebrew* on macOS, *Chocolately* on Windows and *apt* on Linux. | ||
|
||
### Build a self-contained jar file | ||
|
||
```shell | ||
$ cd JavaDoesUSB/examples/monitor_kotlin | ||
$ mvn clean package | ||
``` | ||
|
||
### Run the jar | ||
|
||
```shell | ||
$ java --enable-preview --enable-native-access=ALL-UNNAMED -jar target/monitor-0.7.0-jar-with-dependencies.jar | ||
WARNING: "public static final void net.codecrete.usb.examples.MonitorKt.main()" chosen over "public static void net.codecrete.usb.examples.MonitorKt.main(java.lang.String[])" | ||
Present: VID: 0xcafe, PID: 0xceaf, manufacturer: JavaDoesUSB, product: Loopback, serial: 35A737883336, ID: 4295265643 | ||
Present: VID: 0x1a40, PID: 0x0801, manufacturer: null, product: USB 2.0 Hub, serial: null, ID: 4295259660 | ||
Monitoring... Press ENTER to quit. | ||
... | ||
``` |
Oops, something went wrong.