-
Notifications
You must be signed in to change notification settings - Fork 71
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
HidServiceEvent not fired during HidService.start #101
Comments
…evice attached flag after manual start
Hi @Laivindur Good spot! The I've updated the examples (and added some ANSI colour) to reflect various customisations with a manual start being one of them. Can you review the changes and see if it fixes this issue for you? |
Platform architecture: x86-64
Resource prefix: linux-x86-64
Libusb activation: true
�[32mManually starting HID services.�[0m
�[32mEnumerating attached devices...�[0m
�[34mDevice attached: HidServicesEvent{hidDevice=HidDevice [path=0001:0014:00, vendorId=0x483, productId=0x5750, serialNumber=STM3210, releaseNumber=0x200, manufacturer=STMicroelectronics, product=STM32 Custm HID, usagePage=0x0, usage=0x0, interfaceNumber=0]}�[0m
HidDevice [path=0001:0014:00, vendorId=0x483, productId=0x5750, serialNumber=STM3210, releaseNumber=0x200, manufacturer=STMicroelectronics, product=STM32 Custm HID, usagePage=0x0, usage=0x0, interfaceNumber=0]
�[32mWaiting 30s to demonstrate attach/detach handling. Watch for slow response after write if configured.
�[0m Worked like a charm! I will upgrade to the new version as soon as it's released. Thank you for the quick response and fix. It allows me to get rid of ugly walkaround :-) |
Thanks for testing it @Laivindur. I'll merge it into |
Hi @gary-rowe
I have realised that, for some reason, when we call
hidService.start()
by the first time, noHidServiceEvent
is handled by the listener.Here the code I use to start
HidService
. It's very similar to the one in the project's exampleNote that, the listener, has not been implemented in the class itself. It's defined on-the-fly by an anonymous class
In production, it's a first-citizen class with its own file.
I was expecting that, during the
HidService
initialization, any HID device already attached will cause aHidServiceEvent
. Inspecting hid4java classes, I have found that, somehow, I'm right.HidService.start()
callsHidDeviceManager.start()
and ...The method
scan()
The first time any device is mapped into
attachedDevices
should result in a new call tostenerList.fireHidDeviceAttached(attachedDevice);
Given the code above, I should see something like this in the console
Note the output after
Starting HID services.
starting withDevice attached: HidServicesEvent{
.At the moment, the output is
What am I doing wrong? I'm missing something, but I don't know what
Thank you in advance.
The text was updated successfully, but these errors were encountered: