summaryrefslogtreecommitdiffstats
path: root/examples/java/CMakeLists.txt
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2020-04-20 07:21:35 +0200
committerSven Gothel <[email protected]>2020-04-20 07:21:35 +0200
commit6fdcdb13db5e13f11c44f0f9bba088252d9ffa18 (patch)
tree8c9c321dd2064eb53438544f0faba91306629c8c /examples/java/CMakeLists.txt
parent6505f49b63db200d817817d1d01a14005a3d732c (diff)
Initial working Java binding for the direct_bt C++ module
Example ScannerTinyB01 demonstrates efficient scanning devices using the new BluetoothDeviceDiscoveryListener interface. The C++ HCIObject extends JavaUplink, which handles the java object references via 'std::shared_ptr<JavaAnonObj>', where JavaAnonObj relies on later polymorph specialization. JavaAnonObj gets derived in the java/jni of direct_bt, where the JNI header + libraries are available. +++ The java inplementing NativeDownlink implementations store the nativeInstance to the C++ instances as well as handle their java references within the native instances. The C++ JavaUplink and Java NativeDownlink interfaces are complete the cross referencing java <-> native. +++ Native libraries are now split into pairs: - tinyb + javatinyb - direct_bt + javadirect_bt TODO: BluetoothFactory must chose the proper bundle! +++ The Java Adapter received a BluetoothDeviceDiscoveryListener hook, matching C++ Adapter's HCIDeviceDiscoveryListener. Since the Java Adapter implements its own discovery thread, using the BluetoothDeviceDiscoveryListener is more efficient then polling over a list of Devices fetched. ++++ TODO: Align Java and C++ class names, foremost in the C++ direct_bt space. TODO: Bind the whole C++ GATT functionality More testing.
Diffstat (limited to 'examples/java/CMakeLists.txt')
-rw-r--r--examples/java/CMakeLists.txt13
1 files changed, 10 insertions, 3 deletions
diff --git a/examples/java/CMakeLists.txt b/examples/java/CMakeLists.txt
index a76b80b9..d8945755 100644
--- a/examples/java/CMakeLists.txt
+++ b/examples/java/CMakeLists.txt
@@ -22,9 +22,16 @@ add_custom_command(TARGET Notification
COMMAND cp "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/Notification.dir/Notification.class" "${CMAKE_CURRENT_BINARY_DIR}"
)
-add_jar(ScannerTinyB SOURCES ScannerTinyB.java INCLUDE_JARS "${CMAKE_CURRENT_BINARY_DIR}/../../java/tinyb2.jar" ENTRY_POINT Notification)
+add_jar(ScannerTinyB00 SOURCES ScannerTinyB00.java INCLUDE_JARS "${CMAKE_CURRENT_BINARY_DIR}/../../java/tinyb2.jar" ENTRY_POINT Notification)
-add_custom_command(TARGET ScannerTinyB
+add_custom_command(TARGET ScannerTinyB00
POST_BUILD
- COMMAND cp "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/ScannerTinyB.dir/ScannerTinyB.class" "${CMAKE_CURRENT_BINARY_DIR}"
+ COMMAND cp "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/ScannerTinyB00.dir/ScannerTinyB00.class" "${CMAKE_CURRENT_BINARY_DIR}"
+)
+
+add_jar(ScannerTinyB01 SOURCES ScannerTinyB01.java INCLUDE_JARS "${CMAKE_CURRENT_BINARY_DIR}/../../java/tinyb2.jar" ENTRY_POINT Notification)
+
+add_custom_command(TARGET ScannerTinyB01
+ POST_BUILD
+ COMMAND cp "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/ScannerTinyB01.dir/ScannerTinyB01.class" "${CMAKE_CURRENT_BINARY_DIR}"
)