From cfab35898b4366ff9c36469bd85985a084fe716c Mon Sep 17 00:00:00 2001 From: F1ReKing <284061805@qq.com> Date: Tue, 17 Dec 2019 18:08:09 +0800 Subject: [PATCH] =?UTF-8?q?1.=20=E4=BF=AE=E6=94=B9=20=E5=BC=80=E6=94=BE?= =?UTF-8?q?=E6=B3=A2=E7=89=B9=E7=8E=87=E8=87=AA=E7=94=B1=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/me/f1reking/android_serialport/MainActivity.java | 2 +- build.gradle | 2 +- serialportlib/src/main/jni/SerialPort.c | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/me/f1reking/android_serialport/MainActivity.java b/app/src/main/java/me/f1reking/android_serialport/MainActivity.java index 19eff0d..a0aa3db 100644 --- a/app/src/main/java/me/f1reking/android_serialport/MainActivity.java +++ b/app/src/main/java/me/f1reking/android_serialport/MainActivity.java @@ -76,7 +76,7 @@ private void open() { if (mSerialPortHelper == null) { mSerialPortHelper = new SerialPortHelper(); mSerialPortHelper.setPort("/dev/ttyUSB0"); - mSerialPortHelper.setBaudRate(BAUDRATE.getBaudrate(BAUDRATE.B115200)); + mSerialPortHelper.setBaudRate(120); mSerialPortHelper.setStopBits(STOPB.getStopBit(STOPB.B2)); mSerialPortHelper.setDataBits(DATAB.getDataBit(DATAB.CS8)); mSerialPortHelper.setParity(PARITY.getParity(PARITY.NONE)); diff --git a/build.gradle b/build.gradle index 2443b8e..91065c8 100644 --- a/build.gradle +++ b/build.gradle @@ -7,7 +7,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.5.2' + classpath 'com.android.tools.build:gradle:3.5.3' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/serialportlib/src/main/jni/SerialPort.c b/serialportlib/src/main/jni/SerialPort.c index 809d557..b818c7c 100644 --- a/serialportlib/src/main/jni/SerialPort.c +++ b/serialportlib/src/main/jni/SerialPort.c @@ -114,7 +114,8 @@ JNIEXPORT jobject JNICALL Java_me_f1reking_serialportlib_SerialPortHelper_native /* Check arguments */ { - speed = getBaudrate(baudrate); +// speed = getBaudrate(baudrate); + speed = baudrate; if (speed == -1) { /* TODO: throw an exception */ LOGE("Invalid baudrate");