Add missing Doxygen documentation.
}
/* Validate the returned protocol version */
- if (AndroidProtocol != ANDROID_PROTOCOL_Accessory)
+ if (AndroidProtocol != AOA_PROTOCOL_AccessoryV1)
{
puts_P(PSTR(ESC_FG_RED "Accessory Mode Not Supported."));
}
/* Send the device strings and start the Android Accessory Mode */
- Android_SendString(ANDROID_STRING_Manufacturer, "Dean Camera");
- Android_SendString(ANDROID_STRING_Model, "LUFA Android Demo");
- Android_SendString(ANDROID_STRING_Description, "LUFA Android Demo");
- Android_SendString(ANDROID_STRING_Version, "1.0");
- Android_SendString(ANDROID_STRING_URI, "http://www.lufa-lib.org");
- Android_SendString(ANDROID_STRING_Serial, "0000000012345678");
+ Android_SendString(AOA_STRING_Manufacturer, "Dean Camera");
+ Android_SendString(AOA_STRING_Model, "LUFA Android Demo");
+ Android_SendString(AOA_STRING_Description, "LUFA Android Demo");
+ Android_SendString(AOA_STRING_Version, "1.0");
+ Android_SendString(AOA_STRING_URI, "http://www.lufa-lib.org");
+ Android_SendString(AOA_STRING_Serial, "0000000012345678");
Android_StartAccessoryMode();
return;
{
USB_Descriptor_Interface_t* Interface = DESCRIPTOR_PCAST(CurrentDescriptor, USB_Descriptor_Interface_t);
- if ((Interface->Class == ANDROID_INTERFACE_CLASS) &&
- (Interface->SubClass == ANDROID_INTERFACE_SUBCLASS) &&
- (Interface->Protocol == ANDROID_INTERFACE_PROTOCOL))
+ if ((Interface->Class == AOA_CSCP_AOADataClass) &&
+ (Interface->SubClass == AOA_CSCP_AOADataSubclass) &&
+ (Interface->Protocol == AOA_CSCP_AOADataProtocol))
{
return DESCRIPTOR_SEARCH_Found;
}
/* Macros: */
#define ANDROID_DATA_IN_PIPE 1
#define ANDROID_DATA_OUT_PIPE 2
-
- #define ANDROID_INTERFACE_CLASS 0xFF
- #define ANDROID_INTERFACE_SUBCLASS 0xFF
- #define ANDROID_INTERFACE_PROTOCOL 0x00
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessConfigurationDescriptor() function. */
#include "AndroidAccessoryHost.h"
- /* Macros: */
- #define ANDROID_VENDOR_ID 0x18D1
- #define ANDROID_ACCESSORY_PRODUCT_ID 0x2D00
- #define ANDROID_ACCESSORY_ADB_PRODUCT_ID 0x2D01
-
/* Enums: */
/** Enum for the possible return codes of the \ref ProcessDeviceDescriptor() function. */
enum AndroidHost_GetDeviceDescriptorDataCodes_t
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_DEVICETOHOST | REQTYPE_VENDOR | REQREC_DEVICE),
- .bRequest = ANDROID_Req_GetAccessoryProtocol,
+ .bRequest = AOA_REQ_GetAccessoryProtocol,
.wValue = 0,
.wIndex = 0,
.wLength = sizeof(uint16_t),
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_VENDOR | REQREC_DEVICE),
- .bRequest = ANDROID_Req_SendString,
+ .bRequest = AOA_REQ_SendString,
.wValue = 0,
.wIndex = StringIndex,
.wLength = (strlen(String) + 1),
USB_ControlRequest = (USB_Request_Header_t)
{
.bmRequestType = (REQDIR_HOSTTODEVICE | REQTYPE_VENDOR | REQREC_DEVICE),
- .bRequest = ANDROID_Req_StartAccessoryMode,
+ .bRequest = AOA_REQ_StartAccessoryMode,
.wValue = 0,
.wIndex = 0,
.wLength = 0,
#include <stdbool.h>
#include <LUFA/Drivers/USB/USB.h>
-
- /* Enums: */
- enum Android_Requests_t
- {
- ANDROID_Req_GetAccessoryProtocol = 51,
- ANDROID_Req_SendString = 52,
- ANDROID_Req_StartAccessoryMode = 53,
- };
-
- enum Android_Strings_t
- {
- ANDROID_STRING_Manufacturer = 0,
- ANDROID_STRING_Model = 1,
- ANDROID_STRING_Description = 2,
- ANDROID_STRING_Version = 3,
- ANDROID_STRING_URI = 4,
- ANDROID_STRING_Serial = 5,
- };
-
- enum Android_Protocols_t
- {
- ANDROID_PROTOCOL_Accessory = 0x0001,
- };
/* Function Prototypes: */
uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol);
#endif\r
\r
/* Macros: */\r
+ /** Vendor ID value in a Device Descriptor to indicate an Android device. */\r
#define ANDROID_VENDOR_ID 0x18D1\r
+\r
+ /** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory mode. */\r
#define ANDROID_ACCESSORY_PRODUCT_ID 0x2D00\r
+\r
+ /** Product ID value in a Device Descriptor to indicate an Android device in Open Accessory and Android Debug mode. */\r
#define ANDROID_ACCESSORY_ADB_PRODUCT_ID 0x2D01\r
\r
/* Enums: */\r
/** Enum for the possible Android Open Accessory protocol versions. */\r
enum AOA_Protocols_t\r
{\r
- AOA_PROTOCOL_Accessory = 0x0001, /**< Android Open Accessory version 1. */\r
+ AOA_PROTOCOL_AccessoryV1 = 0x0001, /**< Android Open Accessory version 1. */\r
};\r
\r
/* Disable C linkage for C++ Compilers: */\r
if ((ErrorCode = AOA_Host_GetAccessoryProtocol(&AccessoryProtocol)) != HOST_WAITERROR_Successful)\r
return ErrorCode;\r
\r
- if (AccessoryProtocol != CPU_TO_LE16(AOA_PROTOCOL_Accessory))\r
+ if (AccessoryProtocol != CPU_TO_LE16(AOA_PROTOCOL_AccessoryV1))\r
return AOA_ERROR_LOGICAL_CMD_FAILED;\r
\r
for (uint8_t PropertyIndex = 0; PropertyIndex < AOA_STRING_TOTAL_STRINGS; PropertyIndex++)\r
*
* <table>
* <tr>
- * <th width="100px">USB Class</th>
+ * <th width="200px">USB Class</th>
* <th width="90px">Device Mode</th>
* <th width="90px">Host Mode</th>
* </tr>