1 /* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 #include "_OverrideLog.h" 18 #include <android/log.h> 19 20 #include "NfcJniUtil.h" 21 #include "JavaClassConstants.h" 22 23 #include <JNIHelp.h> 24 25 namespace android 26 { 27 28 29 static jboolean nativeP2pDeviceDoConnect (JNIEnv*, jobject) 30 { 31 ALOGV("%s", __func__); 32 return JNI_TRUE; 33 } 34 35 36 static jboolean nativeP2pDeviceDoDisconnect (JNIEnv*, jobject) 37 { 38 ALOGV("%s", __func__); 39 return JNI_TRUE; 40 } 41 42 43 static jbyteArray nativeP2pDeviceDoTransceive (JNIEnv*, jobject, jbyteArray) 44 { 45 ALOGV("%s", __func__); 46 return NULL; 47 } 48 49 50 static jbyteArray nativeP2pDeviceDoReceive (JNIEnv*, jobject) 51 { 52 ALOGV("%s", __func__); 53 return NULL; 54 } 55 56 57 static jboolean nativeP2pDeviceDoSend (JNIEnv*, jobject, jbyteArray) 58 { 59 ALOGV("%s", __func__); 60 return JNI_TRUE; 61 } 62 63 64 /***************************************************************************** 65 ** 66 ** Description: JNI functions 67 ** 68 *****************************************************************************/ 69 static JNINativeMethod gMethods[] = 70 { 71 {"doConnect", "()Z", (void *) nativeP2pDeviceDoConnect}, 72 {"doDisconnect", "()Z", (void *) nativeP2pDeviceDoDisconnect}, 73 {"doTransceive", "([B)[B", (void *) nativeP2pDeviceDoTransceive}, 74 {"doReceive", "()[B", (void *) nativeP2pDeviceDoReceive}, 75 {"doSend", "([B)Z", (void *) nativeP2pDeviceDoSend}, 76 }; 77 78 79 /******************************************************************************* 80 ** 81 ** Function: register_com_android_nfc_NativeP2pDevice 82 ** 83 ** Description: Regisgter JNI functions with Java Virtual Machine. 84 ** e: Environment of JVM. 85 ** 86 ** Returns: Status of registration. 87 ** 88 *******************************************************************************/ 89 int register_com_android_nfc_NativeP2pDevice (JNIEnv* e) 90 { 91 return jniRegisterNativeMethods (e, gNativeP2pDeviceClassName, 92 gMethods, NELEM(gMethods)); 93 } 94 95 96 } // namepspace android 97