hid
hid copied to clipboard
Read support
Is it possible to read from the device via Input Report?
Not yet. you'll need to implement it yourself. But it shouldn't be a big deal... Sorry that I've no time for this at the moment. But I would be happy if someone could send a PR
I have read support working on all three platforms in my fork: https://github.com/flynn/hid
This fork is maintained to support my U2F package: https://github.com/flynn/u2f
Feel free to upstream any commits that you'd like, I had to rearrange some things to fit my needs.
It would be very great to add read support on this repo (ucase: read serial for a blinkstick product)
Hi,
I've added read support on https://github.com/boombuler/hid/tree/read which is very basic and is only implemented for OSX. If anyone could provide linux / windows code, I would be happy to merge it to master...
Thanks a lot. Just a question on how to use it, In Python, read serial for Blinkstick is done with
usb.util.get_string(self.device, length, index)
usb.util.get_string(self.device, 256, 3)
How to get same information with read func ?
There is also some read support for all platforms in https://github.com/flynn/hid
Hi again. I've modified the source a little.
@titanous I've read through your osx source code and if I'm correct you would lock an OS thread for each device you are listening to. Correct? My implementation of "Listen" should not have this issue (but may have others...). I would also like a funktion to stop listening to the given device... But first of all: Thanks! Your code was very helpful
@yesnault with the newest version the following code should give some results:
stop := make(chan struct{})
reports, errors := device.Listen(stop)
go func() {
for {
select {
case rep := <-reports:
fmt.Println("Report:", rep)
case err := <-errors:
fmt.Println("Error:", err)
case <-stop:
return
}
}
}()
fmt.Scanln()
close(stop)