mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2025-01-12 05:41:10 +01:00
Trying to track down NullPointerException in USB input thread
This commit is contained in:
parent
4d771c598a
commit
e4c9806f4f
@ -276,7 +276,16 @@ class HIDDeviceUSB implements HIDDevice {
|
|||||||
int packetSize = mInputEndpoint.getMaxPacketSize();
|
int packetSize = mInputEndpoint.getMaxPacketSize();
|
||||||
byte[] packet = new byte[packetSize];
|
byte[] packet = new byte[packetSize];
|
||||||
while (mRunning) {
|
while (mRunning) {
|
||||||
int r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
|
int r;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Log.v(TAG, "Exception in UsbDeviceConnection bulktransfer: " + e);
|
||||||
|
break;
|
||||||
|
}
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
// Could be a timeout or an I/O error
|
// Could be a timeout or an I/O error
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user