2 messages in net.java.dev.jna.usersRe: [jna-users] Unsupported argument ...
FromSent OnAttachments
Dave KennedyNov 14, 2008 5:33 pm.java, .java
Timothy WallNov 14, 2008 9:07 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: [jna-users] Unsupported argument type <enum> at parameter 0 of functionActions...
From:Timothy Wall (twal@dev.java.net)
Date:Nov 14, 2008 9:07:46 pm
List:net.java.dev.jna.users

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