Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/main/java/org/hid4java/HidServices.java
Original file line number Diff line number Diff line change
Expand Up @@ -205,4 +205,13 @@ public static String getVersion() {
return value;
}
}

/**
* Returns the full version of the underlying hidapi library
*
* @return The version in major.minor.patch format
*/
public static String getNativeVersion() {
return HidApi.getVersion();
}
}
14 changes: 14 additions & 0 deletions src/main/java/org/hid4java/jna/HidApi.java
Original file line number Diff line number Diff line change
Expand Up @@ -488,4 +488,18 @@ private static void logTraffic(WideStringBuffer buffer, boolean isWrite) {
}
}

/**
* Returns the full version of the underlying hidapi library
*
* @return The version in major.minor.patch format
*
* @see org.hid4java.HidServices#getNativeVersion
*/
public static String getVersion() {
if(hidApiLibrary == null) {
init();
}
return hidApiLibrary.hid_version_str();
}

}
7 changes: 7 additions & 0 deletions src/main/java/org/hid4java/jna/HidApiLibrary.java
Original file line number Diff line number Diff line change
Expand Up @@ -269,4 +269,11 @@ public interface HidApiLibrary extends Library {
* @return The pointer if successful or null
*/
Pointer hid_open_path(String path);

/**
* Get version of hidapi library
*
* @return Version in major.minor.patch format
*/
String hid_version_str();
}