Update UC3 platform driver support to use the bitmasks defined in the header files...
[pub/USBasp.git] / Demos / Host / Incomplete / AndroidAccessoryHost / DeviceDescriptor.c
index 4e5a1d4..be6bf10 100644 (file)
@@ -41,7 +41,7 @@
  *
  *  This routine checks to ensure that the attached device's VID and PID matches Google's for Android devices.
  *
- *  \return An error code from the \ref BluetoothHost_GetDeviceDescriptorDataCodes_t enum.
+ *  \return An error code from the \ref AndroidHost_GetDeviceDescriptorDataCodes_t enum.
  */
 uint8_t ProcessDeviceDescriptor(void)
 {
@@ -55,11 +55,12 @@ uint8_t ProcessDeviceDescriptor(void)
        if (DeviceDescriptor.Header.Type != DTYPE_Device)
          return InvalidDeviceDataReturned;
 
-       /* Validate returned device Class, SubClass and Protocol values against the Bluetooth spec values */
+       /* Validate returned device Vendor ID against the Android ADK spec values */
        if (DeviceDescriptor.VendorID != ANDROID_VENDOR_ID)
-               return IncorrectAndroidDevice;
+         return IncorrectAndroidDevice;
 
-       if ((DeviceDescriptor.ProductID != ANDROID_ACCESSORY_PRODUCT_ID) ||
+       /* Check the product ID to determine if the Android device is in accessory mode */
+       if ((DeviceDescriptor.ProductID != ANDROID_ACCESSORY_PRODUCT_ID) &&
            (DeviceDescriptor.ProductID != ANDROID_ACCESSORY_ADB_PRODUCT_ID))
        {
                return NonAccessoryModeAndroidDevice;