From b0d9f02d7f820e0a7f15f460921c377f30ae4284 Mon Sep 17 00:00:00 2001 From: Victor Antonovich Date: Tue, 28 Jan 2020 23:31:49 +0400 Subject: [PATCH] Fix bug in UsbI2cBaseDevice.writeRegBuffer(). Bump version to 1.0.1 --- README.md | 2 +- lib/build.gradle | 2 +- .../github/ykc3/android/usbi2c/adapter/UsbI2cBaseAdapter.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5dc65d1..bf18c04 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ allprojects { Add library to dependencies: ```gradle dependencies { - implementation 'com.github.3cky:usb-i2c-android:v1.0' + implementation 'com.github.3cky:usb-i2c-android:1.0.1' } ``` diff --git a/lib/build.gradle b/lib/build.gradle index b859f3a..994d705 100644 --- a/lib/build.gradle +++ b/lib/build.gradle @@ -3,7 +3,7 @@ apply plugin: 'com.github.dcendents.android-maven' project.archivesBaseName='usb-i2c-android' group='com.github.3cky' -version='1.0' +version='1.0.1' android { compileSdkVersion 29 diff --git a/lib/src/main/java/com/github/ykc3/android/usbi2c/adapter/UsbI2cBaseAdapter.java b/lib/src/main/java/com/github/ykc3/android/usbi2c/adapter/UsbI2cBaseAdapter.java index b52d8c8..33c860e 100644 --- a/lib/src/main/java/com/github/ykc3/android/usbi2c/adapter/UsbI2cBaseAdapter.java +++ b/lib/src/main/java/com/github/ykc3/android/usbi2c/adapter/UsbI2cBaseAdapter.java @@ -110,7 +110,7 @@ public void writeRegBuffer(int reg, byte[] buffer, int length) throws IOExceptio try { accessLock.lock(); int len = Math.min(length, MAX_MESSAGE_SIZE); - buffer[0] = (byte) reg; + UsbI2cBaseAdapter.this.buffer[0] = (byte) reg; System.arraycopy(buffer, 0, UsbI2cBaseAdapter.this.buffer, 1, len); write(UsbI2cBaseAdapter.this.buffer, len + 1); } finally {