Page 1 of 1

Rename device with USBComposite library?

Posted: Sat Aug 22, 2020 8:28 am
by Kprellz
Hey all!
kind of silly but i'm wondering if its possible to change what name the computer sees when using the USBComposite class? as of right now i'm using the Midi portion of the library and it comes up as "maple" but im wondering if would be possible to make that custom? I thought I could simply change the name in the usb_generic.c but it hasnt worked for me.
Any help would be greatly appreciated!
Thanks!

Re: Rename device with USBComposite library?

Posted: Tue Sep 08, 2020 4:27 pm
by MoDu
Easy peasy.

Code: Select all

const char ManufacturerName[] = "Kprellz";
const char DeviceName[] = "Device name";
const char DeviceSerial[] = "00000000000000000001";

USBComposite.setManufacturerString(ManufacturerName);
USBComposite.setProductString(DeviceName);
USBComposite.setSerialString(DeviceSerial);
USBComposite.setVendorId(VendorId);
USBComposite.setProductId(ProductId);

Re: Rename device with USBComposite library?

Posted: Sat Dec 19, 2020 1:23 pm
by huseyinctlbs
Hello. I have tried this code but it doesn't work. The complier gives these errors;

'USBComposite' does not name a type USBComposite.setManufacturerString(ManufacturerName);
'USBComposite' does not name a type USBComposite.setProductString(DeviceName);
'USBComposite' does not name a type USBComposite.setSerialString(DeviceSerial);.

Im using 0.99 version. Am i getting these errors because of the version?

Re: Rename device with USBComposite library?

Posted: Wed Dec 23, 2020 12:54 pm
by MoDu

Code: Select all

#include <USBComposite.h>
Just to be sure.

I use the latest version that's on github. I would suggest you do the same.

Edit: I just tried the 0.99 release (cf99055...) and it still works as expected on my project.

Re: Rename device with USBComposite library?

Posted: Thu Jan 07, 2021 12:38 pm
by huseyinctlbs
I have tried in more than 10 different board but didn't get success. There must be something wrong in my setup. Am i have to delete driver of stm for seeing difference of name?

And im trying the name change for joystick. Is it different?


I have found solution after posting this. I have seperated the variables side and USBComposite sides then it complied. Maybe i have putting the code snippet wrong place in the complier before.

And there is my coplied code;

#include <USBComposite.h>
const char ManufacturerName[] = "xxx";
const char DeviceName[] = "yyyy";
const char DeviceSerial[] = "00000000000000000001";

USBHID HID;
HIDJoystick Joystick(HID);

void setup() {

USBComposite.setManufacturerString(ManufacturerName);
USBComposite.setProductString(DeviceName);
USBComposite.setSerialString(DeviceSerial);
USBComposite.setVendorId(0x987);

HID.begin(HID_JOYSTICK);
while (!USBComposite);

Re: Rename device with USBComposite library?

Posted: Thu Jan 07, 2021 6:36 pm
by MoDu
See my working project for reference: https://github.com/GitMoDu/USB-x360-N64 ... roller.ino

What do you expect to see changed? I'm using only the xBox360 Controller end point, but all the details appear correct on the Driver Details on Windows.