diff options
Diffstat (limited to 'en/devices/accessories')
-rw-r--r-- | en/devices/accessories/aoa.html | 8 | ||||
-rw-r--r-- | en/devices/accessories/aoa2.html | 15 | ||||
-rw-r--r-- | en/devices/accessories/headset/usb-headset-spec.html | 5 | ||||
-rw-r--r-- | en/devices/accessories/stylus.html | 4 |
4 files changed, 20 insertions, 12 deletions
diff --git a/en/devices/accessories/aoa.html b/en/devices/accessories/aoa.html index 6acdfc06..c57fef60 100644 --- a/en/devices/accessories/aoa.html +++ b/en/devices/accessories/aoa.html @@ -99,7 +99,7 @@ if the device supports that mode:</p> it returns a non-zero number that represents the supported protocol version. The control request is on endpoint 0 with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_IN | USB_TYPE_VENDOR request: 51 value: 0 @@ -116,7 +116,7 @@ data: protocol version number (16 bits little endian sent from the request is on endpoint 0 (for each string ID) with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 52 value: 0 @@ -127,7 +127,7 @@ 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 <code>\0</code>).</p> -<pre> +<pre class="devsite-click-to-copy"> manufacturer name: 0 model name: 1 description: 2 @@ -140,7 +140,7 @@ serial number: 5 <li>Send a control request to ask the device to start in accessory mode. The control request is on endpoint 0 with the following characteristics: -<pre> +<pre class="devsite-click-to-copy"> requestType: USB_DIR_OUT | USB_TYPE_VENDOR request: 53 value: 0 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><adk-src>/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 >= 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> diff --git a/en/devices/accessories/headset/usb-headset-spec.html b/en/devices/accessories/headset/usb-headset-spec.html index 8d067c61..9a7cbad1 100644 --- a/en/devices/accessories/headset/usb-headset-spec.html +++ b/en/devices/accessories/headset/usb-headset-spec.html @@ -170,6 +170,11 @@ mappings. </tr> </table> +<p class="note">Key mappings should be declared within a HID application +collection. For accessories without a microphone, use Headphone (Usage +Page: Consumer (0x0C), Usage: Headphone (0x05)). For accesories with a +microphone, use Headset (Usage Page: Telephony (0x0B), Usage: Headset (0x05)).</p> + <h2 id="mechanical">Mechanical</h2> <p> Accessory manufacturers must follow the requirements for USB connectors diff --git a/en/devices/accessories/stylus.html b/en/devices/accessories/stylus.html index d2c2b79f..da739f9a 100644 --- a/en/devices/accessories/stylus.html +++ b/en/devices/accessories/stylus.html @@ -52,7 +52,7 @@ Bluetooth Low Energy (BTLE), or USB.</p> <h3 id="hid-descriptor">HID descriptor</h3> -<p><pre> +<pre class="devsite-click-to-copy"> UsagePage(Digitizer) Usage(Pen) Collection(Application) @@ -110,7 +110,7 @@ unsigned char HID_DESC[] = { 0xC0, // End Collection 0xC0, // End Collection } -</pre></p> +</pre> <h2 id="guidelines-devs">Guidelines for stylus application developers</h2> <p>The Android 6.0 platform automatically handles pairing and event correlation, |