本文整理汇总了Java中android.hardware.usb.UsbDeviceConnection.getFileDescriptor方法的典型用法代码示例。如果您正苦于以下问题:Java UsbDeviceConnection.getFileDescriptor方法的具体用法?Java UsbDeviceConnection.getFileDescriptor怎么用?Java UsbDeviceConnection.getFileDescriptor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.hardware.usb.UsbDeviceConnection
的用法示例。
在下文中一共展示了UsbDeviceConnection.getFileDescriptor方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startRtlSdrService
import android.hardware.usb.UsbDeviceConnection; //导入方法依赖的package包/类
private int startRtlSdrService(final UsbDevice device) {
int result;
final UsbDeviceConnection connection = usbManager.openDevice(device);
if (connection == null) {
Log.d(TAG, "Unknown error while opening device: " + device);
result = R.string.connect_usb_device_status_error_unknown;
} else {
final int usbFd = connection.getFileDescriptor();
final String uspfsPathInput = UsbUtils.deriveProperDeviceName(device.getDeviceName());
if (rtlSdrService != null) {
rtlSdrService.startRtlSdr(new StartRtlSdrRequest(arguments, usbFd, uspfsPathInput));
}
result = R.string.connect_usb_device_status_ok;
}
return result;
}
示例2: UsbHiSpeedBulk
import android.hardware.usb.UsbDeviceConnection; //导入方法依赖的package包/类
public UsbHiSpeedBulk(UsbDeviceConnection usbDeviceConnection, UsbEndpoint usbEndpoint, int nrequests, int packetsPerRequests) {
this.usbDeviceConnection = usbDeviceConnection;
this.fileDescriptor = usbDeviceConnection.getFileDescriptor();
this.nrequests = nrequests;
this.requests = new ArrayList<>(nrequests);
this.packetSize = usbEndpoint.getMaxPacketSize();
this.usbEndpoint = usbEndpoint;
this.packetsPerRequests = packetsPerRequests;
this.buffer = new Buffer(packetsPerRequests * packetSize);
}
示例3: IsoRequest
import android.hardware.usb.UsbDeviceConnection; //导入方法依赖的package包/类
IsoRequest(UsbDeviceConnection usbDeviceConnection, UsbEndpoint usbEndpoint, int id, int maxPackets, int packetSize) {
this.fd = usbDeviceConnection.getFileDescriptor();
urbPtr = jni_allocate_urb(usbEndpoint.getAddress(), id, maxPackets, packetSize);
jni_reset_urb(urbPtr);
}