Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a3e7cf2 authored by Robert Ly's avatar Robert Ly Committed by Android (Google) Code Review
Browse files

Merge "cherry pick from hc mr1 Change-Id:...

Merge "cherry pick from hc mr1 Change-Id: I6f48d245e2837226096fe42d08fb0243e416dbbc" into honeycomb-mr2
parents 8467cd7f bffb5235
Loading
Loading
Loading
Loading
+35 −35
Original line number Diff line number Diff line
@@ -24,8 +24,7 @@ page.title=Android Open Accessory Development Kit
        </li>

        <li>
          <a href="#how">How an Accessory Communicates with an Android-powered Device in Accessory
          Mode</a>
          <a href="#accessory-protocol">Implementing the Android Accessory Protocol</a>

          <ol>
            <li><a href="#wait">Wait for and detect connected devices</a></li>
@@ -40,8 +39,7 @@ page.title=Android Open Accessory Development Kit
        </li>

        <li>
          <a href="#firmware">How the ADK board communicates with an Android-powered Device in
          Accessory Mode</a>
          <a href="#firmware">How the ADK board implements the Android Accessory Protocol</a>

          <ol>
            <li><a href="#wait-adk">Wait for and detect connected devices</a></li>
@@ -78,6 +76,9 @@ page.title=Android Open Accessory Development Kit

        <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">
        DIY Drones</a></li>

    <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">
        Modern Device</a></li>
      </ol>
    </div>
  </div>
@@ -86,7 +87,7 @@ page.title=Android Open Accessory Development Kit
  support, which allows external USB hardware (an Android USB accessory) to interact with an
  Android-powered device in a special "accessory" mode. When an Android-powered powered device is
  in accessory mode, the connected accessory acts as the USB host (powers the bus and enumerates
  devices) and the Android-powered device acts as the device. Android USB accessories are
  devices) and the Android-powered device acts as the USB device. Android USB accessories are
  specifically designed to attach to Android-powered devices and adhere to a simple protocol
  (Android accessory protocol) that allows them to detect Android-powered devices that support
  accessory mode. Accessories must also provide 500mA at 5V for charging power. Many previously
@@ -112,6 +113,8 @@ page.title=Android Open Accessory Development Kit
    <li><a href="https://store.diydrones.com/ProductDetails.asp?ProductCode=BR-PhoneDrone">DIY
    Drones</a> provides an Arduino-compatible board geared towards RC (radio controlled) and UAV
    (unmanned aerial vehicle) enthusiasts.</li>
    <li><a href="http://shop.moderndevice.com/products/freeduino-usb-host-board">Modern
        Device</a> provides an Arduino-compatible board that supports the ADK firmware.</li>
  </ul>

  <p>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.</p>

  <h2 id="how">How an Accessory Communicates with an Android-powered Device in Accessory Mode</h2>

  <p>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.</p>
  <h2 id="accessory-protocol">Implementing the Android Accessory Protocol</h2>

  <p>In general, an accessory should carry out the following steps:</p>
  <p>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:</p>

  <ol>
    <li>Wait for and detect connected devices</li>
@@ -399,6 +399,8 @@ page.title=Android Open Accessory Development Kit
    <li>Establish communication with the device if it supports the Android accessory protocol</li>
  </ol>

  <p>The following sections go into depth about how to implement these steps.</p>

  <h3 id="wait">Wait for and detect connected devices</h3>

  <p>Your accessory should have logic to continuously check
@@ -476,12 +478,12 @@ data zero terminated UTF8 string sent from accessory to device
      <p>The following string IDs are supported, with a maximum size of 256 bytes for each string
      (must be zero terminated with \0).</p>
      <pre>
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
</pre>
    </li>

@@ -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.</p>

  <h2 id="firmware">How the ADK board communicates with an Android-powered Device in Accessory
  Mode</h2>
  <h2 id="firmware">How the ADK board implements the Android Accessory protocol</h2>

  <p>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.</p>

@@ -540,8 +541,7 @@ data: none
  sections.</p>

  <p>The following sections describe the firmware code in the context of the algorithm described in
  <a href="#how">How an Accessory Communicates with an Android-powered Device in Accessory
  Mode</a>.</p>
  <a href="#accessory-protocol">Implementing the Android Accessory Protocol</a>.</p>

  <h3 id="wait-adk">Wait for and detect connected devices</h3>