Seperate GATT from BLE plugin 06/260806/2
authorSeonah Moon <seonah1.moon@samsung.com>
Mon, 5 Jul 2021 02:21:58 +0000 (11:21 +0900)
committerSeonah Moon <seonah1.moon@samsung.com>
Wed, 7 Jul 2021 02:41:42 +0000 (11:41 +0900)
Change-Id: I341ad739a779a0d4659da478e6acf00d8c4a8d2c

CMakeLists.txt
plugins/ble-gatt/CMakeLists.txt [new file with mode: 0755]
plugins/ble-gatt/ble-gatt-plugin.cpp [moved from plugins/ble/gatt-plugin.cpp with 100% similarity]
plugins/ble-gatt/ble-gatt-plugin.h [new file with mode: 0755]

index eae5055..a6834a7 100755 (executable)
@@ -127,6 +127,7 @@ ENDIF(USE_LIBWEBSOCKETS)
 ADD_SUBDIRECTORY(plugins/dns-sd)
 IF(BT_SUPPORT)
        ADD_SUBDIRECTORY(plugins/ble)
+       ADD_SUBDIRECTORY(plugins/ble-gatt)
 ENDIF(BT_SUPPORT)
 
 ADD_SUBDIRECTORY(include)
diff --git a/plugins/ble-gatt/CMakeLists.txt b/plugins/ble-gatt/CMakeLists.txt
new file mode 100755 (executable)
index 0000000..977029e
--- /dev/null
@@ -0,0 +1,51 @@
+# Copyright (c) 2021 Samsung Electronics Co., Ltd All Rights Reserved
+#
+#    Licensed under the Apache License, Version 2.0 (the "License");
+#    you may not use this file except in compliance with the License.
+#    You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+#    Unless required by applicable law or agreed to in writing, software
+#    distributed under the License is distributed on an "AS IS" BASIS,
+#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#    See the License for the specific language governing permissions and
+#    limitations under the License.
+#
+
+SET(BLE_GATT_PLUGIN "vine-plugin-ble-gatt")
+
+SET(BLE_GATT_PLUGIN_VERSION_MAJOR "1")
+SET(BLE_GATT_PLUGIN_VERSION_MINOR "0")
+SET(BLE_GATT_PLUGIN_VERSION_PATCH "0")
+SET(BLE_GATT_PLUGIN_VERSION ${BLE_GATT_PLUGIN_VERSION_MAJOR}.${BLE_GATT_PLUGIN_VERSION_MINOR}.${BLE_GATT_PLUGIN_VERSION_PATCH})
+
+PKG_CHECK_MODULES(BLE_DEPS REQUIRED "capi-network-bluetooth")
+
+INCLUDE_DIRECTORIES(
+    ${VINE_PATH}/include
+    ${VINE_LOGGER_PATH}
+    ${CMAKE_CURRENT_SOURCE_DIR}
+    ${${fw_name}_INCLUDE_DIRS}
+       ${BLE_DEPS_INCLUDE_DIRS}
+)
+
+FILE(GLOB VINE_BLE_GATT_PLUGIN_SOURCES *.cpp)
+
+ADD_DEFINITIONS("-fvisibility=default")
+ADD_LIBRARY(${BLE_GATT_PLUGIN} SHARED ${VINE_BLE_GATT_PLUGIN_SOURCES})
+
+SET_TARGET_PROPERTIES(
+    ${BLE_GATT_PLUGIN}
+    PROPERTIES
+        SOVERSION ${BLE_GATT_PLUGIN_VERSION_MAJOR}
+)
+
+TARGET_LINK_LIBRARIES(${BLE_GATT_PLUGIN}
+    ${VINE_LOGGER}
+    ${BLE_DEPS_LIBRARIES}
+    ${fw_name_deps_LIBRARIES}
+    dl
+)
+
+INSTALL(TARGETS ${BLE_GATT_PLUGIN} DESTINATION "${LIB_DIR}")
diff --git a/plugins/ble-gatt/ble-gatt-plugin.h b/plugins/ble-gatt/ble-gatt-plugin.h
new file mode 100755 (executable)
index 0000000..d1766f0
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Copyright (c) 2021 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+*/
+
+#pragma once