OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 /** | 5 /** |
6 * @fileoverview Implements a low-level gnubby driver based on chrome.usb. | 6 * @fileoverview Implements a low-level gnubby driver based on chrome.usb. |
7 */ | 7 */ |
8 'use strict'; | 8 'use strict'; |
9 | 9 |
10 /** | 10 /** |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 | 429 |
430 | 430 |
431 /** | 431 /** |
432 * @typedef {?{ | 432 * @typedef {?{ |
433 * interfaceNumber: number, | 433 * interfaceNumber: number, |
434 * alternateSetting: number, | 434 * alternateSetting: number, |
435 * interfaceClass: number, | 435 * interfaceClass: number, |
436 * interfaceSubclass: number, | 436 * interfaceSubclass: number, |
437 * interfaceProtocol: number, | 437 * interfaceProtocol: number, |
438 * description: (string|undefined), | 438 * description: (string|undefined), |
439 * endpoints: !Array.<!InterfaceEndpoint> | 439 * endpoints: !Array<!InterfaceEndpoint> |
440 * }} | 440 * }} |
441 * @see http://developer.chrome.com/apps/usb.html#method-listInterfaces | 441 * @see http://developer.chrome.com/apps/usb.html#method-listInterfaces |
442 */ | 442 */ |
443 var InterfaceDescriptor; | 443 var InterfaceDescriptor; |
444 | 444 |
445 /** | 445 /** |
446 * @param {Gnubbies} gnubbies The gnubbies instances this device is enumerated | 446 * @param {Gnubbies} gnubbies The gnubbies instances this device is enumerated |
447 * in. | 447 * in. |
448 * @param {number} which The index of the device to open. | 448 * @param {number} which The index of the device to open. |
449 * @param {!chrome.usb.Device} dev The device to open. | 449 * @param {!chrome.usb.Device} dev The device to open. |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
542 */ | 542 */ |
543 UsbGnubbyDevice.register = function(gnubbies) { | 543 UsbGnubbyDevice.register = function(gnubbies) { |
544 var USB_GNUBBY_IMPL = { | 544 var USB_GNUBBY_IMPL = { |
545 isSharedAccess: false, | 545 isSharedAccess: false, |
546 enumerate: UsbGnubbyDevice.enumerate, | 546 enumerate: UsbGnubbyDevice.enumerate, |
547 deviceToDeviceId: UsbGnubbyDevice.deviceToDeviceId, | 547 deviceToDeviceId: UsbGnubbyDevice.deviceToDeviceId, |
548 open: UsbGnubbyDevice.open | 548 open: UsbGnubbyDevice.open |
549 }; | 549 }; |
550 gnubbies.registerNamespace(UsbGnubbyDevice.NAMESPACE, USB_GNUBBY_IMPL); | 550 gnubbies.registerNamespace(UsbGnubbyDevice.NAMESPACE, USB_GNUBBY_IMPL); |
551 }; | 551 }; |
OLD | NEW |