Loading android/app/jni/com_android_bluetooth_gatt.cpp +25 −26 Original line number Original line Diff line number Diff line Loading @@ -1136,7 +1136,7 @@ static void gattSetScanParametersNative(JNIEnv* env, jobject object, jint client_if, jint scan_interval_unit, jint client_if, jint scan_interval_unit, jint scan_window_unit) { jint scan_window_unit) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->set_scan_parameters(client_if, scan_interval_unit, sGattIf->scanner->SetScanParameters(client_if, scan_interval_unit, scan_window_unit); scan_window_unit); } } Loading Loading @@ -1220,9 +1220,9 @@ static void gattClientScanFilterAddRemoveNative( { { bt_bdaddr_t bda; bt_bdaddr_t bda; jstr2bdaddr(env, &bda, address); jstr2bdaddr(env, &bda, address); sGattIf->scanner->scan_filter_add_remove(client_if, action, filt_type, sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, filt_index, 0, 0, NULL, NULL, &bda, &bda, addr_type, {}, {}); addr_type, {}, {}); break; break; } } Loading @@ -1238,7 +1238,7 @@ static void gattClientScanFilterAddRemoveNative( std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); sGattIf->scanner->scan_filter_add_remove( sGattIf->scanner->ScanFilterAddRemove( client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, NULL, 0, client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, NULL, 0, std::move(vec_data), std::move(vec_mask)); std::move(vec_data), std::move(vec_mask)); break; break; Loading @@ -1251,11 +1251,11 @@ static void gattClientScanFilterAddRemoveNative( set_uuid(uuid.uu, uuid_msb, uuid_lsb); set_uuid(uuid.uu, uuid_msb, uuid_lsb); set_uuid(uuid_mask.uu, uuid_mask_msb, uuid_mask_lsb); set_uuid(uuid_mask.uu, uuid_mask_msb, uuid_mask_lsb); if (uuid_mask_lsb != 0 && uuid_mask_msb != 0) if (uuid_mask_lsb != 0 && uuid_mask_msb != 0) sGattIf->scanner->scan_filter_add_remove(client_if, action, filt_type, sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, filt_index, 0, 0, &uuid, filt_index, 0, 0, &uuid, &uuid_mask, NULL, 0, {}, {}); &uuid_mask, NULL, 0, {}, {}); else else sGattIf->scanner->scan_filter_add_remove(client_if, action, filt_type, sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, filt_index, 0, 0, &uuid, NULL, filt_index, 0, 0, &uuid, NULL, NULL, 0, {}, {}); NULL, 0, {}, {}); break; break; Loading @@ -1267,9 +1267,9 @@ static void gattClientScanFilterAddRemoveNative( if (c_name != NULL && strlen(c_name) != 0) { if (c_name != NULL && strlen(c_name) != 0) { std::vector<uint8_t> vec_name(c_name, c_name + strlen(c_name)); std::vector<uint8_t> vec_name(c_name, c_name + strlen(c_name)); env->ReleaseStringUTFChars(name, c_name); env->ReleaseStringUTFChars(name, c_name); sGattIf->scanner->scan_filter_add_remove( sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, NULL, 0, filt_index, 0, 0, NULL, NULL, std::move(vec_name), {}); NULL, 0, std::move(vec_name), {}); } } break; break; } } Loading @@ -1287,7 +1287,7 @@ static void gattClientScanFilterAddRemoveNative( std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); sGattIf->scanner->scan_filter_add_remove( sGattIf->scanner->ScanFilterAddRemove( client_if, action, filt_type, filt_index, company_id, company_id_mask, client_if, action, filt_type, filt_index, company_id, company_id_mask, NULL, NULL, NULL, 0, std::move(vec_data), std::move(vec_mask)); NULL, NULL, NULL, 0, std::move(vec_data), std::move(vec_mask)); break; break; Loading Loading @@ -1327,13 +1327,13 @@ static void gattClientScanFilterDeleteNative( static void gattClientScanFilterClearNative(JNIEnv* env, jobject object, static void gattClientScanFilterClearNative(JNIEnv* env, jobject object, jint client_if, jint filt_index) { jint client_if, jint filt_index) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->scan_filter_clear(client_if, filt_index); sGattIf->scanner->ScanFilterClear(client_if, filt_index); } } static void gattClientScanFilterEnableNative(JNIEnv* env, jobject object, static void gattClientScanFilterEnableNative(JNIEnv* env, jobject object, jint client_if, jboolean enable) { jint client_if, jboolean enable) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->scan_filter_enable(client_if, enable); sGattIf->scanner->ScanFilterEnable(client_if, enable); } } static void gattClientConfigureMTUNative(JNIEnv* env, jobject object, static void gattClientConfigureMTUNative(JNIEnv* env, jobject object, Loading Loading @@ -1421,7 +1421,7 @@ static void gattClientConfigBatchScanStorageNative( JNIEnv* env, jobject object, jint client_if, jint max_full_reports_percent, JNIEnv* env, jobject object, jint client_if, jint max_full_reports_percent, jint max_trunc_reports_percent, jint notify_threshold_level_percent) { jint max_trunc_reports_percent, jint notify_threshold_level_percent) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_cfg_storage(client_if, max_full_reports_percent, sGattIf->scanner->BatchscanConfigStorage(client_if, max_full_reports_percent, max_trunc_reports_percent, max_trunc_reports_percent, notify_threshold_level_percent); notify_threshold_level_percent); } } Loading @@ -1432,21 +1432,20 @@ static void gattClientStartBatchScanNative(JNIEnv* env, jobject object, jint scan_window_unit, jint scan_window_unit, jint addr_type, jint discard_rule) { jint addr_type, jint discard_rule) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_enb_batch_scan( sGattIf->scanner->BatchscanEnable(client_if, scan_mode, scan_interval_unit, client_if, scan_mode, scan_interval_unit, scan_window_unit, addr_type, scan_window_unit, addr_type, discard_rule); discard_rule); } } static void gattClientStopBatchScanNative(JNIEnv* env, jobject object, static void gattClientStopBatchScanNative(JNIEnv* env, jobject object, jint client_if) { jint client_if) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_dis_batch_scan(client_if); sGattIf->scanner->BatchscanDisable(client_if); } } static void gattClientReadScanReportsNative(JNIEnv* env, jobject object, static void gattClientReadScanReportsNative(JNIEnv* env, jobject object, jint client_if, jint scan_type) { jint client_if, jint scan_type) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_read_reports(client_if, scan_type); sGattIf->scanner->BatchscanReadReports(client_if, scan_type); } } /** /** Loading Loading
android/app/jni/com_android_bluetooth_gatt.cpp +25 −26 Original line number Original line Diff line number Diff line Loading @@ -1136,7 +1136,7 @@ static void gattSetScanParametersNative(JNIEnv* env, jobject object, jint client_if, jint scan_interval_unit, jint client_if, jint scan_interval_unit, jint scan_window_unit) { jint scan_window_unit) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->set_scan_parameters(client_if, scan_interval_unit, sGattIf->scanner->SetScanParameters(client_if, scan_interval_unit, scan_window_unit); scan_window_unit); } } Loading Loading @@ -1220,9 +1220,9 @@ static void gattClientScanFilterAddRemoveNative( { { bt_bdaddr_t bda; bt_bdaddr_t bda; jstr2bdaddr(env, &bda, address); jstr2bdaddr(env, &bda, address); sGattIf->scanner->scan_filter_add_remove(client_if, action, filt_type, sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, filt_index, 0, 0, NULL, NULL, &bda, &bda, addr_type, {}, {}); addr_type, {}, {}); break; break; } } Loading @@ -1238,7 +1238,7 @@ static void gattClientScanFilterAddRemoveNative( std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); sGattIf->scanner->scan_filter_add_remove( sGattIf->scanner->ScanFilterAddRemove( client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, NULL, 0, client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, NULL, 0, std::move(vec_data), std::move(vec_mask)); std::move(vec_data), std::move(vec_mask)); break; break; Loading @@ -1251,11 +1251,11 @@ static void gattClientScanFilterAddRemoveNative( set_uuid(uuid.uu, uuid_msb, uuid_lsb); set_uuid(uuid.uu, uuid_msb, uuid_lsb); set_uuid(uuid_mask.uu, uuid_mask_msb, uuid_mask_lsb); set_uuid(uuid_mask.uu, uuid_mask_msb, uuid_mask_lsb); if (uuid_mask_lsb != 0 && uuid_mask_msb != 0) if (uuid_mask_lsb != 0 && uuid_mask_msb != 0) sGattIf->scanner->scan_filter_add_remove(client_if, action, filt_type, sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, filt_index, 0, 0, &uuid, filt_index, 0, 0, &uuid, &uuid_mask, NULL, 0, {}, {}); &uuid_mask, NULL, 0, {}, {}); else else sGattIf->scanner->scan_filter_add_remove(client_if, action, filt_type, sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, filt_index, 0, 0, &uuid, NULL, filt_index, 0, 0, &uuid, NULL, NULL, 0, {}, {}); NULL, 0, {}, {}); break; break; Loading @@ -1267,9 +1267,9 @@ static void gattClientScanFilterAddRemoveNative( if (c_name != NULL && strlen(c_name) != 0) { if (c_name != NULL && strlen(c_name) != 0) { std::vector<uint8_t> vec_name(c_name, c_name + strlen(c_name)); std::vector<uint8_t> vec_name(c_name, c_name + strlen(c_name)); env->ReleaseStringUTFChars(name, c_name); env->ReleaseStringUTFChars(name, c_name); sGattIf->scanner->scan_filter_add_remove( sGattIf->scanner->ScanFilterAddRemove(client_if, action, filt_type, client_if, action, filt_type, filt_index, 0, 0, NULL, NULL, NULL, 0, filt_index, 0, 0, NULL, NULL, std::move(vec_name), {}); NULL, 0, std::move(vec_name), {}); } } break; break; } } Loading @@ -1287,7 +1287,7 @@ static void gattClientScanFilterAddRemoveNative( std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); std::vector<uint8_t> vec_mask(mask_array, mask_array + mask_len); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); env->ReleaseByteArrayElements(mask, mask_array, JNI_ABORT); sGattIf->scanner->scan_filter_add_remove( sGattIf->scanner->ScanFilterAddRemove( client_if, action, filt_type, filt_index, company_id, company_id_mask, client_if, action, filt_type, filt_index, company_id, company_id_mask, NULL, NULL, NULL, 0, std::move(vec_data), std::move(vec_mask)); NULL, NULL, NULL, 0, std::move(vec_data), std::move(vec_mask)); break; break; Loading Loading @@ -1327,13 +1327,13 @@ static void gattClientScanFilterDeleteNative( static void gattClientScanFilterClearNative(JNIEnv* env, jobject object, static void gattClientScanFilterClearNative(JNIEnv* env, jobject object, jint client_if, jint filt_index) { jint client_if, jint filt_index) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->scan_filter_clear(client_if, filt_index); sGattIf->scanner->ScanFilterClear(client_if, filt_index); } } static void gattClientScanFilterEnableNative(JNIEnv* env, jobject object, static void gattClientScanFilterEnableNative(JNIEnv* env, jobject object, jint client_if, jboolean enable) { jint client_if, jboolean enable) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->scan_filter_enable(client_if, enable); sGattIf->scanner->ScanFilterEnable(client_if, enable); } } static void gattClientConfigureMTUNative(JNIEnv* env, jobject object, static void gattClientConfigureMTUNative(JNIEnv* env, jobject object, Loading Loading @@ -1421,7 +1421,7 @@ static void gattClientConfigBatchScanStorageNative( JNIEnv* env, jobject object, jint client_if, jint max_full_reports_percent, JNIEnv* env, jobject object, jint client_if, jint max_full_reports_percent, jint max_trunc_reports_percent, jint notify_threshold_level_percent) { jint max_trunc_reports_percent, jint notify_threshold_level_percent) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_cfg_storage(client_if, max_full_reports_percent, sGattIf->scanner->BatchscanConfigStorage(client_if, max_full_reports_percent, max_trunc_reports_percent, max_trunc_reports_percent, notify_threshold_level_percent); notify_threshold_level_percent); } } Loading @@ -1432,21 +1432,20 @@ static void gattClientStartBatchScanNative(JNIEnv* env, jobject object, jint scan_window_unit, jint scan_window_unit, jint addr_type, jint discard_rule) { jint addr_type, jint discard_rule) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_enb_batch_scan( sGattIf->scanner->BatchscanEnable(client_if, scan_mode, scan_interval_unit, client_if, scan_mode, scan_interval_unit, scan_window_unit, addr_type, scan_window_unit, addr_type, discard_rule); discard_rule); } } static void gattClientStopBatchScanNative(JNIEnv* env, jobject object, static void gattClientStopBatchScanNative(JNIEnv* env, jobject object, jint client_if) { jint client_if) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_dis_batch_scan(client_if); sGattIf->scanner->BatchscanDisable(client_if); } } static void gattClientReadScanReportsNative(JNIEnv* env, jobject object, static void gattClientReadScanReportsNative(JNIEnv* env, jobject object, jint client_if, jint scan_type) { jint client_if, jint scan_type) { if (!sGattIf) return; if (!sGattIf) return; sGattIf->scanner->batchscan_read_reports(client_if, scan_type); sGattIf->scanner->BatchscanReadReports(client_if, scan_type); } } /** /** Loading