Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Usage with go-streamdeck under windows - a fix I do not understand #30

Open
RudolfVonKrugstein opened this issue Mar 8, 2021 · 2 comments

Comments

@RudolfVonKrugstein
Copy link

Hi,

I am trying to use go-streamdeck, which internal uses karalabe/hid.

Its a library to control the elgato Stream Deck.

It works under linux, but fails under windows with:

panic: hidapi: Falscher Parameter.

Which is german for "wrong Parameter".

Without known much about USB, and HID: At one point tried the following:

I removed the windows specificas in these lines:

        if runtime.GOOS == "windows" {
		report = append([]byte{0x00}, b...)
	} else {
		report = b
	}

with

    report = b

At these lines: https://github.com/karalabe/hid/blob/master/hid_enabled.go#L167

Now it works!

I have no Idea why.

Should this be fixed? Or is my device strange?
What would be a good way to write a patch so I can used the unmodifed HID library?

@trinode
Copy link

trinode commented Aug 20, 2021

They're not wrong, I wasted hours with this

I'm using windows 10, and a logitech HID device

I've been trying to implement in go the following:
hidapitester --vidpid 046D:C52B --open --length 7 --send-output 0x10,0x01,0x09,0x1c,0x01,0x00,0x00 --read-input

using:

message := []byte{0x10, 0x01, 0x09, 0x1c, 0x01, 0x00, 0x00}
d.write(message)

got nothing but errors (same as the original reporter) but after forking this repo, and making those changes it all works.

@dolmen
Copy link
Contributor

dolmen commented Jan 13, 2022

The problem is probably #36.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants