3      Copyright (C) Dean Camera, 2011. 
   5   dean [at] fourwalledcubicle [dot] com 
  10   Copyright 2011  Dean Camera (dean [at] fourwalledcubicle [dot] com) 
  12   Permission to use, copy, modify, distribute, and sell this 
  13   software and its documentation for any purpose is hereby granted 
  14   without fee, provided that the above copyright notice appear in 
  15   all copies and that both that the copyright notice and this 
  16   permission notice and warranty disclaimer appear in supporting 
  17   documentation, and that the name of the author not be used in 
  18   advertising or publicity pertaining to distribution of the 
  19   software without specific, written prior permission. 
  21   The author disclaim all warranties with regard to this 
  22   software, including all implied warranties of merchantability 
  23   and fitness.  In no event shall the author be liable for any 
  24   special, indirect or consequential damages or any damages 
  25   whatsoever resulting from loss of use, data or profits, whether 
  26   in an action of contract, negligence or other tortious action, 
  27   arising out of or in connection with the use or performance of 
  32  *  \brief Common definitions and declarations for the library USB Android Open Accessory Class driver. 
  34  *  Common definitions and declarations for the library USB Android Open Accessory Class driver. 
  36  *  \note This file should not be included directly. It is automatically included as needed by the USB module driver 
  37  *        dispatch header located in LUFA/Drivers/USB.h. 
  40 /** \ingroup Group_USBClassAOA 
  41  *  \defgroup Group_USBClassAOACommon  Common Class Definitions 
  43  *  \section Sec_ModDescription Module Description 
  44  *  Constants, Types and Enum definitions that are common to both Device and Host modes for the USB 
  45  *  Android Open Accessory Class. 
  50 #ifndef _AOA_CLASS_COMMON_H_ 
  51 #define _AOA_CLASS_COMMON_H_ 
  54                 #include "../../Core/StdDescriptors.h" 
  56         /* Enable C linkage for C++ Compilers: */ 
  57                 #if defined(__cplusplus) 
  61         /* Preprocessor Checks: */ 
  62                 #if !defined(__INCLUDE_FROM_AOA_DRIVER) 
  63                         #error Do not include this file directly. Include LUFA/Drivers/USB.h instead. 
  67                 /** Vendor ID value in a Device Descriptor to indicate an Android device. */ 
  68                 #define ANDROID_VENDOR_ID                   0x18D1 
  70                 /** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory mode. */ 
  71                 #define ANDROID_ACCESSORY_PRODUCT_ID        0x2D00 
  73                 /** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory and Android Debug mode. */ 
  74                 #define ANDROID_ACCESSORY_ADB_PRODUCT_ID    0x2D01 
  77                 /** Enum for possible Class, Subclass and Protocol values of device and interface descriptors relating to the 
  78                  *  Android Open Accessory class. 
  80                 enum AOA_Descriptor_ClassSubclassProtocol_t
 
  82                         AOA_CSCP_AOADataClass    
= 0xFF, /**< Descriptor Class value indicating that the device or interface 
  83                                                           *   belongs to the AOA data class. 
  85                         AOA_CSCP_AOADataSubclass 
= 0x00, /**< Descriptor Subclass value indicating that the device or interface 
  86                                                           *   belongs to AOA data subclass. 
  88                         AOA_CSCP_AOADataProtocol 
= 0x00, /**< Descriptor Protocol value indicating that the device or interface 
  89                                                           *   belongs to the AOA data class protocol. 
  93                 /** Enum for the Android Open Accessory class specific control requests that can be issued by the USB bus host. */ 
  94                 enum AOA_ClassRequests_t
 
  96                         AOA_REQ_GetAccessoryProtocol    
= 0x33, /**< Android Open Accessory control request to retrieve the device's supported Accessory Protocol version. */ 
  97                         AOA_REQ_SendString              
= 0x34, /**< Android Open Accessory control request to set an accessory property string in the device. */ 
  98                         AOA_REQ_StartAccessoryMode      
= 0x35, /**< Android Open Accessory control request to switch the device into Accessory mode. */ 
 101                 /** Enum for the possible Android Open Accessory property string indexes. */ 
 104                         AOA_STRING_Manufacturer         
= 0, /**< Index of the Manufacturer property string. */ 
 105                         AOA_STRING_Model                
= 1, /**< Index of the Model Name property string. */ 
 106                         AOA_STRING_Description          
= 2, /**< Index of the Description property string. */ 
 107                         AOA_STRING_Version              
= 3, /**< Index of the Version Number property string. */ 
 108                         AOA_STRING_URI                  
= 4, /**< Index of the URI Information property string. */ 
 109                         AOA_STRING_Serial               
= 5, /**< Index of the Serial Number property string. */ 
 111                         #if !defined(__DOXYGEN__) 
 112                         AOA_STRING_TOTAL_STRINGS
 
 116                 /** Enum for the possible Android Open Accessory protocol versions. */ 
 119                         AOA_PROTOCOL_AccessoryV1        
= 0x0001, /**< Android Open Accessory version 1. */ 
 122         /* Disable C linkage for C++ Compilers: */ 
 123                 #if defined(__cplusplus)