USBHost Keyboard

Hello,
I Implemented the USB keyboard and it worked perfectly with the previous firmware (2.1.0.6500).

With the new firmware 2.2.0.4000 it works correctly when I plug in the keyboard (the type of device in the event arguments of the callback:
UsbHostController_OnConnectionChangedEvent(UsbHostController sender, DeviceConnectionEventArgs e) where the e.Type is BaseDevice.DeviceType.Keyboard

When I unplug the keyboard, the e.Type returned is BaseDevice.DeviceType.HID instead of BaseDevice.DeviceType.Keyboard that I was expecting.

Is this a bug? Shouldn’t the “BaseDevice.DeviceType…” returned in both the DeviceConnectionStatus.Connected and DeviceConnectionStatus.Disconnected events match?

Thank you,
Vittorio

We will give it a try but it is best if you share small piece of code that shows the issue/.

I made a small test project starting from the example that you published in the USB Host documentation.

Doing this test app (that I’ll send you shortly via email), I noticed that when I plug in the keyboard the OnConnectionChanged is fired twice, once for the connection event of the Keyboard and once for the HID. When I unplug the keyboard the Disconnected event is fired for the HID device only and not for the keyboard.

As I didn’t change the code of my project that was working fine before, I guess this problem started from the latest FW release.

Best,
Vittorio

use

keyboard.Disconnected += (a, b) => {
                            Debug.WriteLine("Keyboard disconnected");
                        };

Or: check id when connect and disconnect events to know what device is disconnected.