private static List < String > getDeviceDescriptionsLowLevel ( ) { final Context ctx = new Context ( ) ; final int err = LibUsb . init ( ctx ) ; if ( err != 0 ) { slogger . error ( "LibUsb initialization error {}: {}" , - err , LibUsb . strError ( err ) ) ; return Collections . emptyList ( ) ; } try { final DeviceList list = new DeviceList ( ) ; final int res = LibUsb . getDeviceList ( ctx , list ) ; if ( res < 0 ) { slogger . error ( "LibUsb device list error {}: {}" , - res , LibUsb . strError ( res ) ) ; return Collections . emptyList ( ) ; } try { return StreamSupport . stream ( list . spliterator ( ) , false ) . map ( UsbConnection :: printInfo ) . collect ( Collectors . toList ( ) ) ; } finally { LibUsb . freeDeviceList ( list , true ) ; } } finally { LibUsb . exit ( ctx ) ; } }
This method avoids any further issues down the road by using the ASCII descriptors .