45
45
import com .neuronrobotics .sdk .common .BowlerRuntimeException ;
46
46
import com .neuronrobotics .sdk .common .ByteList ;
47
47
import com .neuronrobotics .sdk .common .Log ;
48
- import com .neuronrobotics .sdk .util .OsInfoUtil ;
48
+ // import com.neuronrobotics.sdk.util.OsInfoUtil;
49
49
import com .neuronrobotics .sdk .util .ThreadUtil ;
50
50
51
51
public class UsbCDCSerialConnection extends BowlerAbstractConnection implements
@@ -90,7 +90,7 @@ public void abort() {
90
90
91
91
@ Override
92
92
public void run () {
93
- if (!OsInfoUtil .isWindows ()){
93
+ // if(!OsInfoUtil.isWindows()){
94
94
setName ("Bowler Platform USB Events thread" );
95
95
while (!this .abort ) {
96
96
// Let libusb handle pending events. This blocks until events
@@ -105,14 +105,14 @@ public void run() {
105
105
}
106
106
ThreadUtil .wait (100 );
107
107
}
108
- }
108
+ // }
109
109
}
110
110
}
111
111
112
112
static {
113
113
try {
114
114
services = UsbHostManager .getUsbServices ();
115
- if (!OsInfoUtil .isWindows ()){
115
+ // if(!OsInfoUtil.isWindows()){
116
116
callbackHandle = new HotplugCallbackHandle ();
117
117
int result = LibUsb .hotplugRegisterCallback (null ,
118
118
LibUsb .HOTPLUG_EVENT_DEVICE_ARRIVED
@@ -142,7 +142,7 @@ public int processEvent(Context arg0, Device arg1,
142
142
if (result != LibUsb .SUCCESS ) {
143
143
throw new LibUsbException ("Unable to register hotplug callback" , result );
144
144
}
145
- }
145
+ // }
146
146
} catch (SecurityException e ) {
147
147
// TODO Auto-generated catch block
148
148
e .printStackTrace ();
@@ -375,7 +375,7 @@ public boolean connect() {
375
375
}
376
376
377
377
public Device findDevice (String seriualNumber ) {
378
- if (!OsInfoUtil .isWindows ()){
378
+ // if(!OsInfoUtil.isWindows()){
379
379
// Read the USB device list
380
380
DeviceList list = new DeviceList ();
381
381
int result = LibUsb .getDeviceList (null , list );
@@ -407,15 +407,15 @@ public Device findDevice(String seriualNumber) {
407
407
// Ensure the allocated device list is freed
408
408
LibUsb .freeDeviceList (list , true );
409
409
}
410
- }
410
+ // }
411
411
// Device not found
412
412
return null ;
413
413
}
414
414
415
415
private void kernelDetatch (UsbDevice mDevice )
416
416
throws UnsupportedEncodingException , UsbDisconnectedException ,
417
417
UsbException {
418
- if (!OsInfoUtil .isWindows ()){
418
+ // if(!OsInfoUtil.isWindows()){
419
419
Device kDev = findDevice (mDevice .getSerialNumberString ());
420
420
if (kDev == null )
421
421
return ;
@@ -433,7 +433,7 @@ private void kernelDetatch(UsbDevice mDevice)
433
433
&& r != LibUsb .ERROR_NOT_FOUND )
434
434
throw new LibUsbException ("Unable to detach kernel driver" , r );
435
435
// System.out.println("Kernel detatched for device "+mDevice);
436
- }
436
+ // }
437
437
}
438
438
439
439
/*
@@ -452,7 +452,7 @@ public void disconnect() {
452
452
camOutpipe .close ();
453
453
} catch (Exception e1 ) {
454
454
}
455
- if (!OsInfoUtil .isWindows ()){
455
+ // if(!OsInfoUtil.isWindows()){
456
456
if (deviceHandle != null ) {
457
457
try {
458
458
LibUsb .attachKernelDriver (deviceHandle , interfaceNumber );
@@ -461,7 +461,7 @@ public void disconnect() {
461
461
462
462
}
463
463
}
464
- }
464
+ // }
465
465
try {
466
466
if (dataInterface .isClaimed ())
467
467
dataInterface .release ();
0 commit comments