Direct-BT
2.3.1
Direct-BT - Direct Bluetooth Programming.
|
Go to the documentation of this file.
36 #define JAVA_MAIN_PACKAGE "org/direct_bt"
44 jobject result = env->GetStaticObjectField(b_type_enum, b_type_field);
45 env->DeleteLocalRef(b_type_enum);
51 env->ThrowNew(env->FindClass(
"org/direct_bt/BTException"), e.
what());
61 }
catch (
const std::bad_alloc &e) {
81 }
catch (
const std::runtime_error &e) {
83 }
catch (
const std::invalid_argument &e) {
85 }
catch (
const std::exception &e) {
87 }
catch (
const std::string &msg) {
89 env->ThrowNew(env->FindClass(
"java/lang/Error"), msg.c_str());
90 }
catch (
const char *msg) {
92 env->ThrowNew(env->FindClass(
"java/lang/Error"), msg);
void rethrow_and_raise_java_exception_impl(JNIEnv *env, const char *file, int line)
Re-throw current exception and raise respective java exception using any matching function above.
virtual const char * what() const noexcept override
void raise_java_exception(JNIEnv *env, const direct_bt::BTException &e, const char *file, int line)
void print_native_caught_exception_fwd2java(const std::exception &e, const char *file, int line)
jclass search_class(JNIEnv *env, const char *clazz_name)
jobject get_bluetooth_type(JNIEnv *env, const char *field_name)
void raise_java_exception(JNIEnv *env, const std::exception &e, const char *file, int line)
#define JAVA_MAIN_PACKAGE
jfieldID search_field(JNIEnv *env, jclass clazz, const char *field_name, const char *type, bool is_static)
static std::string _unknown_exception_type_msg("Unknown exception type")