diff options
author | Dean Camera <dean@fourwalledcubicle.com> | 2013-05-10 21:45:37 +0200 |
---|---|---|
committer | Dean Camera <dean@fourwalledcubicle.com> | 2013-05-10 21:45:37 +0200 |
commit | 0223c3668c1ad5507a4d3a393b2bea5f3426289c (patch) | |
tree | c79b81049a9f2a3cd5839de8fae0fb9d93e79b58 /LUFA/Drivers | |
parent | 39603f05b293d9919b8da8099ebeebc9c01a5ba4 (diff) | |
download | lufa-0223c3668c1ad5507a4d3a393b2bea5f3426289c.tar.gz lufa-0223c3668c1ad5507a4d3a393b2bea5f3426289c.tar.bz2 lufa-0223c3668c1ad5507a4d3a393b2bea5f3426289c.zip |
Update Android Accessory Class driver to be compatible with protocol version 2 devices.
Diffstat (limited to 'LUFA/Drivers')
-rw-r--r-- | LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h | 5 | ||||
-rw-r--r-- | LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h b/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h index bf3c07760..feb8e4b40 100644 --- a/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h +++ b/LUFA/Drivers/USB/Class/Common/AndroidAccessoryClassCommon.h @@ -104,16 +104,17 @@ AOA_STRING_Version = 3, /**< Index of the Version Number property string. */ AOA_STRING_URI = 4, /**< Index of the URI Information property string. */ AOA_STRING_Serial = 5, /**< Index of the Serial Number property string. */ - + #if !defined(__DOXYGEN__) AOA_STRING_TOTAL_STRINGS #endif }; - + /** Enum for the possible Android Open Accessory protocol versions. */ enum AOA_Protocols_t { AOA_PROTOCOL_AccessoryV1 = 0x0001, /**< Android Open Accessory version 1. */ + AOA_PROTOCOL_AccessoryV2 = 0x0002, /**< Android Open Accessory version 2. */ }; /* Disable C linkage for C++ Compilers: */ diff --git a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c index 1ae6fae82..1871df146 100644 --- a/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c +++ b/LUFA/Drivers/USB/Class/Host/AndroidAccessoryClassHost.c @@ -167,7 +167,7 @@ uint8_t AOA_Host_StartAccessoryMode(USB_ClassInfo_AOA_Host_t* const AOAInterface if ((ErrorCode = AOA_Host_GetAccessoryProtocol(&AccessoryProtocol)) != HOST_WAITERROR_Successful) return ErrorCode; - if (AccessoryProtocol != CPU_TO_LE16(AOA_PROTOCOL_AccessoryV1)) + if ((AccessoryProtocol != CPU_TO_LE16(AOA_PROTOCOL_AccessoryV1)) && (AccessoryProtocol != CPU_TO_LE16(AOA_PROTOCOL_AccessoryV2))) return AOA_ERROR_LOGICAL_CMD_FAILED; for (uint8_t PropertyIndex = 0; PropertyIndex < AOA_STRING_TOTAL_STRINGS; PropertyIndex++) |