forked from mfulz_github/qmk_firmware
Don't validate the Device Descriptor's vendor ID when validating that a device is an Android Accessory device; the Product ID and (later) Accessory protocol support is enough to probe AOA class support without having to maintain a list of Android device manufacture VID values.
This commit is contained in:
parent
84a739ae72
commit
676de74d9b
|
@ -55,10 +55,6 @@ uint8_t ProcessDeviceDescriptor(void)
|
||||||
if (DeviceDescriptor.Header.Type != DTYPE_Device)
|
if (DeviceDescriptor.Header.Type != DTYPE_Device)
|
||||||
return InvalidDeviceDataReturned;
|
return InvalidDeviceDataReturned;
|
||||||
|
|
||||||
/* Validate returned device Vendor ID against the Android ADK spec values */
|
|
||||||
if (DeviceDescriptor.VendorID != ANDROID_VENDOR_ID)
|
|
||||||
return IncorrectAndroidDevice;
|
|
||||||
|
|
||||||
/* Check the product ID to determine if the Android device is in accessory mode */
|
/* Check the product ID to determine if the Android device is in accessory mode */
|
||||||
if ((DeviceDescriptor.ProductID != ANDROID_ACCESSORY_PRODUCT_ID) &&
|
if ((DeviceDescriptor.ProductID != ANDROID_ACCESSORY_PRODUCT_ID) &&
|
||||||
(DeviceDescriptor.ProductID != ANDROID_ACCESSORY_ADB_PRODUCT_ID))
|
(DeviceDescriptor.ProductID != ANDROID_ACCESSORY_ADB_PRODUCT_ID))
|
||||||
|
|
|
@ -64,9 +64,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Macros: */
|
/* Macros: */
|
||||||
/** Vendor ID value in a Device Descriptor to indicate an Android device. */
|
|
||||||
#define ANDROID_VENDOR_ID 0x18D1
|
|
||||||
|
|
||||||
/** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory mode. */
|
/** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory mode. */
|
||||||
#define ANDROID_ACCESSORY_PRODUCT_ID 0x2D00
|
#define ANDROID_ACCESSORY_PRODUCT_ID 0x2D00
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,6 @@ bool AOA_Host_ValidateAccessoryDevice(USB_ClassInfo_AOA_Host_t* const AOAInterfa
|
||||||
if (DeviceDescriptor->Header.Type != DTYPE_Device)
|
if (DeviceDescriptor->Header.Type != DTYPE_Device)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (DeviceDescriptor->VendorID != ANDROID_VENDOR_ID)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
*NeedModeSwitch = ((DeviceDescriptor->ProductID != ANDROID_ACCESSORY_PRODUCT_ID) &&
|
*NeedModeSwitch = ((DeviceDescriptor->ProductID != ANDROID_ACCESSORY_PRODUCT_ID) &&
|
||||||
(DeviceDescriptor->ProductID != ANDROID_ACCESSORY_ADB_PRODUCT_ID));
|
(DeviceDescriptor->ProductID != ANDROID_ACCESSORY_ADB_PRODUCT_ID));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue