Skip to content
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

Add Unique Serial ID to X-Input Device Descriptor #1234

Open
arntsonl opened this issue Dec 13, 2024 · 1 comment
Open

Add Unique Serial ID to X-Input Device Descriptor #1234

arntsonl opened this issue Dec 13, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@arntsonl
Copy link
Contributor

Currently we have an X-Input String version with a static value of "08FEC93" in XInputDescriptors.h

According to https://learn.microsoft.com/en-us/windows-hardware/test/hlk/testref/0f2d5113-cf70-4cda-8afc-b7005d1e2739 the version ID with the serial should be unique per device to tell Windows when a "new" device has been plugged in versus an already recognized device.

What we should do is remove our 4 byte serial and replace it with the first-last-hash? 4 bytes of the unique Pico ID serial. This can be done at driver start-up once.

@arntsonl arntsonl added the enhancement New feature or request label Dec 13, 2024
@arntsonl
Copy link
Contributor Author

arntsonl commented Dec 13, 2024

We are already doing this for the Xbox One which uses a much larger 16 byte serial ID. We are doing it with the following code:

static const uint8_t * xbone_get_string_descriptor(int index) {
	if ( index == 3 ) {
		// Generate a serial number from the pico's unique ID
		pico_unique_board_id_t id;
		pico_get_unique_board_id(&id);
		memcpy(uniqueSerial, (uint8_t*)&id, PICO_UNIQUE_BOARD_ID_SIZE_BYTES);
        return uniqueSerial;
	} else if ( index == 4 ) { // security method used
		return xboxSecurityMethod;
	} else if ( index == 0xEE ) { // ONLY WINDOWS DOES THIS??
		return xboxOSDescriptor;
	}
	return xbone_string_descriptors[index];
}

If we could convert this to our 3-byte serial ID for the xbox OG, we'd be in good shape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant