Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
jni_android.cpp File Reference
#include <jni.h>
#include <android/log.h>
#include <QtCore/QLoggingCategory>
#include <QtBluetooth/qtbluetoothglobal.h>
#include "android/jni_android_p.h"
#include "android/androidbroadcastreceiver_p.h"
#include "android/serveracceptancethread_p.h"
#include "android/inputstreamthread_p.h"
#include "android/lowenergynotificationhub_p.h"
+ Include dependency graph for jni_android.cpp:

Go to the source code of this file.

Macros

#define FIND_AND_CHECK_CLASS(CLASS_NAME)
 
#define LEHUB_SCOPED_METHOD(Method)   Q_JNI_NATIVE_SCOPED_METHOD(Method, LowEnergyNotificationHub)
 

Functions

QJniObject valueFromStaticFieldCache (const char *key, const char *className, const char *fieldName)
 
void QtBroadcastReceiver_jniOnReceive (JNIEnv *env, jobject, jlong qtObject, QtJniTypes::Context context, QtJniTypes::Intent intent)
 
static void QtBluetoothSocketServer_errorOccurred (JNIEnv *, jobject, jlong qtObject, jint errorCode)
 
static void QtBluetoothSocketServer_newSocket (JNIEnv *, jobject, jlong qtObject, QtJniTypes::BluetoothSocket socket)
 
static void QtBluetoothInputStreamThread_errorOccurred (JNIEnv *, jobject, jlong qtObject, jint errorCode)
 
static void QtBluetoothInputStreamThread_readyData (JNIEnv *, jobject, jlong qtObject, jbyteArray buffer, jint bufferLength)
 
void QtBluetoothLE_leScanResult (JNIEnv *env, jobject, jlong qtObject, QtJniTypes::BluetoothDevice bluetoothDevice, jint rssi, jbyteArray scanRecord)
 
static bool registerNatives ()
 
QT_END_NAMESPACE Q_BLUETOOTH_EXPORT jint JNICALL JNI_OnLoad (JavaVM *vm, void *)
 

Variables

QT_BEGIN_NAMESPACE typedef QHash< QByteArray, QJniObjectJCachedStringFields
 
static const char logTag [] = "QtBluetooth"
 
static const char classErrorMsg [] = "Can't find class \"%s\""
 

Macro Definition Documentation

◆ FIND_AND_CHECK_CLASS

#define FIND_AND_CHECK_CLASS (   CLASS_NAME)
Value:
clazz = env.findClass<CLASS_NAME>(); \
if (!clazz) { \
__android_log_print(ANDROID_LOG_FATAL, logTag, classErrorMsg, \
QtJniTypes::className<CLASS_NAME>().data()); \
return JNI_FALSE; \
} \
static const char logTag[]
static const char classErrorMsg[]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data

Definition at line 97 of file jni_android.cpp.

◆ LEHUB_SCOPED_METHOD

#define LEHUB_SCOPED_METHOD (   Method)    Q_JNI_NATIVE_SCOPED_METHOD(Method, LowEnergyNotificationHub)

Definition at line 105 of file jni_android.cpp.

Function Documentation

◆ JNI_OnLoad()

QT_END_NAMESPACE Q_BLUETOOTH_EXPORT jint JNICALL JNI_OnLoad ( JavaVM *  vm,
void  
)

Definition at line 189 of file jni_android.cpp.

References logTag, and registerNatives().

+ Here is the call graph for this function:

◆ QtBluetoothInputStreamThread_errorOccurred()

static void QtBluetoothInputStreamThread_errorOccurred ( JNIEnv *  ,
jobject  ,
jlong  qtObject,
jint  errorCode 
)
static

Definition at line 67 of file jni_android.cpp.

◆ QtBluetoothInputStreamThread_readyData()

static void QtBluetoothInputStreamThread_readyData ( JNIEnv *  ,
jobject  ,
jlong  qtObject,
jbyteArray  buffer,
jint  bufferLength 
)
static

Definition at line 74 of file jni_android.cpp.

◆ QtBluetoothLE_leScanResult()

void QtBluetoothLE_leScanResult ( JNIEnv *  env,
jobject  ,
jlong  qtObject,
QtJniTypes::BluetoothDevice  bluetoothDevice,
jint  rssi,
jbyteArray  scanRecord 
)

Definition at line 81 of file jni_android.cpp.

◆ QtBluetoothSocketServer_errorOccurred()

static void QtBluetoothSocketServer_errorOccurred ( JNIEnv *  ,
jobject  ,
jlong  qtObject,
jint  errorCode 
)
static

Definition at line 53 of file jni_android.cpp.

◆ QtBluetoothSocketServer_newSocket()

static void QtBluetoothSocketServer_newSocket ( JNIEnv *  ,
jobject  ,
jlong  qtObject,
QtJniTypes::BluetoothSocket  socket 
)
static

Definition at line 60 of file jni_android.cpp.

References socket.

◆ QtBroadcastReceiver_jniOnReceive()

void QtBroadcastReceiver_jniOnReceive ( JNIEnv *  env,
jobject  ,
jlong  qtObject,
QtJniTypes::Context  context,
QtJniTypes::Intent  intent 
)

Definition at line 45 of file jni_android.cpp.

◆ registerNatives()

static bool registerNatives ( )
static

Definition at line 107 of file jni_android.cpp.

References FIND_AND_CHECK_CLASS, and logTag.

Referenced by JNI_OnLoad().

+ Here is the caller graph for this function:

◆ valueFromStaticFieldCache()

QJniObject valueFromStaticFieldCache ( const char *  key,
const char *  className,
const char *  fieldName 
)

Definition at line 26 of file jni_android.cpp.

References className, QSet< T >::find(), and it.

Referenced by valueForStaticField().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ classErrorMsg

const char classErrorMsg[] = "Can't find class \"%s\""
static

Definition at line 95 of file jni_android.cpp.

◆ JCachedStringFields

QT_BEGIN_NAMESPACE typedef QHash<QByteArray, QJniObject> JCachedStringFields

Definition at line 19 of file jni_android.cpp.

◆ logTag

const char logTag[] = "QtBluetooth"
static