Lines Matching defs:env

36 android_hardware_SerialPort_open(JNIEnv *env, jobject thiz, jobject fileDescriptor, jint speed)
130 jniThrowException(env, "java/lang/IllegalArgumentException",
135 int fd = jniGetFDFromFileDescriptor(env, fileDescriptor);
139 jniThrowException(env, "java/io/IOException", "Could not open serial port");
142 env->SetIntField(thiz, field_context, fd);
161 android_hardware_SerialPort_close(JNIEnv *env, jobject thiz)
163 int fd = env->GetIntField(thiz, field_context);
165 env->SetIntField(thiz, field_context, -1);
169 android_hardware_SerialPort_read_array(JNIEnv *env, jobject thiz, jbyteArray buffer, jint length)
171 int fd = env->GetIntField(thiz, field_context);
174 jniThrowException(env, "java/lang/OutOfMemoryError", NULL);
181 env->SetByteArrayRegion(buffer, 0, ret, buf);
186 jniThrowException(env, "java/io/IOException", NULL);
191 android_hardware_SerialPort_read_direct(JNIEnv *env, jobject thiz, jobject buffer, jint length)
193 int fd = env->GetIntField(thiz, field_context);
195 jbyte* buf = (jbyte *)env->GetDirectBufferAddress(buffer);
197 jniThrowException(env, "java/lang/IllegalArgumentException", "ByteBuffer not direct");
203 jniThrowException(env, "java/io/IOException", NULL);
208 android_hardware_SerialPort_write_array(JNIEnv *env, jobject thiz, jbyteArray buffer, jint length)
210 int fd = env->GetIntField(thiz, field_context);
213 jniThrowException(env, "java/lang/OutOfMemoryError", NULL);
216 env->GetByteArrayRegion(buffer, 0, length, buf);
221 jniThrowException(env, "java/io/IOException", NULL);
225 android_hardware_SerialPort_write_direct(JNIEnv *env, jobject thiz, jobject buffer, jint length)
227 int fd = env->GetIntField(thiz, field_context);
229 jbyte* buf = (jbyte *)env->GetDirectBufferAddress(buffer);
231 jniThrowException(env, "java/lang/IllegalArgumentException", "ByteBuffer not direct");
236 jniThrowException(env, "java/io/IOException", NULL);
240 android_hardware_SerialPort_send_break(JNIEnv *env, jobject thiz)
242 int fd = env->GetIntField(thiz, field_context);
261 int register_android_hardware_SerialPort(JNIEnv *env)
263 jclass clazz = env->FindClass("android/hardware/SerialPort");
268 field_context = env->GetFieldID(clazz, "mNativeContext", "I");
274 return AndroidRuntime::registerNativeMethods(env, "android/hardware/SerialPort",