diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/direct_bt/tinyb/DBTDevice.java | 13 | ||||
-rw-r--r-- | java/jni/direct_bt/DBTDevice.cxx | 2 |
2 files changed, 13 insertions, 2 deletions
diff --git a/java/direct_bt/tinyb/DBTDevice.java b/java/direct_bt/tinyb/DBTDevice.java index f0ab41ea..e2390a51 100644 --- a/java/direct_bt/tinyb/DBTDevice.java +++ b/java/direct_bt/tinyb/DBTDevice.java @@ -508,7 +508,18 @@ public class DBTDevice extends DBTObject implements BluetoothDevice public native boolean remove() throws BluetoothException; @Override - public native List<BluetoothGattService> getServices(); + public List<BluetoothGattService> getServices() { + try { + return getServicesImpl(); + } catch (final Throwable t) { + if(DEBUG) { + System.err.println("Caught "+t.getMessage()+" on thread "+Thread.currentThread().toString()); + t.printStackTrace(); + } + } + return null; + } + private native List<BluetoothGattService> getServicesImpl(); /* property accessors: */ diff --git a/java/jni/direct_bt/DBTDevice.cxx b/java/jni/direct_bt/DBTDevice.cxx index 306e4156..465aa87d 100644 --- a/java/jni/direct_bt/DBTDevice.cxx +++ b/java/jni/direct_bt/DBTDevice.cxx @@ -329,7 +329,7 @@ jboolean Java_direct_1bt_tinyb_DBTDevice_connectImpl__SSSSSS(JNIEnv *env, jobjec static const std::string _serviceClazzCtorArgs("(JLdirect_bt/tinyb/DBTDevice;ZLjava/lang/String;SS)V"); -jobject Java_direct_1bt_tinyb_DBTDevice_getServices(JNIEnv *env, jobject obj) { +jobject Java_direct_1bt_tinyb_DBTDevice_getServicesImpl(JNIEnv *env, jobject obj) { try { DBTDevice *device = getInstance<DBTDevice>(env, obj); JavaGlobalObj::check(device->getJavaObject(), E_FILE_LINE); |