SDL  2.0
org.libsdl.app.HIDDeviceUSB.InputThread Class Reference
+ Inheritance diagram for org.libsdl.app.HIDDeviceUSB.InputThread:
+ Collaboration diagram for org.libsdl.app.HIDDeviceUSB.InputThread:

Public Member Functions

void run ()
 

Detailed Description

Definition at line 273 of file HIDDeviceUSB.java.

Member Function Documentation

◆ run()

void org.libsdl.app.HIDDeviceUSB.InputThread.run ( )
inline

Definition at line 275 of file HIDDeviceUSB.java.

References e.

275  {
276  int packetSize = mInputEndpoint.getMaxPacketSize();
277  byte[] packet = new byte[packetSize];
278  while (mRunning) {
279  int r;
280  try
281  {
282  r = mConnection.bulkTransfer(mInputEndpoint, packet, packetSize, 1000);
283  }
284  catch (Exception e)
285  {
286  Log.v(TAG, "Exception in UsbDeviceConnection bulktransfer: " + e);
287  break;
288  }
289  if (r < 0) {
290  // Could be a timeout or an I/O error
291  }
292  if (r > 0) {
293  byte[] data;
294  if (r == packetSize) {
295  data = packet;
296  } else {
297  data = Arrays.copyOfRange(packet, 0, r);
298  }
299 
300  if (!mFrozen) {
301  mManager.HIDDeviceInputReport(mDeviceId, data);
302  }
303  }
304  }
305  }
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 SDL_AssertionHandler void SDL_SpinLock SDL_atomic_t int int return SDL_atomic_t return void void void return void return int return SDL_AudioSpec SDL_AudioSpec return int int return return int SDL_RWops int SDL_AudioSpec Uint8 Uint32 * e
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
#define TAG
Definition: hid.cpp:16

The documentation for this class was generated from the following file: