├── jvm ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── com │ │ └── jwoolston │ │ └── libusb │ │ ├── UsbManager.java │ │ ├── UsbEndpoint.java │ │ ├── UsbDeviceConnection.java │ │ ├── UsbConfiguration.java │ │ ├── UsbInterface.java │ │ └── UsbDevice.java ├── gradle.properties ├── build.gradle └── CMakeLists.txt ├── mobile ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── values │ │ │ │ ├── dimens.xml │ │ │ │ ├── strings.xml │ │ │ │ ├── colors.xml │ │ │ │ └── styles.xml │ │ │ ├── mipmap-hdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-mdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ ├── ic_launcher.png │ │ │ │ └── ic_launcher_round.png │ │ │ ├── mipmap-anydpi-v26 │ │ │ │ ├── ic_launcher.xml │ │ │ │ └── ic_launcher_round.xml │ │ │ ├── drawable │ │ │ │ ├── ic_usb_black_24dp.xml │ │ │ │ └── ic_launcher_background.xml │ │ │ ├── layout │ │ │ │ ├── activity_main.xml │ │ │ │ └── content_main.xml │ │ │ └── drawable-v24 │ │ │ │ └── ic_launcher_foreground.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── jwoolston │ │ │ └── android │ │ │ └── libusb │ │ │ └── MSCCommunication.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── jwoolston │ │ │ └── android │ │ │ └── libusb │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── jwoolston │ │ └── android │ │ └── libusb │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── android ├── .gitignore ├── src │ └── main │ │ ├── res │ │ └── values │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ └── com │ │ └── jwoolston │ │ └── libusb │ │ ├── DevicePermissionDenied.java │ │ ├── UsbDeviceConnection.java │ │ ├── UsbEndpoint.java │ │ ├── UsbManager.java │ │ ├── UsbConfiguration.java │ │ ├── UsbInterface.java │ │ └── UsbDevice.java ├── gradle.properties ├── proguard-rules.pro ├── CMakeLists.txt └── build.gradle ├── library ├── .gitignore ├── src │ └── main │ │ └── java │ │ └── com │ │ └── jwoolston │ │ └── libusb │ │ ├── async │ │ ├── BulkTransferCallback.java │ │ ├── ControlTransferCallback.java │ │ ├── InterruptTransferCallback.java │ │ ├── IsochronousTransferCallback.java │ │ ├── AsyncTransfer.java │ │ └── IsochronousAsyncTransfer.java │ │ ├── LibUsbContext.java │ │ ├── LibusbSpeed.java │ │ ├── DeviceList.java │ │ ├── AsyncUSBThread.java │ │ ├── LibusbError.java │ │ ├── LibUsbDeviceDescriptor.java │ │ ├── BaseUsbManager.java │ │ ├── util │ │ └── Hexdump.java │ │ ├── BaseUsbEndpoint.java │ │ ├── UsbConstants.java │ │ ├── BaseUsbConfiguration.java │ │ └── BaseUsbInterface.java ├── proguard-rules.pro └── build.gradle ├── msc_test_core ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ └── values │ │ │ │ └── strings.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── jwoolston │ │ │ └── android │ │ │ └── libusb │ │ │ └── msc_test_core │ │ │ ├── driver │ │ │ ├── scsi │ │ │ │ └── commands │ │ │ │ │ ├── ScsiReadCapacity.java │ │ │ │ │ ├── ScsiRequestSense.java │ │ │ │ │ ├── ScsiTestUnitReady.java │ │ │ │ │ ├── ScsiInquiry.java │ │ │ │ │ ├── ScsiReadCapacityResponse.java │ │ │ │ │ ├── ScsiRead10.java │ │ │ │ │ ├── ScsiWrite10.java │ │ │ │ │ ├── ScsiInquiryResponse.java │ │ │ │ │ ├── CommandStatusWrapper.java │ │ │ │ │ └── CommandBlockWrapper.java │ │ │ ├── BlockDeviceDriverFactory.java │ │ │ └── BlockDeviceDriver.java │ │ │ └── usb │ │ │ └── UsbCommunication.java │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── jwoolston │ │ │ └── android │ │ │ └── libusb │ │ │ └── msc_test_core │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── jwoolston │ │ └── android │ │ └── libusb │ │ └── msc_test_core │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── secret.gpg.gpg ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── settings.gradle ├── .gitmodules ├── .gitignore ├── jni ├── common.h ├── libusb_error_enum.c ├── async_usb_thread.c ├── async_transfer.c ├── logging.h ├── usb_interface.c ├── usb_manager.c ├── usb_configuration.c ├── isochronous_async_transfer.c ├── device_list.c ├── libusb_device_descriptor.c ├── logging.c └── usb_device.c ├── gradle.properties ├── .circleci └── config.yml ├── gradlew.bat ├── publish.gradle ├── README.md └── gradlew /jvm/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /mobile/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /android/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /library/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /msc_test_core/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /secret.gpg.gpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/secret.gpg.gpg -------------------------------------------------------------------------------- /mobile/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 16dp 3 | 4 | -------------------------------------------------------------------------------- /android/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | android 3 | 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /msc_test_core/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | msc_test_core 3 | 4 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':library' 2 | include ':jvm' 3 | include ':android' 4 | include ':msc_test_core' 5 | include ':mobile' 6 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "library/libusb"] 2 | path = library/libusb 3 | url = https://github.com/jwoolston/libusb.git 4 | branch = development 5 | -------------------------------------------------------------------------------- /android/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-hdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-hdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-mdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-mdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-xhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-xxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jwoolston/Java-Libusb-Wrapper/HEAD/mobile/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png -------------------------------------------------------------------------------- /msc_test_core/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/ 5 | .DS_Store 6 | /build 7 | /captures 8 | .externalNativeBuild 9 | jvm/nativeBuild/ 10 | jvm/linux/ 11 | secret.gpg 12 | -------------------------------------------------------------------------------- /mobile/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Android-Libusb-Wrapper 3 | ALW MSC Demo 4 | 5 | -------------------------------------------------------------------------------- /jvm/src/main/java/com/jwoolston/libusb/UsbManager.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb; 2 | 3 | public class UsbManager extends BaseUsbManager { 4 | 5 | public UsbManager() { 6 | super(); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /mobile/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #81c784 4 | #37474f 5 | #e65100 6 | 7 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sun Jun 23 15:14:51 PDT 2019 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip 7 | -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-anydpi-v26/ic_launcher.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /mobile/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /jni/common.h: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jared Woolston (Jared.Woolston@gmail.com) 3 | // 4 | 5 | #ifndef ANDROID_LIBUSB_WRAPPER_COMMON_H 6 | #define ANDROID_LIBUSB_WRAPPER_COMMON_H 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include "logging.h" 13 | 14 | #endif //ANDROID_LIBUSB_WRAPPER_COMMON_H 15 | -------------------------------------------------------------------------------- /jni/libusb_error_enum.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jared Woolston (Jared.Woolston@gmail.com) 3 | // 4 | 5 | #include 6 | 7 | JNIEXPORT jstring JNICALL 8 | Java_com_jwoolston_libusb_LibusbError_getDescriptionString(JNIEnv *env, jclass type, jint code) { 9 | return (*env)->NewStringUTF(env, libusb_strerror((enum libusb_error) code)); 10 | } 11 | -------------------------------------------------------------------------------- /jni/async_usb_thread.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jared Woolston (Jared.Woolston@gmail.com) 3 | // 4 | 5 | #include 6 | 7 | #define LOG_TAG "AsyncUsbThread-Native" 8 | 9 | JNIEXPORT jint JNICALL 10 | Java_com_jwoolston_libusb_AsyncUSBThread_nativeHandleEvents(JNIEnv *env, jclass type, jobject context) { 11 | struct libusb_context *ctx = (libusb_context *) (*env)->GetDirectBufferAddress(env, context); 12 | return libusb_handle_events(ctx); 13 | } -------------------------------------------------------------------------------- /library/src/main/java/com/jwoolston/libusb/async/BulkTransferCallback.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb.async; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | import java.io.IOException; 6 | import java.nio.ByteBuffer; 7 | 8 | /** 9 | * @author Jared Woolston (Jared.Woolston@gmail.com) 10 | */ 11 | public interface BulkTransferCallback { 12 | 13 | void onBulkTransferComplete(@Nullable ByteBuffer data, int result) throws IOException; 14 | } 15 | -------------------------------------------------------------------------------- /library/src/main/java/com/jwoolston/libusb/async/ControlTransferCallback.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb.async; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | import java.io.IOException; 6 | import java.nio.ByteBuffer; 7 | 8 | /** 9 | * @author Jared Woolston (Jared.Woolston@gmail.com) 10 | */ 11 | public interface ControlTransferCallback { 12 | 13 | void onControlTransferComplete(@Nullable ByteBuffer data, int result) throws IOException; 14 | } 15 | -------------------------------------------------------------------------------- /library/src/main/java/com/jwoolston/libusb/async/InterruptTransferCallback.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb.async; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | import java.io.IOException; 6 | import java.nio.ByteBuffer; 7 | 8 | /** 9 | * @author Jared Woolston (Jared.Woolston@gmail.com) 10 | */ 11 | public interface InterruptTransferCallback { 12 | 13 | void onInterruptTransferComplete(@Nullable ByteBuffer data, int result) throws IOException; 14 | } 15 | -------------------------------------------------------------------------------- /android/src/main/java/com/jwoolston/libusb/DevicePermissionDenied.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | /** 6 | * @author Jared Woolston (Jared.Woolston@gmail.com) 7 | */ 8 | public class DevicePermissionDenied extends Exception { 9 | 10 | public DevicePermissionDenied(@NotNull android.hardware.usb.UsbDevice device) { 11 | super("Permission was denied for device: " + device.getDeviceName()); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /library/src/main/java/com/jwoolston/libusb/async/IsochronousTransferCallback.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb.async; 2 | 3 | import org.jetbrains.annotations.Nullable; 4 | 5 | import java.io.IOException; 6 | import java.nio.ByteBuffer; 7 | 8 | /** 9 | * @author Jared Woolston (Jared.Woolston@gmail.com) 10 | */ 11 | public interface IsochronousTransferCallback { 12 | 13 | void onIsochronousTransferComplete(@Nullable ByteBuffer data, int result) throws IOException; 14 | } 15 | -------------------------------------------------------------------------------- /mobile/src/test/java/com/jwoolston/android/libusb/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.android.libusb; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /jvm/src/main/java/com/jwoolston/libusb/UsbEndpoint.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb; 2 | 3 | public class UsbEndpoint extends BaseUsbEndpoint { 4 | 5 | /** 6 | * UsbEndpoint should only be instantiated by UsbService implementation 7 | * 8 | * @param address 9 | * @param attributes 10 | * @param maxPacketSize 11 | * @param interval 12 | */ 13 | UsbEndpoint(int address, int attributes, int maxPacketSize, int interval) { 14 | super(address, attributes, maxPacketSize, interval); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /jni/async_transfer.c: -------------------------------------------------------------------------------- 1 | // 2 | // Created by Jared Woolston (Jared.Woolston@gmail.com) 3 | // 4 | 5 | #include 6 | 7 | #define LOG_TAG "AsyncTransfer-Native" 8 | 9 | JNIEXPORT void JNICALL 10 | Java_com_jwoolston_libusb_async_AsyncTransfer_nativeDestroy(JNIEnv *env, jobject instance, 11 | jobject nativeObject) { 12 | struct libusb_transfer *transfer = (struct libusb_transfer *) (*env)->GetDirectBufferAddress(env, nativeObject); 13 | libusb_free_transfer(transfer); 14 | } -------------------------------------------------------------------------------- /msc_test_core/src/test/java/com/jwoolston/android/libusb/msc_test_core/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.android.libusb.msc_test_core; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /mobile/src/main/res/drawable/ic_usb_black_24dp.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /jvm/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015 Jared Woolston 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | POM_ARTIFACT_ID=jvm 17 | POM_PACKAGING=jar -------------------------------------------------------------------------------- /android/gradle.properties: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright 2015 Jared Woolston 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | POM_ARTIFACT_ID=android 17 | POM_PACKAGING=aar -------------------------------------------------------------------------------- /library/src/main/java/com/jwoolston/libusb/LibUsbContext.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb; 2 | 3 | import com.jwoolston.libusb.util.Preconditions; 4 | 5 | import org.jetbrains.annotations.NotNull; 6 | 7 | import java.nio.ByteBuffer; 8 | 9 | /** 10 | * @author Jared Woolston (Jared.Woolston@gmail.com) 11 | */ 12 | public class LibUsbContext { 13 | 14 | private final ByteBuffer nativeObject; 15 | 16 | LibUsbContext(ByteBuffer nativeObject) { 17 | Preconditions.checkNotNull(nativeObject, "LibUSB Initialization failed."); 18 | this.nativeObject = nativeObject; 19 | } 20 | 21 | @NotNull 22 | public ByteBuffer getNativeObject() { 23 | return nativeObject; 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /jvm/src/main/java/com/jwoolston/libusb/UsbDeviceConnection.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | 5 | /** 6 | * This class is used for sending and receiving data and control messages to a USB device. 7 | */ 8 | public class UsbDeviceConnection extends BaseUsbDeviceConnection { 9 | 10 | /** 11 | * BaseUsbDevice should only be instantiated by UsbService implementation 12 | */ 13 | private UsbDeviceConnection(@NotNull UsbManager manager, @NotNull UsbDevice device) { 14 | super(manager, device); 15 | } 16 | 17 | @Override 18 | @NotNull 19 | public UsbDevice getDevice() { 20 | return (UsbDevice) super.getDevice(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /jvm/src/main/java/com/jwoolston/libusb/UsbConfiguration.java: -------------------------------------------------------------------------------- 1 | package com.jwoolston.libusb; 2 | 3 | import org.jetbrains.annotations.NotNull; 4 | import org.jetbrains.annotations.Nullable; 5 | 6 | public class UsbConfiguration extends BaseUsbConfiguration { 7 | 8 | /** 9 | * UsbConfiguration should only be instantiated by UsbService implementation 10 | * 11 | * @param id 12 | * @param name 13 | * @param attributes 14 | * @param maxPower 15 | */ 16 | public UsbConfiguration(int id, @Nullable String name, int attributes, int maxPower) { 17 | super(id, name, attributes, maxPower); 18 | } 19 | 20 | @Override 21 | @NotNull 22 | public UsbInterface getInterface(int index) { 23 | return (UsbInterface) super.getInterface(index); 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /mobile/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 15 | 16 |