• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 The Android Open Source Project
3  * Copyright 2018-2020 NXP.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 #pragma once
18 #include <jni.h>
19 #include <pthread.h>
20 #include <semaphore.h>
21 #include <sys/queue.h>
22 
23 #define JNI_NULL 0
24 
25 struct uwb_jni_native_data {
26   /* Our VM */
27   JavaVM *vm;
28   jobject manager;
29   jclass mRangeDataClass;
30   jclass rangingTwoWayMeasuresClass;
31   jclass mRangeTdoaMeasuresClass;
32   jclass periodicTxDataClass;
33   jclass perRxDataClass;
34   jclass uwbLoopBackDataClass;
35   jclass multicastUpdateListDataClass;
36 };
37 
38 jint JNI_OnLoad(JavaVM *jvm, void *reserved);
39 
40 int uwb_jni_cache_jclass(JNIEnv *env, const char *clsname,
41                          jclass *cached_jclass);
42 
43 namespace android {
44 int register_com_android_uwb_dhimpl_UwbNativeManager(JNIEnv *env);
45 int register_com_android_uwb_dhimpl_NxpUwbNativeManager(JNIEnv *env);
46 int register_com_android_uwb_dhimpl_UwbRfTestNativeManager(JNIEnv *env);
47 } // namespace android