OLD | NEW |
1 <div id="pageData-name" class="pageData">Accessing Hardware Devices</div> | 1 <div id="pageData-name" class="pageData">Accessing Hardware Devices</div> |
2 <div id="pageData-showTOC" class="pageData">true</div> | 2 <div id="pageData-showTOC" class="pageData">true</div> |
3 | 3 |
4 <p> | 4 <p> |
5 This doc shows you how packaged apps can connect to USB devices | 5 This doc shows you how packaged apps can connect to USB devices |
6 and read from and write to a user's serial ports. | 6 and read from and write to a user's serial ports. |
7 See also the reference docs for the | 7 See also the reference docs for the |
8 <a href="experimental.usb.html">USB API</a> | 8 <a href="experimental.usb.html">USB API</a> |
9 and the | 9 and the |
10 <a href="experimental.serial.html">Serial API</a>. | 10 <a href="experimental.serial.html">Serial API</a>. |
(...skipping 20 matching lines...) Expand all Loading... |
31 | 31 |
32 <h3>Manifest requirement</h3> | 32 <h3>Manifest requirement</h3> |
33 | 33 |
34 <p> | 34 <p> |
35 You must add the "usb" permission | 35 You must add the "usb" permission |
36 to the manifest file: | 36 to the manifest file: |
37 </p> | 37 </p> |
38 | 38 |
39 <pre> | 39 <pre> |
40 "permissions": [ | 40 "permissions": [ |
41 "appWindow", | 41 "app.window", |
42 "experimental", | 42 "experimental", |
43 "usb" | 43 "usb" |
44 ] | 44 ] |
45 </pre> | 45 </pre> |
46 | 46 |
47 <h3>Finding a device</h3> | 47 <h3>Finding a device</h3> |
48 | 48 |
49 <p> | 49 <p> |
50 Every device in a USB bus is identified | 50 Every device in a USB bus is identified |
51 by its vendor and product IDs. | 51 by its vendor and product IDs. |
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
687 You can flush your serial device buffer by issuing the flush command on the API: | 687 You can flush your serial device buffer by issuing the flush command on the API: |
688 </p> | 688 </p> |
689 | 689 |
690 <pre> | 690 <pre> |
691 var flushSerial=function(str) { | 691 var flushSerial=function(str) { |
692 chrome.experimental.serial.flush(connectionInfo.connectionId, onFlush); | 692 chrome.experimental.serial.flush(connectionInfo.connectionId, onFlush); |
693 } | 693 } |
694 </pre> | 694 </pre> |
695 | 695 |
696 <p class="backtotop"><a href="#top">Back to top</a></p> | 696 <p class="backtotop"><a href="#top">Back to top</a></p> |
OLD | NEW |