本文整理匯總了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);
}