diff --git a/docs/html/guide/topics/usb/adk.jd b/docs/html/guide/topics/usb/adk.jd index 8aaa65c9fd0b4..e4e12157468b8 100644 --- a/docs/html/guide/topics/usb/adk.jd +++ b/docs/html/guide/topics/usb/adk.jd @@ -24,8 +24,7 @@ page.title=Android Open Accessory Development Kit
We expect more hardware distributers to create a variety of kits, so please stay tuned for @@ -380,14 +383,11 @@ page.title=Android Open Accessory Development Kit accessories communicate with Android-powered devices describe much of what you should be doing in your own accessory.
-When you connect an accessory to an Android-powered device, the accessory's firmware must - carry out some standard steps to set up communication with the Android-powered device. If you are - building an accessory along with an application, this section goes over some general steps that - your firmware should carry out.
- -In general, an accessory should carry out the following steps:
+An Android USB accessory must adhere to Android Accessory Protocol, which defines how + an accessory detects and sets up communication with an Android-powered device. In general, an + accessory should carry out the following steps:
The following sections go into depth about how to implement these steps.
+Your accessory should have logic to continuously check @@ -476,12 +478,12 @@ data zero terminated UTF8 string sent from accessory to device
The following string IDs are supported, with a maximum size of 256 bytes for each string (must be zero terminated with \0).
-manufacturer name: 1 -model name: 2 -description: 3 -version: 4 -URI: 5 -serial number: 6 +manufacturer name: 0 +model name: 1 +description: 2 +version: 3 +URI: 4 +serial number: 5@@ -520,12 +522,11 @@ data: none device's configuration to a value of 1 with a SET_CONFIGURATION (0x09) device request, then communicate using the endpoints. -
If you have access to the ADK board and shield, the following sections describe the firmware code that you installed onto the ADK board. The firmware demonstrates a practical example of how - to communicate with an Android-powered device. Even if you do not have the ADK board and shield, + to implement the Android Accessory protocol. Even if you do not have the ADK board and shield, reading through how the hardware detects and interacts with devices in accessory mode is still useful if you want to port the code over for your own accessories.
@@ -540,8 +541,7 @@ data: none sections.The following sections describe the firmware code in the context of the algorithm described in - How an Accessory Communicates with an Android-powered Device in Accessory - Mode.
+ Implementing the Android Accessory Protocol.
-int AndroidAccessory::read(void *buff, int len, unsigned int nakLimit) {
- return usb.newInTransfer(1, in, len, (char *)buff, nakLimit); }
-
-int AndroidAccessory::write(void *buff, int len) {
- usb.outTransfer(1, out, len, (char *)buff);
+int AndroidAccessory::read(void *buff, int len, unsigned int nakLimit) {
+ return usb.newInTransfer(1, in, len, (char *)buff, nakLimit); }
+
+int AndroidAccessory::write(void *buff, int len) {
+ usb.outTransfer(1, out, len, (char *)buff);
return len; }
-
+
See the firmware/demokit/demokit.pde file for information about how the ADK board