Lines Matching refs:env

127 static void jstr2bdaddr(JNIEnv* env, bt_bdaddr_t *bda, jstring address)  in jstr2bdaddr()  argument
129 const char* c_bda = env->GetStringUTFChars(address, NULL); in jstr2bdaddr()
133 env->ReleaseStringUTFChars(address, c_bda); in jstr2bdaddr()
207 JNIEnv* env = AndroidRuntime::getJNIEnv(); in checkCallbackThread() local
208 if (sCallbackEnv != env || sCallbackEnv == NULL) return false; in checkCallbackThread()
817 static void classInitNative(JNIEnv* env, jclass clazz) { in classInitNative() argument
821 method_onClientRegistered = env->GetMethodID(clazz, "onClientRegistered", "(IIJJ)V"); in classInitNative()
822 method_onScanResult = env->GetMethodID(clazz, "onScanResult", "(Ljava/lang/String;I[B)V"); in classInitNative()
823 method_onConnected = env->GetMethodID(clazz, "onConnected", "(IIILjava/lang/String;)V"); in classInitNative()
824 method_onDisconnected = env->GetMethodID(clazz, "onDisconnected", "(IIILjava/lang/String;)V"); in classInitNative()
825 … method_onReadCharacteristic = env->GetMethodID(clazz, "onReadCharacteristic", "(IIIIJJIJJI[B)V"); in classInitNative()
826 method_onWriteCharacteristic = env->GetMethodID(clazz, "onWriteCharacteristic", "(IIIIJJIJJ)V"); in classInitNative()
827 method_onExecuteCompleted = env->GetMethodID(clazz, "onExecuteCompleted", "(II)V"); in classInitNative()
828 method_onSearchCompleted = env->GetMethodID(clazz, "onSearchCompleted", "(II)V"); in classInitNative()
829 method_onSearchResult = env->GetMethodID(clazz, "onSearchResult", "(IIIJJ)V"); in classInitNative()
830 method_onReadDescriptor = env->GetMethodID(clazz, "onReadDescriptor", "(IIIIJJIJJIJJI[B)V"); in classInitNative()
831 method_onWriteDescriptor = env->GetMethodID(clazz, "onWriteDescriptor", "(IIIIJJIJJIJJ)V"); in classInitNative()
832 method_onNotify = env->GetMethodID(clazz, "onNotify", "(ILjava/lang/String;IIJJIJJZ[B)V"); in classInitNative()
833 method_onGetCharacteristic = env->GetMethodID(clazz, "onGetCharacteristic", "(IIIIJJIJJI)V"); in classInitNative()
834 method_onGetDescriptor = env->GetMethodID(clazz, "onGetDescriptor", "(IIIIJJIJJIJJ)V"); in classInitNative()
835 method_onGetIncludedService = env->GetMethodID(clazz, "onGetIncludedService", "(IIIIJJIIJJ)V"); in classInitNative()
836 …method_onRegisterForNotifications = env->GetMethodID(clazz, "onRegisterForNotifications", "(IIIIIJ… in classInitNative()
837 … method_onReadRemoteRssi = env->GetMethodID(clazz, "onReadRemoteRssi", "(ILjava/lang/String;II)V"); in classInitNative()
838 method_onConfigureMTU = env->GetMethodID(clazz, "onConfigureMTU", "(III)V"); in classInitNative()
839 method_onAdvertiseCallback = env->GetMethodID(clazz, "onAdvertiseCallback", "(II)V"); in classInitNative()
840 method_onScanFilterConfig = env->GetMethodID(clazz, "onScanFilterConfig", "(IIIII)V"); in classInitNative()
841 …method_onScanFilterParamsConfigured = env->GetMethodID(clazz, "onScanFilterParamsConfigured", "(II… in classInitNative()
842 …method_onScanFilterEnableDisabled = env->GetMethodID(clazz, "onScanFilterEnableDisabled", "(III)V"… in classInitNative()
843 method_onMultiAdvEnable = env->GetMethodID(clazz, "onAdvertiseInstanceEnabled", "(II)V"); in classInitNative()
844 method_onMultiAdvUpdate = env->GetMethodID(clazz, "onAdvertiseDataUpdated", "(II)V"); in classInitNative()
845 method_onMultiAdvSetAdvData = env->GetMethodID(clazz, "onAdvertiseDataSet", "(II)V"); in classInitNative()
846 method_onMultiAdvDisable = env->GetMethodID(clazz, "onAdvertiseInstanceDisabled", "(II)V"); in classInitNative()
847 method_onClientCongestion = env->GetMethodID(clazz, "onClientCongestion", "(IZ)V"); in classInitNative()
848 …method_onBatchScanStorageConfigured = env->GetMethodID(clazz, "onBatchScanStorageConfigured", "(II… in classInitNative()
849 method_onBatchScanStartStopped = env->GetMethodID(clazz, "onBatchScanStartStopped", "(III)V"); in classInitNative()
850 method_onBatchScanReports = env->GetMethodID(clazz, "onBatchScanReports", "(IIII[B)V"); in classInitNative()
851 …method_onBatchScanThresholdCrossed = env->GetMethodID(clazz, "onBatchScanThresholdCrossed", "(I)V"… in classInitNative()
852 …method_onTrackAdvFoundLost = env->GetMethodID(clazz, "onTrackAdvFoundLost", "(IILjava/lang/String;… in classInitNative()
856 method_onServerRegistered = env->GetMethodID(clazz, "onServerRegistered", "(IIJJ)V"); in classInitNative()
857 …method_onClientConnected = env->GetMethodID(clazz, "onClientConnected", "(Ljava/lang/String;ZII)V"… in classInitNative()
858 method_onServiceAdded = env->GetMethodID(clazz, "onServiceAdded", "(IIIIJJI)V"); in classInitNative()
859 method_onIncludedServiceAdded = env->GetMethodID(clazz, "onIncludedServiceAdded", "(IIII)V"); in classInitNative()
860 method_onCharacteristicAdded = env->GetMethodID(clazz, "onCharacteristicAdded", "(IIJJII)V"); in classInitNative()
861 method_onDescriptorAdded = env->GetMethodID(clazz, "onDescriptorAdded", "(IIJJII)V"); in classInitNative()
862 method_onServiceStarted = env->GetMethodID(clazz, "onServiceStarted", "(III)V"); in classInitNative()
863 method_onServiceStopped = env->GetMethodID(clazz, "onServiceStopped", "(III)V"); in classInitNative()
864 method_onServiceDeleted = env->GetMethodID(clazz, "onServiceDeleted", "(III)V"); in classInitNative()
865 method_onResponseSendCompleted = env->GetMethodID(clazz, "onResponseSendCompleted", "(II)V"); in classInitNative()
866 … method_onAttributeRead= env->GetMethodID(clazz, "onAttributeRead", "(Ljava/lang/String;IIIIZ)V"); in classInitNative()
867 …method_onAttributeWrite= env->GetMethodID(clazz, "onAttributeWrite", "(Ljava/lang/String;IIIIIZZ[B… in classInitNative()
868 method_onExecuteWrite= env->GetMethodID(clazz, "onExecuteWrite", "(Ljava/lang/String;III)V"); in classInitNative()
869 method_onNotificationSent = env->GetMethodID(clazz, "onNotificationSent", "(II)V"); in classInitNative()
870 method_onServerCongestion = env->GetMethodID(clazz, "onServerCongestion", "(IZ)V"); in classInitNative()
871 method_onServerMtuChanged = env->GetMethodID(clazz, "onMtuChanged", "(II)V"); in classInitNative()
878 static void initializeNative(JNIEnv *env, jobject object) { in initializeNative() argument
895 env->DeleteGlobalRef(mCallbacksObj); in initializeNative()
912 mCallbacksObj = env->NewGlobalRef(object); in initializeNative()
915 static void cleanupNative(JNIEnv *env, jobject object) { in cleanupNative() argument
925 env->DeleteGlobalRef(mCallbacksObj); in cleanupNative()
935 static int gattClientGetDeviceTypeNative(JNIEnv* env, jobject object, jstring address) in gattClientGetDeviceTypeNative() argument
939 jstr2bdaddr(env, &bda, address); in gattClientGetDeviceTypeNative()
943 static void gattClientRegisterAppNative(JNIEnv* env, jobject object, in gattClientRegisterAppNative() argument
953 static void gattClientUnregisterAppNative(JNIEnv* env, jobject object, jint clientIf) in gattClientUnregisterAppNative() argument
959 static void gattClientScanNative(JNIEnv* env, jobject object, jboolean start) in gattClientScanNative() argument
965 static void gattClientConnectNative(JNIEnv* env, jobject object, jint clientif, in gattClientConnectNative() argument
971 jstr2bdaddr(env, &bda, address); in gattClientConnectNative()
975 static void gattClientDisconnectNative(JNIEnv* env, jobject object, jint clientIf, in gattClientDisconnectNative() argument
980 jstr2bdaddr(env, &bda, address); in gattClientDisconnectNative()
984 static void gattClientRefreshNative(JNIEnv* env, jobject object, jint clientIf, in gattClientRefreshNative() argument
990 jstr2bdaddr(env, &bda, address); in gattClientRefreshNative()
994 static void gattClientSearchServiceNative(JNIEnv* env, jobject object, jint conn_id, in gattClientSearchServiceNative() argument
1004 static void gattClientGetCharacteristicNative(JNIEnv* env, jobject object, in gattClientGetCharacteristicNative() argument
1031 static void gattClientGetDescriptorNative(JNIEnv* env, jobject object, in gattClientGetDescriptorNative() argument
1063 static void gattClientGetIncludedServiceNative(JNIEnv* env, jobject object, in gattClientGetIncludedServiceNative() argument
1089 static void gattClientReadCharacteristicNative(JNIEnv* env, jobject object, in gattClientReadCharacteristicNative() argument
1110 static void gattClientReadDescriptorNative(JNIEnv* env, jobject object, in gattClientReadDescriptorNative() argument
1137 static void gattClientWriteCharacteristicNative(JNIEnv* env, jobject object, in gattClientWriteCharacteristicNative() argument
1155 uint16_t len = (uint16_t) env->GetArrayLength(value); in gattClientWriteCharacteristicNative()
1156 jbyte *p_value = env->GetByteArrayElements(value, NULL); in gattClientWriteCharacteristicNative()
1161 env->ReleaseByteArrayElements(value, p_value, 0); in gattClientWriteCharacteristicNative()
1164 static void gattClientExecuteWriteNative(JNIEnv* env, jobject object, in gattClientExecuteWriteNative() argument
1171 static void gattClientWriteDescriptorNative(JNIEnv* env, jobject object, in gattClientWriteDescriptorNative() argument
1200 uint16_t len = (uint16_t) env->GetArrayLength(value); in gattClientWriteDescriptorNative()
1201 jbyte *p_value = env->GetByteArrayElements(value, NULL); in gattClientWriteDescriptorNative()
1206 env->ReleaseByteArrayElements(value, p_value, 0); in gattClientWriteDescriptorNative()
1209 static void gattClientRegisterForNotificationsNative(JNIEnv* env, jobject object, in gattClientRegisterForNotificationsNative() argument
1229 const char *c_address = env->GetStringUTFChars(address, NULL); in gattClientRegisterForNotificationsNative()
1238 static void gattClientReadRemoteRssiNative(JNIEnv* env, jobject object, jint clientif, in gattClientReadRemoteRssiNative() argument
1244 jstr2bdaddr(env, &bda, address); in gattClientReadRemoteRssiNative()
1249 static void gattAdvertiseNative(JNIEnv *env, jobject object, in gattAdvertiseNative() argument
1256 static void gattSetAdvDataNative(JNIEnv *env, jobject object, jint client_if, in gattSetAdvDataNative() argument
1262 jbyte* arr_data = env->GetByteArrayElements(manufacturerData, NULL); in gattSetAdvDataNative()
1263 uint16_t arr_len = (uint16_t) env->GetArrayLength(manufacturerData); in gattSetAdvDataNative()
1265 jbyte* service_data = env->GetByteArrayElements(serviceData, NULL); in gattSetAdvDataNative()
1266 uint16_t service_data_len = (uint16_t) env->GetArrayLength(serviceData); in gattSetAdvDataNative()
1268 jbyte* service_uuid = env->GetByteArrayElements(serviceUuid, NULL); in gattSetAdvDataNative()
1269 uint16_t service_uuid_len = (uint16_t) env->GetArrayLength(serviceUuid); in gattSetAdvDataNative()
1276 env->ReleaseByteArrayElements(manufacturerData, arr_data, JNI_ABORT); in gattSetAdvDataNative()
1277 env->ReleaseByteArrayElements(serviceData, service_data, JNI_ABORT); in gattSetAdvDataNative()
1278 env->ReleaseByteArrayElements(serviceUuid, service_uuid, JNI_ABORT); in gattSetAdvDataNative()
1281 static void gattSetScanParametersNative(JNIEnv* env, jobject object, in gattSetScanParametersNative() argument
1288 static void gattClientScanFilterParamAddNative(JNIEnv* env, jobject object, in gattClientScanFilterParamAddNative() argument
1302 static void gattClientScanFilterParamDeleteNative(JNIEnv* env, jobject object, in gattClientScanFilterParamDeleteNative() argument
1311 static void gattClientScanFilterParamClearAllNative(JNIEnv* env, jobject object, jint client_if) in gattClientScanFilterParamClearAllNative() argument
1319 static void gattClientScanFilterAddRemoveNative(JNIEnv* env, jobject object, in gattClientScanFilterAddRemoveNative() argument
1330 jstr2bdaddr(env, &bda, address); in gattClientScanFilterAddRemoveNative()
1338 jbyte* data_array = env->GetByteArrayElements(data, 0); in gattClientScanFilterAddRemoveNative()
1339 int data_len = env->GetArrayLength(data); in gattClientScanFilterAddRemoveNative()
1340 jbyte* mask_array = env->GetByteArrayElements(mask, NULL); in gattClientScanFilterAddRemoveNative()
1341 uint16_t mask_len = (uint16_t) env->GetArrayLength(mask); in gattClientScanFilterAddRemoveNative()
1344 env->ReleaseByteArrayElements(data, data_array, JNI_ABORT); in gattClientScanFilterAddRemoveNative()
1345 env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); in gattClientScanFilterAddRemoveNative()
1366 const char* c_name = env->GetStringUTFChars(name, NULL); in gattClientScanFilterAddRemoveNative()
1372 env->ReleaseStringUTFChars(name, c_name); in gattClientScanFilterAddRemoveNative()
1380 jbyte* data_array = env->GetByteArrayElements(data, 0); in gattClientScanFilterAddRemoveNative()
1381 int data_len = env->GetArrayLength(data); // Array contains mask in gattClientScanFilterAddRemoveNative()
1382 jbyte* mask_array = env->GetByteArrayElements(mask, NULL); in gattClientScanFilterAddRemoveNative()
1383 uint16_t mask_len = (uint16_t) env->GetArrayLength(mask); in gattClientScanFilterAddRemoveNative()
1387 env->ReleaseByteArrayElements(data, data_array, JNI_ABORT); in gattClientScanFilterAddRemoveNative()
1388 env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); in gattClientScanFilterAddRemoveNative()
1397 static void gattClientScanFilterAddNative(JNIEnv* env, jobject object, jint client_if, in gattClientScanFilterAddNative() argument
1404 gattClientScanFilterAddRemoveNative(env, object, client_if, action, filt_type, filt_index, in gattClientScanFilterAddNative()
1410 static void gattClientScanFilterDeleteNative(JNIEnv* env, jobject object, jint client_if, in gattClientScanFilterDeleteNative() argument
1417 gattClientScanFilterAddRemoveNative(env, object, client_if, action, filt_type, filt_index, in gattClientScanFilterDeleteNative()
1422 static void gattClientScanFilterClearNative(JNIEnv* env, jobject object, jint client_if, in gattClientScanFilterClearNative() argument
1429 static void gattClientScanFilterEnableNative (JNIEnv* env, jobject object, jint client_if, in gattClientScanFilterEnableNative() argument
1436 static void gattClientConfigureMTUNative(JNIEnv *env, jobject object, in gattClientConfigureMTUNative() argument
1443 static void gattConnectionParameterUpdateNative(JNIEnv *env, jobject object, jint client_if, in gattConnectionParameterUpdateNative() argument
1448 jstr2bdaddr(env, &bda, address); in gattConnectionParameterUpdateNative()
1452 static void gattClientEnableAdvNative(JNIEnv* env, jobject object, jint client_if, in gattClientEnableAdvNative() argument
1462 static void gattClientUpdateAdvNative(JNIEnv* env, jobject object, jint client_if, in gattClientUpdateAdvNative() argument
1472 static void gattClientSetAdvDataNative(JNIEnv* env, jobject object , jint client_if, in gattClientSetAdvDataNative() argument
1477 jbyte* manu_data = env->GetByteArrayElements(manufacturer_data, NULL); in gattClientSetAdvDataNative()
1478 uint16_t manu_len = (uint16_t) env->GetArrayLength(manufacturer_data); in gattClientSetAdvDataNative()
1480 jbyte* serv_data = env->GetByteArrayElements(service_data, NULL); in gattClientSetAdvDataNative()
1481 uint16_t serv_data_len = (uint16_t) env->GetArrayLength(service_data); in gattClientSetAdvDataNative()
1483 jbyte* serv_uuid = env->GetByteArrayElements(service_uuid, NULL); in gattClientSetAdvDataNative()
1484 uint16_t serv_uuid_len = (uint16_t) env->GetArrayLength(service_uuid); in gattClientSetAdvDataNative()
1491 env->ReleaseByteArrayElements(manufacturer_data, manu_data, JNI_ABORT); in gattClientSetAdvDataNative()
1492 env->ReleaseByteArrayElements(service_data, serv_data, JNI_ABORT); in gattClientSetAdvDataNative()
1493 env->ReleaseByteArrayElements(service_uuid, serv_uuid, JNI_ABORT); in gattClientSetAdvDataNative()
1496 static void gattClientDisableAdvNative(JNIEnv* env, jobject object, jint client_if) in gattClientDisableAdvNative() argument
1502 static void gattClientConfigBatchScanStorageNative(JNIEnv* env, jobject object, jint client_if, in gattClientConfigBatchScanStorageNative() argument
1511 static void gattClientStartBatchScanNative(JNIEnv* env, jobject object, jint client_if, in gattClientStartBatchScanNative() argument
1520 static void gattClientStopBatchScanNative(JNIEnv* env, jobject object, jint client_if) in gattClientStopBatchScanNative() argument
1526 static void gattClientReadScanReportsNative(JNIEnv* env, jobject object, jint client_if, in gattClientReadScanReportsNative() argument
1536 static void gattServerRegisterAppNative(JNIEnv* env, jobject object, in gattServerRegisterAppNative() argument
1545 static void gattServerUnregisterAppNative(JNIEnv* env, jobject object, jint serverIf) in gattServerUnregisterAppNative() argument
1551 static void gattServerConnectNative(JNIEnv *env, jobject object, in gattServerConnectNative() argument
1557 const char *c_address = env->GetStringUTFChars(address, NULL); in gattServerConnectNative()
1563 static void gattServerDisconnectNative(JNIEnv* env, jobject object, jint serverIf, in gattServerDisconnectNative() argument
1568 jstr2bdaddr(env, &bda, address); in gattServerDisconnectNative()
1572 static void gattServerAddServiceNative (JNIEnv *env, jobject object, in gattServerAddServiceNative() argument
1587 static void gattServerAddIncludedServiceNative (JNIEnv *env, jobject object, in gattServerAddIncludedServiceNative() argument
1595 static void gattServerAddCharacteristicNative (JNIEnv *env, jobject object, in gattServerAddCharacteristicNative() argument
1609 static void gattServerAddDescriptorNative (JNIEnv *env, jobject object, in gattServerAddDescriptorNative() argument
1622 static void gattServerStartServiceNative (JNIEnv *env, jobject object, in gattServerStartServiceNative() argument
1629 static void gattServerStopServiceNative (JNIEnv *env, jobject object, in gattServerStopServiceNative() argument
1636 static void gattServerDeleteServiceNative (JNIEnv *env, jobject object, in gattServerDeleteServiceNative() argument
1643 static void gattServerSendIndicationNative (JNIEnv *env, jobject object, in gattServerSendIndicationNative() argument
1648 jbyte* array = env->GetByteArrayElements(val, 0); in gattServerSendIndicationNative()
1649 int val_len = env->GetArrayLength(val); in gattServerSendIndicationNative()
1653 env->ReleaseByteArrayElements(val, array, JNI_ABORT); in gattServerSendIndicationNative()
1656 static void gattServerSendNotificationNative (JNIEnv *env, jobject object, in gattServerSendNotificationNative() argument
1661 jbyte* array = env->GetByteArrayElements(val, 0); in gattServerSendNotificationNative()
1662 int val_len = env->GetArrayLength(val); in gattServerSendNotificationNative()
1666 env->ReleaseByteArrayElements(val, array, JNI_ABORT); in gattServerSendNotificationNative()
1669 static void gattServerSendResponseNative (JNIEnv *env, jobject object, in gattServerSendResponseNative() argument
1684 response.attr_value.len = (uint16_t) env->GetArrayLength(val); in gattServerSendResponseNative()
1685 jbyte* array = env->GetByteArrayElements(val, 0); in gattServerSendResponseNative()
1689 env->ReleaseByteArrayElements(val, array, JNI_ABORT); in gattServerSendResponseNative()
1695 static void gattTestNative(JNIEnv *env, jobject object, jint command, in gattTestNative() argument
1702 jstr2bdaddr(env, &bt_bda1, bda1); in gattTestNative()
1793 int register_com_android_bluetooth_gatt(JNIEnv* env) in register_com_android_bluetooth_gatt() argument
1796 jniRegisterNativeMethods(env, "com/android/bluetooth/gatt/ScanManager$ScanNative", in register_com_android_bluetooth_gatt()
1799 jniRegisterNativeMethods(env, "com/android/bluetooth/gatt/AdvertiseManager$AdvertiseNative", in register_com_android_bluetooth_gatt()
1802 jniRegisterNativeMethods(env, "com/android/bluetooth/gatt/GattService", in register_com_android_bluetooth_gatt()