aboutsummaryrefslogtreecommitdiff
path: root/en/devices/accessories/aoa2.html
diff options
context:
space:
mode:
authorAndroid Partner Docs <noreply@android.com>2017-06-13 20:58:21 +0000
committerandroid-build-merger <android-build-merger@google.com>2017-06-13 20:58:21 +0000
commitc391221fea1ab8d0d0fafc0d9a5d099583bcd379 (patch)
tree740ebc006d9de93b185781eff054136fb00cf45f /en/devices/accessories/aoa2.html
parent4ecfdb8d77e11f3bd0ab0638e23b332f3a1011a3 (diff)
parent0a9ccdf0b05d71e4350a554a64653133de483d01 (diff)
downloadsource.android.com-c391221fea1ab8d0d0fafc0d9a5d099583bcd379.tar.gz
Merge "Docs: Changes to source.android.com"
am: 0a9ccdf0b0 Change-Id: I3cdda0960164eecc17b793d4ce8de892cd41586f
Diffstat (limited to 'en/devices/accessories/aoa2.html')
-rw-r--r--en/devices/accessories/aoa2.html15
1 files changed, 9 insertions, 6 deletions
diff --git a/en/devices/accessories/aoa2.html b/en/devices/accessories/aoa2.html
index 1f965937..83e27929 100644
--- a/en/devices/accessories/aoa2.html
+++ b/en/devices/accessories/aoa2.html
@@ -53,7 +53,8 @@ devices.</p>
(<code>&lt;adk-src&gt;/adk1/board/AndroidAccessory/AndroidAccessory.cpp</code>)
library demonstrates this protocol check:</p>
-<pre><code>bool AndroidAccessory::switchDevice(byte addr)
+<pre class="devsite-click-to-copy">
+bool AndroidAccessory::switchDevice(byte addr)
{
int protocol = getProtocol(addr);
if (protocol &gt;= 1) {
@@ -74,7 +75,7 @@ library demonstrates this protocol check:</p>
USB_SETUP_RECIPIENT_DEVICE, ACCESSORY_START, 0, 0, 0, 0, NULL);
return true;
}
-</code></pre>
+</pre>
<p>AOAv2 includes new USB product IDs for each combination of USB interfaces
available in accessory mode:</p>
@@ -146,14 +147,15 @@ the future).</p>
<p>To enable audio support, the accessory must send a new USB control request:
</p>
-<pre><code>**SET_AUDIO_MODE**
+<pre class="devsite-click-to-copy">
+**SET_AUDIO_MODE**
requestType: USB_DIR_OUT | USB_TYPE_VENDOR
request: 58
value: 0 for no audio (default),
1 for 2 channel, 16-bit PCM at 44100 KHz
index: 0
data none
-</code></pre>
+</pre>
<p>This command must be sent <em>before</em> sending the
<code>ACCESSORY_START</code> command for entering accessory mode.</p>
@@ -201,7 +203,8 @@ accessory to the Android device.</li>
<p>The code definitions for the new control requests are:</p>
-<pre><code>/* Control request for registering a HID device.
+<pre class="devsite-click-to-copy">
+/* Control request for registering a HID device.
* Upon registering, a unique ID is sent by the accessory in the
* value parameter. This ID will be used for future commands for
* the device
@@ -248,7 +251,7 @@ accessory to the Android device.</li>
* data the HID report for the event
*/
#define ACCESSORY_SEND_HID_EVENT 57
-</code></pre>
+</pre>
<h2 id="interoperability-with-aoa-10-features">Interoperability with AOAv1</h2>