| Index: chrome/common/extensions/docs/templates/articles/app_hardware.html
|
| diff --git a/chrome/common/extensions/docs/templates/articles/app_hardware.html b/chrome/common/extensions/docs/templates/articles/app_hardware.html
|
| index 49df9c3a616fa4ba774eb636f0203a2c0c31081a..405c8fe59389392b6e469279e3f33457c90d6085 100644
|
| --- a/chrome/common/extensions/docs/templates/articles/app_hardware.html
|
| +++ b/chrome/common/extensions/docs/templates/articles/app_hardware.html
|
| @@ -29,7 +29,7 @@ and <a href="https://github.com/GoogleChrome/chrome-app-samples/tree/master/blue
|
| You can use the USB API to send messages to any connected device.
|
| </p>
|
|
|
| -<h3>Manifest requirement</h3>
|
| +<h3 id="manifest">Manifest requirement</h3>
|
|
|
| <p>
|
| You must add the "usb" permission
|
| @@ -44,7 +44,7 @@ to the manifest file:
|
| ]
|
| </pre>
|
|
|
| -<h3>Finding a device</h3>
|
| +<h3 id="finding">Finding a device</h3>
|
|
|
| <p>
|
| Every device in a USB bus is identified
|
| @@ -116,7 +116,7 @@ var onUsbEvent = function(event) {
|
| chrome.experimental.usb.findDevice(vendorId, productId, {"onEvent": onUsbEvent}, onDeviceFound);
|
| </pre>
|
|
|
| -<h3>USB transfers and receiving data from a device</h3>
|
| +<h3 id="usb">USB transfers and receiving data from a device</h3>
|
|
|
| <p>
|
| USB protocol defines four types of transfers:
|
| @@ -171,7 +171,7 @@ var onUsbEvent = function(event) {
|
| chrome.experimental.usb.findDevice( vendorId, productId, {"onEvent": onUsbEvent}, onDeviceFound);
|
| </pre>
|
|
|
| -<h3>Sending data - control transfers</h3>
|
| +<h3 id="control">Sending data - control transfers</h3>
|
|
|
| <p>
|
| Control transfers are generally used to send configuration
|
| @@ -282,7 +282,7 @@ var transferInfo = {
|
| chrome.experimental.usb.controlTransfer(deviceObj, transferInfo, optionalCallback);
|
| </pre>
|
|
|
| -<h3>Sending data - isochronous transfers</h3>
|
| +<h3 id="isochronous">Sending data - isochronous transfers</h3>
|
|
|
| <p>
|
| Isochronous transfers are commonly used for streams of data.
|
| @@ -370,7 +370,7 @@ var isoTransferInfo = {
|
| chrome.experimental.usb.isochronousTransfer(deviceObj, isoTransferInfo, optionalCallback);
|
| </pre>
|
|
|
| -<h3>Sending data - bulk transfers</h3>
|
| +<h3 id="bulk">Sending data - bulk transfers</h3>
|
|
|
| <p>
|
| Bulk transfer is a USB transfer type commonly used
|
| @@ -445,13 +445,13 @@ Example:
|
|
|
| <pre>
|
| var transferInfo = {
|
| - "direction": "out",
|
| + "direction": "out",
|
| "endpoint": 1,
|
| "data": [4, 8, 15, 16, 23, 42]
|
| };
|
| </pre>
|
|
|
| -<h3>Sending data - interrupt transfers</h3>
|
| +<h3 id="interrupt">Sending data - interrupt transfers</h3>
|
|
|
| <p>
|
| Interrupt transfers are used to send important notifications.
|
| @@ -535,7 +535,7 @@ var transferInfo = {
|
| chrome.experimental.usb.interruptTransfer(deviceObj, transferInfo, optionalCallback);
|
| </pre>
|
|
|
| -<h3>Caveats</h3>
|
| +<h3 id="caveats">Caveats</h3>
|
|
|
| <p>
|
| On Linux,
|
| @@ -562,7 +562,7 @@ You can use the serial API to read
|
| and write from a serial device.
|
| </p>
|
|
|
| -<h3>Manifest requirement</h3>
|
| +<h3 id="requirement">Manifest requirement</h3>
|
|
|
| <p>
|
| The "serial" permission is not yet required;
|
| @@ -573,7 +573,7 @@ The "serial" permission is not yet required;
|
| "permissions": ["experimental"]
|
| </pre>
|
|
|
| -<h3>Listing available serial ports</h3>
|
| +<h3 id="listing">Listing available serial ports</h3>
|
|
|
| <p>
|
| To get a list of available serial ports,
|
| @@ -589,7 +589,7 @@ var onGetPorts = function(ports) {
|
| chrome.experimental.serial.getPorts(onGetPorts);
|
| </pre>
|
|
|
| -<h3>Opening a serial device</h3>
|
| +<h3 id="opening">Opening a serial device</h3>
|
|
|
| <p>
|
| Here's how to open a serial device:
|
| @@ -605,7 +605,7 @@ var onOpen = function(connectionInfo) {
|
| chrome.experimental.serial.open("/dev/ttyS01", onOpen);
|
| </pre>
|
|
|
| -<h3>Closing a serial device</h3>
|
| +<h3 id="closing">Closing a serial device</h3>
|
|
|
| <p>
|
| Here's how to close a serial device:
|
| @@ -618,7 +618,7 @@ var onClose = function(result) {
|
| chrome.experimental.serial.close(conId, onClose);
|
| </pre>
|
|
|
| -<h3>Reading from a serial device</h3>
|
| +<h3 id="reading">Reading from a serial device</h3>
|
|
|
| <p>
|
| The serial API reads from the serial port and
|
| @@ -656,7 +656,7 @@ var onCharRead=function(readInfo) {
|
| };
|
| </pre>
|
|
|
| -<h3>Writing to a serial device</h3>
|
| +<h3 id="writing">Writing to a serial device</h3>
|
|
|
| <p>
|
| The writing routine is simpler than the reading,
|
| @@ -681,7 +681,7 @@ var str2ab=function(str) {
|
| }
|
| </pre>
|
|
|
| -<h3>Flushing a serial device buffer</h3>
|
| +<h3 id="flushing">Flushing a serial device buffer</h3>
|
|
|
| <p>
|
| You can flush your serial device buffer by issuing the flush command on the API:
|
| @@ -693,4 +693,4 @@ var flushSerial=function(str) {
|
| }
|
| </pre>
|
|
|
| -<p class="backtotop"><a href="#top">Back to top</a></p>
|
| +<p class="backtotop"><a href="#top">Back to top</a></p>
|
|
|