[Adapt] Undefine RFCOMM_DIRECT flag 10/79810/1
authorAtul Rai <a.rai@samsung.com>
Tue, 12 Jul 2016 07:53:35 +0000 (16:53 +0900)
committerAtul Rai <a.rai@samsung.com>
Wed, 13 Jul 2016 05:35:54 +0000 (14:35 +0900)
In this patch we undefine RFCOMM_DIRECT flag and fix the build
error which occurred if RFCOMM_DIRECT is not defined.

Change-Id: I317757a1be40eb57f88dd6de9848b0e54e68a872
Signed-off-by: Atul Rai <a.rai@samsung.com>
bt-api/bt-event-handler.c
bt-api/bt-rfcomm-client.c
bt-api/bt-rfcomm-server.c
packaging/bluetooth-frwk.spec

index 3f23efb..dd2b78e 100644 (file)
@@ -2207,8 +2207,12 @@ void __bt_rfcomm_server_event_filter(GDBusConnection *connection,
                g_variant_get(parameters, "(i&s&s&s&sn)", &result, &address,
                                                &uuid, &name, &path, &socket_fd);
 
+#ifdef RFCOMM_DIRECT
                if (_check_uuid_path(path, uuid) == FALSE)
                        return;
+#else
+               /* TODO: need to check UUID */
+#endif
 
                memset(&req_ind, 0x00, sizeof(bluetooth_rfcomm_connection_request_t));
                _bt_convert_addr_string_to_type(req_ind.device_addr.addr,
index 22720b3..59e6a59 100644 (file)
@@ -406,8 +406,6 @@ static void __client_connected_cb(rfcomm_cb_data_t *cb_data, char *dev_address,
        BT_DBG("-");
 }
 
-#endif
-
 int new_connection(const char *path, int fd, bluetooth_device_address_t *addr)
 {
        rfcomm_cb_data_t *info;
@@ -552,6 +550,7 @@ done:
        if (err)
                g_clear_error(&err);
 }
+#endif
 
 BT_EXPORT_API int bluetooth_rfcomm_connect(
                const bluetooth_device_address_t *remote_bt_address,
@@ -693,6 +692,7 @@ BT_EXPORT_API int bluetooth_rfcomm_connect(
 
 BT_EXPORT_API int bluetooth_rfcomm_client_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected)
 {
+#ifdef RFCOMM_DIRECT
        GSList *l;
        GSList *conn_list = NULL;
        rfcomm_cb_data_t *client_info;
@@ -723,6 +723,9 @@ BT_EXPORT_API int bluetooth_rfcomm_client_is_connected(const bluetooth_device_ad
        }
 
        return BLUETOOTH_ERROR_NONE;
+#else
+       return BLUETOOTH_ERROR_NOT_SUPPORT;
+#endif
 }
 
 BT_EXPORT_API gboolean bluetooth_rfcomm_is_client_connected(void)
@@ -908,4 +911,3 @@ BT_EXPORT_API int bluetooth_rfcomm_write(int fd, const char *buf, int length)
        return result;
 #endif
 }
-
index 670dd9e..027dd1a 100644 (file)
@@ -641,6 +641,7 @@ BT_EXPORT_API gboolean bluetooth_rfcomm_is_server_uuid_available(const char *uui
 
 BT_EXPORT_API int bluetooth_rfcomm_server_is_connected(const bluetooth_device_address_t *device_address, gboolean *connected)
 {
+#ifdef RFCOMM_DIRECT
        GSList *l;
        rfcomm_info_t *info;
        char connected_addr[BT_ADDRESS_STRING_SIZE] = { 0 };
@@ -667,6 +668,9 @@ BT_EXPORT_API int bluetooth_rfcomm_server_is_connected(const bluetooth_device_ad
        }
 
        return BLUETOOTH_ERROR_NONE;
+#else
+       return BLUETOOTH_ERROR_NOT_SUPPORT;
+#endif
 }
 
 BT_EXPORT_API int bluetooth_rfcomm_listen_and_accept(int socket_fd, int max_pending_connection)
index adfe68b..65fd86e 100644 (file)
@@ -165,7 +165,11 @@ export CFLAGS="$CFLAGS -fpie"
 export LDFLAGS="$CFLAGS -pie"
 %endif
 
+%if %{bt_hal} == ENABLED
+export CFLAGS="$CFLAGS -URFCOMM_DIRECT"
+%else
 export CFLAGS="$CFLAGS -DRFCOMM_DIRECT"
+%endif
 export LDFLAGS="$CFLAGS -Wl,--rpath=%{_libdir} -Wl,--as-needed -Wl,--unresolved-symbols=ignore-in-shared-libs"
 
 %if "%{?_with_emulator}" == "1"