26 #include "jau_direct_bt_DBTGattService.h"
42 BTGattService *nativePtr = getJavaUplinkObject<BTGattService>(env, obj);
55 BTGattService *service = castInstance<BTGattService>(nativeInstance);
63 static const std::string
_characteristicClazzCtorArgs(
"(JLjau/direct_bt/DBTGattService;SLorg/direct_bt/GattCharPropertySet;Ljava/lang/String;SI)V");
69 BTGattService *service = getJavaUplinkObject<BTGattService>(env, obj);
74 jclass gattCharPropSetClazz;
75 jmethodID gattCharPropSetClazzCtor;
80 if(
nullptr == gattCharPropSetClazz ) {
86 if(
nullptr == gattCharPropSetClazzCtor ) {
96 std::function<jobject(JNIEnv*, jclass, jmethodID,
BTGattChar *)> ctor_char =
97 [&gattCharPropSetClazz, &gattCharPropSetClazzCtor](JNIEnv *env_, jclass clazz, jmethodID clazz_ctor,
BTGattChar *characteristic)->jobject {
99 std::shared_ptr<BTGattService> _service = characteristic->getServiceChecked();
101 jobject jservice = JavaGlobalObj::GetObject(_service->
getJavaObject());
103 jobject jGattCharPropSet = env_->NewObject(gattCharPropSetClazz, gattCharPropSetClazzCtor, (jbyte)characteristic->properties);
110 characteristic->value_type->toString());
113 jobject jcharVal = env_->NewObject(clazz, clazz_ctor, (jlong)characteristic, jservice,
114 characteristic->handle, jGattCharPropSet,
115 uuid, characteristic->value_handle, characteristic->clientCharConfigIndex);
118 std::shared_ptr<JavaAnon> jCharRef = characteristic->getJavaObject();
120 env_->DeleteLocalRef(jGattCharPropSet);
121 env_->DeleteLocalRef(jcharVal);
122 return JavaGlobalObj::GetObject(jCharRef);
124 jobject jres = convert_vector_sharedptr_to_jarraylist<jau::darray<std::shared_ptr<BTGattChar>>,
BTGattChar>(
126 env->DeleteLocalRef(gattCharPropSetClazz);