On Nov 14, 2008, at 8:34 PM, Dave Kennedy wrote:
Hi,
I am trying to use enum's,
but both HIDP_REPORT_TYPE and USAGE cause runtime error (compiles
OK) "Unsupported argument type".
HIDP_REPORT_TYPE is defined in HIDLibrary.java and USAGE is in
USAGE.JAVA .
HIDLibrary.java and USAGE.JAVA are attached.
Unsupported argument type hid.HIDLibrary$HIDP_REPORT_TYPE at
parameter 0 of function HidP_GetUsageValue
Native-side these are integer values. Java-side, they are enum
objects. You have to tell JNA how to translate to the native value,
either with a TypeMapper or by making the enum objects implement
NativeMapped.
result = hidLibrary.HidP_GetUsageValue(
HIDLibrary.HIDP_REPORT_TYPE.HidP_Input,
USAGE.UPG_MSR,
linkCollection,
USAGE.UID_TRACK_1_DECODE_STATUS,
tk1DcdSts,
preparsedData,
readBuffer,
capabilities.InputReportByteLength);
package hid;
...
public interface HIDLibrary extends Library, W32API, UUID {
...
int HidP_GetUsageValue(
HIDP_REPORT_TYPE ReportType,
USAGE UsagePage,
char LinkCollection,
USAGE Usage,
IntByReference UsageValue,
Pointer PreparsedData,
PointerByReference Report,
char ReportLength
);
...
}
<
HIDLibrary
.java
<
USAGE
.java
To unsubscribe, e-mail: user...@jna.dev.java.net
For additional commands, e-mail: user...@jna.dev.java.net