diff options
Diffstat (limited to 'Demos/Host/LowLevel/AndroidAccessoryHost')
5 files changed, 17 insertions, 15 deletions
diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c index 7b2b79604..4ed013339 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.c @@ -78,7 +78,7 @@ void SetupHardware(void) void AndroidHost_Task(void) { if (USB_HostState != HOST_STATE_Configured) - return; + return; /* Select the data IN pipe */ Pipe_SelectPipe(ANDROID_DATA_IN_PIPE); @@ -148,7 +148,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) /* Get and process the configuration descriptor data */ uint8_t ErrorCode = ProcessDeviceDescriptor(); - + bool RequiresModeSwitch = (ErrorCode == NonAccessoryModeAndroidDevice); /* Error out if the device is not an Android device or an error occurred */ @@ -166,12 +166,12 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) } printf_P(PSTR("Android Device Detected - %sAccessory mode.\r\n"), (RequiresModeSwitch ? "Non-" : "")); - + /* Check if a valid Android device was attached, but it is not current in Accessory mode */ if (RequiresModeSwitch) { uint16_t AndroidProtocol; - + /* Fetch the version of the Android Accessory Protocol supported by the device */ if ((ErrorCode = Android_GetAccessoryProtocol(&AndroidProtocol)) != HOST_SENDCONTROL_Successful) { @@ -181,7 +181,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); return; } - + /* Validate the returned protocol version */ if (AndroidProtocol != AOA_PROTOCOL_AccessoryV1) { @@ -190,7 +190,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) LEDs_SetAllLEDs(LEDMASK_USB_ERROR); return; } - + /* Send the device strings and start the Android Accessory Mode */ Android_SendString(AOA_STRING_Manufacturer, "Dean Camera"); Android_SendString(AOA_STRING_Model, "LUFA Android Demo"); @@ -199,7 +199,7 @@ void EVENT_USB_Host_DeviceEnumerationComplete(void) Android_SendString(AOA_STRING_URI, "http://www.lufa-lib.org"); Android_SendString(AOA_STRING_Serial, "0000000012345678"); - Android_StartAccessoryMode(); + Android_StartAccessoryMode(); return; } diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h index 6c8702fc5..714e2dafc 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/AndroidAccessoryHost.h @@ -46,7 +46,7 @@ #include "DeviceDescriptor.h" #include "ConfigDescriptor.h" - #include "Lib/AndroidAccessoryCommands.h" + #include "Lib/AndroidAccessoryCommands.h" #include <LUFA/Version.h> #include <LUFA/Drivers/Misc/TerminalCodes.h> diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c index 973ac537c..487d51898 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/ConfigDescriptor.c @@ -66,7 +66,7 @@ uint8_t ProcessConfigurationDescriptor(void) default: return DevControlError; } - + /* There should be only one compatible Android Accessory Mode interface in the device, attempt to find it */ if (USB_GetNextDescriptorComp(&CurrConfigBytesRem, &CurrConfigLocation, DCOMP_NextAndroidAccessoryInterface) != DESCRIPTOR_SEARCH_COMP_Found) diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c index 42c3a62fa..7e1e7c806 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.c @@ -33,8 +33,8 @@ * Android Accessory Mode utility functions, for the configuration of an attached * Android device into Android Accessory Mode ready for general communication. */ - -#include "AndroidAccessoryCommands.h" + +#include "AndroidAccessoryCommands.h" uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol) { @@ -79,5 +79,6 @@ uint8_t Android_StartAccessoryMode(void) }; Pipe_SelectPipe(PIPE_CONTROLPIPE); - return USB_Host_SendControlRequest(NULL); + return USB_Host_SendControlRequest(NULL); } + diff --git a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h index 0fab7635f..00326aba2 100644 --- a/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h +++ b/Demos/Host/LowLevel/AndroidAccessoryHost/Lib/AndroidAccessoryCommands.h @@ -41,11 +41,12 @@ #include <stdbool.h> #include <LUFA/Drivers/USB/USB.h> - + /* Function Prototypes: */ uint8_t Android_GetAccessoryProtocol(uint16_t* const Protocol); uint8_t Android_SendString(const uint8_t StringIndex, const char* const String); - uint8_t Android_StartAccessoryMode(void); - + uint8_t Android_StartAccessoryMode(void); + #endif + |