OLD | NEW |
1 'use strict'; | 1 'use strict'; |
2 | 2 |
3 // This polyfil library implements the following WebIDL: | 3 // This polyfil library implements the following WebIDL: |
4 // | 4 // |
5 // partial interface USB { | 5 // partial interface USB { |
6 // [SameObject] readonly attribute USBTest test; | 6 // [SameObject] readonly attribute USBTest test; |
7 // } | 7 // } |
8 // | 8 // |
9 // interface USBTest { | 9 // interface USBTest { |
10 // attribute EventHandler ondeviceclose; | 10 // attribute EventHandler ondeviceclose; |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 switch (endpoint.direction) { | 125 switch (endpoint.direction) { |
126 case "in": | 126 case "in": |
127 endpointInfo.direction = mojo.device.UsbTransferDirection.INBOUND; | 127 endpointInfo.direction = mojo.device.UsbTransferDirection.INBOUND; |
128 break; | 128 break; |
129 case "out": | 129 case "out": |
130 endpointInfo.direction = mojo.device.UsbTransferDirection.OUTBOUND; | 130 endpointInfo.direction = mojo.device.UsbTransferDirection.OUTBOUND; |
131 break; | 131 break; |
132 } | 132 } |
133 switch (endpoint.type) { | 133 switch (endpoint.type) { |
134 case "bulk": | 134 case "bulk": |
135 endpointInfo.type = mojo.device.UsbEndpointType.BULK; | 135 endpointInfo.type = mojo.device.UsbTransferType.BULK; |
136 break; | 136 break; |
137 case "interrupt": | 137 case "interrupt": |
138 endpointInfo.type = mojo.device.UsbEndpointType.INTERRUPT; | 138 endpointInfo.type = mojo.device.UsbTransferType.INTERRUPT; |
139 break; | 139 break; |
140 case "isochronous": | 140 case "isochronous": |
141 endpointInfo.type = mojo.device.UsbEndpointType.ISOCHRONOUS; | 141 endpointInfo.type = mojo.device.UsbTransferType.ISOCHRONOUS; |
142 break; | 142 break; |
143 } | 143 } |
144 alternateInfo.endpoints.push(endpointInfo); | 144 alternateInfo.endpoints.push(endpointInfo); |
145 }); | 145 }); |
146 interfaceInfo.alternates.push(alternateInfo); | 146 interfaceInfo.alternates.push(alternateInfo); |
147 }); | 147 }); |
148 configInfo.interfaces.push(interfaceInfo); | 148 configInfo.interfaces.push(interfaceInfo); |
149 }); | 149 }); |
150 deviceInfo.configurations.push(configInfo); | 150 deviceInfo.configurations.push(configInfo); |
151 }); | 151 }); |
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 | 556 |
557 g_deviceManager.removeAllDevices(); | 557 g_deviceManager.removeAllDevices(); |
558 g_chooserService.setChosenDevice(null); | 558 g_chooserService.setChosenDevice(null); |
559 g_closeListener = null; | 559 g_closeListener = null; |
560 } | 560 } |
561 } | 561 } |
562 | 562 |
563 navigator.usb.test = new USBTest(); | 563 navigator.usb.test = new USBTest(); |
564 | 564 |
565 })(); | 565 })(); |
OLD | NEW |