@@ -58,6 +58,8 @@ public class UsbIpService extends Service implements UsbRequestHandler {
58
58
private WakeLock cpuWakeLock ;
59
59
private WifiLock wifiLock ;
60
60
61
+ private static final boolean DEBUG = false ;
62
+
61
63
private static final int NOTIFICATION_ID = 100 ;
62
64
63
65
private static final String ACTION_USB_PERMISSION =
@@ -343,14 +345,18 @@ public void run() {
343
345
}
344
346
345
347
if (selectedEndpoint .getType () == UsbConstants .USB_ENDPOINT_XFER_BULK ) {
346
- System .out .printf ("Bulk transfer - %d bytes %s on EP %d\n " ,
347
- buff .array ().length , msg .direction == UsbIpDevicePacket .USBIP_DIR_IN ? "in" : "out" ,
348
- selectedEndpoint .getEndpointNumber ());
348
+ if (DEBUG ) {
349
+ System .out .printf ("Bulk transfer - %d bytes %s on EP %d\n " ,
350
+ buff .array ().length , msg .direction == UsbIpDevicePacket .USBIP_DIR_IN ? "in" : "out" ,
351
+ selectedEndpoint .getEndpointNumber ());
352
+ }
349
353
350
354
int res = XferUtils .doBulkTransfer (context .devConn ,selectedEndpoint , buff .array (), msg .interval );
351
355
352
- System .out .printf ("Bulk transfer complete with %d bytes (wanted %d)\n " ,
353
- res , msg .transferBufferLength );
356
+ if (DEBUG ) {
357
+ System .out .printf ("Bulk transfer complete with %d bytes (wanted %d)\n " ,
358
+ res , msg .transferBufferLength );
359
+ }
354
360
355
361
if (res < 0 ) {
356
362
reply .status = ProtoDefs .ST_NA ;
@@ -362,9 +368,12 @@ public void run() {
362
368
sendReply (s , reply , reply .status );
363
369
}
364
370
else if (selectedEndpoint .getType () == UsbConstants .USB_ENDPOINT_XFER_INT ) {
365
- System .out .printf ("Interrupt transfer - %d bytes %s on EP %d\n " ,
366
- msg .transferBufferLength , msg .direction == UsbIpDevicePacket .USBIP_DIR_IN ? "in" : "out" ,
367
- selectedEndpoint .getEndpointNumber ());
371
+
372
+ if (DEBUG ) {
373
+ System .out .printf ("Interrupt transfer - %d bytes %s on EP %d\n " ,
374
+ msg .transferBufferLength , msg .direction == UsbIpDevicePacket .USBIP_DIR_IN ? "in" : "out" ,
375
+ selectedEndpoint .getEndpointNumber ());
376
+ }
368
377
369
378
UsbRequest req = new UsbRequest ();
370
379
req .initialize (context .devConn , selectedEndpoint );
@@ -407,8 +416,10 @@ else if (selectedEndpoint.getType() == UsbConstants.USB_ENDPOINT_XFER_INT) {
407
416
408
417
req .close ();
409
418
410
- System .out .printf ("Interrupt transfer complete with %d bytes (wanted %d)\n " ,
411
- reply .actualLength , originalMsg .transferBufferLength );
419
+ if (DEBUG ) {
420
+ System .out .printf ("Interrupt transfer complete with %d bytes (wanted %d)\n " ,
421
+ reply .actualLength , originalMsg .transferBufferLength );
422
+ }
412
423
if (reply .actualLength == 0 ) {
413
424
// Request actually failed
414
425
reply .status = ProtoDefs .ST_NA ;
0 commit comments