Loading core/java/android/hardware/SerialPort.java +8 −0 Original line number Diff line number Diff line Loading @@ -113,10 +113,18 @@ public class SerialPort { } } /** * Sends a stream of zero valued bits for 0.25 to 0.5 seconds */ public void sendBreak() { native_send_break(); } private native void native_open(FileDescriptor pfd, int speed) throws IOException; private native void native_close(); private native int native_read_array(byte[] buffer, int length) throws IOException; private native int native_read_direct(ByteBuffer buffer, int length) throws IOException; private native void native_write_array(byte[] buffer, int length) throws IOException; private native void native_write_direct(ByteBuffer buffer, int length) throws IOException; private native void native_send_break(); } core/jni/android_hardware_SerialPort.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,13 @@ android_hardware_SerialPort_write_direct(JNIEnv *env, jobject thiz, jobject buff jniThrowException(env, "java/io/IOException", NULL); } static void android_hardware_SerialPort_send_break(JNIEnv *env, jobject thiz) { int fd = env->GetIntField(thiz, field_context); tcsendbreak(fd, 0); } static JNINativeMethod method_table[] = { {"native_open", "(Ljava/io/FileDescriptor;I)V", (void *)android_hardware_SerialPort_open}, Loading @@ -246,6 +253,7 @@ static JNINativeMethod method_table[] = { (void *)android_hardware_SerialPort_write_array}, {"native_write_direct", "(Ljava/nio/ByteBuffer;I)V", (void *)android_hardware_SerialPort_write_direct}, {"native_send_break", "()V", (void *)android_hardware_SerialPort_send_break}, }; int register_android_hardware_SerialPort(JNIEnv *env) Loading Loading
core/java/android/hardware/SerialPort.java +8 −0 Original line number Diff line number Diff line Loading @@ -113,10 +113,18 @@ public class SerialPort { } } /** * Sends a stream of zero valued bits for 0.25 to 0.5 seconds */ public void sendBreak() { native_send_break(); } private native void native_open(FileDescriptor pfd, int speed) throws IOException; private native void native_close(); private native int native_read_array(byte[] buffer, int length) throws IOException; private native int native_read_direct(ByteBuffer buffer, int length) throws IOException; private native void native_write_array(byte[] buffer, int length) throws IOException; private native void native_write_direct(ByteBuffer buffer, int length) throws IOException; private native void native_send_break(); }
core/jni/android_hardware_SerialPort.cpp +8 −0 Original line number Diff line number Diff line Loading @@ -234,6 +234,13 @@ android_hardware_SerialPort_write_direct(JNIEnv *env, jobject thiz, jobject buff jniThrowException(env, "java/io/IOException", NULL); } static void android_hardware_SerialPort_send_break(JNIEnv *env, jobject thiz) { int fd = env->GetIntField(thiz, field_context); tcsendbreak(fd, 0); } static JNINativeMethod method_table[] = { {"native_open", "(Ljava/io/FileDescriptor;I)V", (void *)android_hardware_SerialPort_open}, Loading @@ -246,6 +253,7 @@ static JNINativeMethod method_table[] = { (void *)android_hardware_SerialPort_write_array}, {"native_write_direct", "(Ljava/nio/ByteBuffer;I)V", (void *)android_hardware_SerialPort_write_direct}, {"native_send_break", "()V", (void *)android_hardware_SerialPort_send_break}, }; int register_android_hardware_SerialPort(JNIEnv *env) Loading