Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Giftedcat committed Jun 15, 2020
1 parent 8ae71a7 commit 88bf291
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 23 deletions.
Binary file modified .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file modified .idea/caches/gradle_models.ser
Binary file not shown.
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions SerialPortLibrary/src/main/cpp/SerialPort.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ static speed_t getBaudrate(jint baudrate)
* Method: open
* Signature: (Ljava/lang/String;II)Ljava/io/FileDescriptor;
*/
JNIEXPORT jobject JNICALL Java_com_kongqw_serialportlibrary_SerialPort_open
JNIEXPORT jobject JNICALL Java_com_giftedcat_serialportlibrary_SerialPort_open
(JNIEnv *env, jclass thiz, jstring path, jint baudrate, jint flags)
{
int fd;
Expand Down Expand Up @@ -149,7 +149,7 @@ JNIEXPORT jobject JNICALL Java_com_kongqw_serialportlibrary_SerialPort_open
* Method: close
* Signature: ()V
*/
JNIEXPORT void JNICALL Java_com_kongqw_serialportlibrary_SerialPort_close
JNIEXPORT void JNICALL Java_com_giftedcat_serialportlibrary_SerialPort_close
(JNIEnv *env, jobject thiz)
{
jclass SerialPortClass = (*env)->GetObjectClass(env, thiz);
Expand Down
4 changes: 2 additions & 2 deletions SerialPortLibrary/src/main/cpp/SerialPort.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary;
package com.giftedcat.serialportlibrary;

import java.io.File;
import java.io.Serializable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary;
package com.giftedcat.serialportlibrary;

import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary;
package com.giftedcat.serialportlibrary;

import java.io.File;
import java.io.FileDescriptor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary;
package com.giftedcat.serialportlibrary;

import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package com.kongqw.serialportlibrary;
package com.giftedcat.serialportlibrary;

import android.os.Handler;
import android.os.HandlerThread;
import android.os.Message;
import android.util.Log;

import com.kongqw.serialportlibrary.listener.OnOpenSerialPortListener;
import com.kongqw.serialportlibrary.listener.OnSerialPortDataListener;
import com.kongqw.serialportlibrary.thread.SerialPortReadThread;
import com.kongqw.serialportlibrary.utils.DataUtil;
import com.giftedcat.serialportlibrary.listener.OnOpenSerialPortListener;
import com.giftedcat.serialportlibrary.listener.OnSerialPortDataListener;
import com.giftedcat.serialportlibrary.thread.SerialPortReadThread;
import com.giftedcat.serialportlibrary.utils.DataUtil;

import java.io.File;
import java.io.FileDescriptor;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary.listener;
package com.giftedcat.serialportlibrary.listener;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary.listener;
package com.giftedcat.serialportlibrary.listener;

/**
* Created by Kongqw on 2017/11/14.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary.thread;
package com.giftedcat.serialportlibrary.thread;

import android.util.Log;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.kongqw.serialportlibrary.utils;
package com.giftedcat.serialportlibrary.utils;

/**
* @author giftedcat
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import android.os.RemoteException;
import android.util.Log;

import com.kongqw.serialportlibrary.SerialPortManager;
import com.kongqw.serialportlibrary.listener.OnSerialPortDataListener;
import com.giftedcat.serialportlibrary.SerialPortManager;
import com.giftedcat.serialportlibrary.listener.OnSerialPortDataListener;

import java.io.File;

Expand Down Expand Up @@ -41,14 +41,14 @@ public class SerialInteractiveService extends Service {
public void onCreate() {
super.onCreate();

mSerialPortManager1 = new SerialPortManager(new File("/dev/ttyS0"), 9600)
mSerialPortManager1 = new SerialPortManager(new File("/dev/ttyS3"), 9600)
.setOnSerialPortDataListener(new OnSerialPortDataListener() {
@Override
public void onDataReceived(byte[] bytes) {
sendMessageToClient(101, new String(bytes));
}
});
mSerialPortManager2 = new SerialPortManager(new File("/dev/ttyS1"), 9600)
mSerialPortManager2 = new SerialPortManager(new File("/dev/ttyS2"), 9600)
.setOnSerialPortDataListener(new OnSerialPortDataListener() {
@Override
public void onDataReceived(byte[] bytes) {
Expand Down

0 comments on commit 88bf291

Please sign in to comment.