From 78f7a78490e9fbe80f98dac97bf3456fb57487d2 Mon Sep 17 00:00:00 2001 From: sunxudong Date: Wed, 20 May 2020 13:49:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=81=9C=E6=AD=A2=E4=B8=B2?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- serial/build.gradle | 4 ++-- serial/src/main/java/org/sheedon/serial/SerialClient.java | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/serial/build.gradle b/serial/build.gradle index 3285a8b..becdf40 100644 --- a/serial/build.gradle +++ b/serial/build.gradle @@ -8,8 +8,8 @@ android { defaultConfig { minSdkVersion 15 targetSdkVersion 28 - versionCode 8 - versionName "1.2.4" + versionCode 9 + versionName "1.2.5" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" consumerProguardFiles 'consumer-rules.pro' diff --git a/serial/src/main/java/org/sheedon/serial/SerialClient.java b/serial/src/main/java/org/sheedon/serial/SerialClient.java index cb39c3c..ad8005b 100644 --- a/serial/src/main/java/org/sheedon/serial/SerialClient.java +++ b/serial/src/main/java/org/sheedon/serial/SerialClient.java @@ -78,6 +78,11 @@ public Observable newObservable(Request request) { return RealObservable.newRealObservable(this, request); } + public void destroy() { + port.closeSerialPort(); + port = null; + } + @Override public void onCallback(ResponseBody data) {