CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

USB Descriptors

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Wilksey



Joined: 14 Aug 2011
Posts: 36
Location: Somerset, UK

View user's profile Send private message

USB Descriptors
PostPosted: Fri Nov 10, 2023 1:31 pm     Reply with quote

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: 19552

View user's profile Send private message

PostPosted: Sat Nov 11, 2023 10:42 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Nov 11, 2023 3:12 pm     Reply with quote

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: 19552

View user's profile Send private message

PostPosted: Sun Nov 12, 2023 2:10 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Nov 12, 2023 7:03 am     Reply with quote

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: 19552

View user's profile Send private message

PostPosted: Mon Nov 13, 2023 1:47 am     Reply with quote

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

View user's profile Send private message

PostPosted: Mon Nov 13, 2023 5:37 am     Reply with quote

Odd, it works, just the descriptor missing, is it a Windows 11 thing?
Wilksey



Joined: 14 Aug 2011
Posts: 36
Location: Somerset, UK

View user's profile Send private message

PostPosted: Mon Nov 13, 2023 10:31 am     Reply with quote

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??
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group