View previous topic :: View next topic |
Author |
Message |
Wilksey
Joined: 14 Aug 2011 Posts: 36 Location: Somerset, UK
|
USB Descriptors |
Posted: Fri Nov 10, 2023 1:31 pm |
|
|
Apologies if this has been answered before, I had a quick scour and couldn't find what I wanted.
I am after changing the HID and PID so it shows something meaningful rather than "USB Input Device" in Device Manager, but I am unsure f where to change this, my code has these included but I didn't want to touch them without checking first:
Code: |
#include <pic18_usb.h>
#include <usb_desc_hid.h>
#include <usb.c> |
TIA |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19569
|
|
Posted: Sat Nov 11, 2023 10:42 am |
|
|
The descriptors are in use_desc_hid.h
However understand that generally descriptors are _registered_. You
cannot just arbitrarily create one. HID does allow some flexibility.
Look at the tools here:
[url]
https://www.usb.org/hid
[/url] |
|
|
Wilksey
Joined: 14 Aug 2011 Posts: 36 Location: Somerset, UK
|
|
Posted: Sat Nov 11, 2023 3:12 pm |
|
|
Yeah, I was more after changing the description, I changed that file, but Window 11 just shows it as a "USB Input device", it doesn't even say "CCS Demo", does Windows 11 not show or am I missing something? |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19569
|
|
Posted: Sun Nov 12, 2023 2:10 am |
|
|
The whole point of HID is it allows generic devices like this without having
to have a specific driver. The device will be identified if you go to the 'details'
tab, and look for the field 'Bus reported device description'. |
|
|
Wilksey
Joined: 14 Aug 2011 Posts: 36 Location: Somerset, UK
|
|
Posted: Sun Nov 12, 2023 7:03 am |
|
|
I tried the CCS example and that tab shows nothing, it's blank.
[img]https://ibb.co/XFG83zR[/img] |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19569
|
|
Posted: Mon Nov 13, 2023 1:47 am |
|
|
That means the default windows driver is not loading it in for you.
Historically I've always got it by opening the device, and used a call to
LibUsb.getStringDescriptor(deviceDescriptor)
This merrily returns the string descriptor from the CCS driver. Have
used this several times in code to offer users access 'only' to the devices
I want. Using this sequentially to fill a list of the devices the code can
connect to.
Must say on my system the Bus reported device descriptor is filled in,
once a device is connected. |
|
|
Wilksey
Joined: 14 Aug 2011 Posts: 36 Location: Somerset, UK
|
|
Posted: Mon Nov 13, 2023 5:37 am |
|
|
Odd, it works, just the descriptor missing, is it a Windows 11 thing? |
|
|
Wilksey
Joined: 14 Aug 2011 Posts: 36 Location: Somerset, UK
|
|
Posted: Mon Nov 13, 2023 10:31 am |
|
|
So, I installed LibUSBDotNet and compiled the Show.Info example and the product field says CCS HID Demo, so I don't know why Windows is blank?? |
|
|
|