Skip to content

Purejavahidapi and Jna no more compatible? #4

@Adi-18

Description

@Adi-18

Its a nice projeckt bat it looks like its no more compatible with new Stream Deck (5 x 3 Buttons).

There was some exceptions. After inserted jna 5.5.0 and build current nyholku/urejavahidapi. I have still exception while running Example1_Displaying_A_Key.java
Vendor-ID: 4057, Product-ID: 109
Found ESD [4057:109]
Connected Stream Decks:
Manufacurer: Elgato
Product: Stream Deck
Device-Id: HID\VID_0FD9&PID_006D\8&3992574&0&0000
Serial-No: AL17J2C01756
Path: \?\hid#vid_0fd9&pid_006d#8&3992574&0&0000#{4d1e55b2-f16f-11cf-88cb-001111000030}

Error sending the following command-class to the esd: class de.rcblum.stream.deck.device.StreamDeck$IconUpdater
java.lang.ArrayIndexOutOfBoundsException
	at java.lang.System.arraycopy(Native Method)
	at purejavahidapi.windows.HidDevice.setOutputReport(HidDevice.java:170)
	at de.rcblum.stream.deck.device.StreamDeck.internalDrawImage(StreamDeck.java:463)
	at de.rcblum.stream.deck.device.StreamDeck$IconUpdater.run(StreamDeck.java:230)
	at de.rcblum.stream.deck.device.StreamDeck$DeckWorker.run(StreamDeck.java:182)
	at java.lang.Thread.run(Thread.java:748)

It means the place with System.arraycopy(data, 0, m_OutputReportArray, 1, length)

	@Override
	synchronized public int setOutputReport(byte reportID, byte[] data, int length) {
		if (!m_Open)
			throw new IllegalStateException("device not open");
		if (m_OutputReportLength == 0)
			throw new IllegalArgumentException("this device supports no output reports");
		// In Windows writeFile() to HID device data has to be preceded with the report
		// number, regardless
		Arrays.fill(m_OutputReportArray, (byte)0);
		m_OutputReportArray[0] = reportID;
		System.arraycopy(data, 0, m_OutputReportArray, 1, length);

Length of data is 8190 but m_OutputReportArray is only 1024 get from caps.OutputReportByteLength;
Where is this from?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions