From 3b19b53b5d223087353e19a555b6dce531617955 Mon Sep 17 00:00:00 2001 From: Jaehong Jo Date: Wed, 9 Mar 2016 18:02:38 +0900 Subject: [PATCH] Remove unnecessary code And changed Tizen API Change-Id: Iecc07d760926b1ce42554bdf9cb9fcfda38833c3 Signed-off-by: Jaehong Jo Reviewed-on: https://gerrit.iotivity.org/gerrit/5615 Tested-by: jenkins-iotivity Reviewed-by: Jon A. Cruz --- .../src/bt_le_adapter/tizen/calenwmonitor.c | 7 ------- .../src/bt_le_adapter/tizen/caleserver.c | 24 ++++++++++++++-------- .../src/bt_le_adapter/tizen/caleserver.h | 4 ++++ 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/calenwmonitor.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/calenwmonitor.c index ed03e02..6582e21 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/calenwmonitor.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/calenwmonitor.c @@ -170,13 +170,6 @@ CAResult_t CAStartLEAdapter() return CA_STATUS_FAILED; } - ret = bt_adapter_set_visibility(BT_ADAPTER_VISIBILITY_MODE_GENERAL_DISCOVERABLE, 0); - if (0 != ret) - { - OIC_LOG(ERROR, TAG, "bt_adapter_set_visibility failed"); - return CA_STATUS_FAILED; - } - ret = bt_adapter_set_state_changed_cb(CALEAdapterStateChangedCb, NULL); if (BT_ERROR_NONE != ret) { diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.c b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.c index a46a558..f21b637 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.c +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.c @@ -18,10 +18,6 @@ * ******************************************************************/ -#include -#include -#include - #include "caleserver.h" #include "cacommon.h" #include "cacommonutil.h" @@ -211,10 +207,19 @@ CAResult_t CALEStartAdvertise(const char *serviceUUID) return CA_STATUS_FAILED; } - res = bt_adapter_le_start_advertising(g_hAdvertiser, NULL, NULL, NULL); + res = bt_adapter_le_set_advertising_device_name(g_hAdvertiser, + BT_ADAPTER_LE_PACKET_SCAN_RESPONSE, true); + if (BT_ERROR_NONE != res) + { + OIC_LOG_V(ERROR, TAG, "bt_adapter_le_set_advertising_device_name failed with ret[%s]", + CALEGetErrorMsg(res)); + return CA_STATUS_FAILED; + } + + res = bt_adapter_le_start_advertising_new(g_hAdvertiser, NULL, NULL); if (BT_ERROR_NONE != res) { - OIC_LOG_V(ERROR, TAG, "bt_adapter_le_start_advertising failed with ret[%s]", + OIC_LOG_V(ERROR, TAG, "bt_adapter_le_start_advertising_new failed with ret[%s]", CALEGetErrorMsg(res)); return CA_STATUS_FAILED; } @@ -696,7 +701,7 @@ CAResult_t CAAddNewCharacteristicsToGattServer(const bt_gatt_h svcPath, const ch OIC_LOG(DEBUG, TAG, "IN"); int permissions = BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE; - int properties = BT_GATT_PROPERTY_WRITE | BT_GATT_PROPERTY_NOTIFY; + int properties; if(read) { properties = BT_GATT_PROPERTY_NOTIFY | BT_GATT_PROPERTY_READ; @@ -749,8 +754,9 @@ CAResult_t CAAddNewCharacteristicsToGattServer(const bt_gatt_h svcPath, const ch char desc_value[2] = {1, 0}; // Notification enabled. bt_gatt_h descriptor = NULL; permissions = BT_GATT_PERMISSION_READ | BT_GATT_PERMISSION_WRITE; - ret = bt_gatt_descriptor_create(CA_GATT_CONFIGURATION_DESC_UUID, - permissions, desc_value, sizeof(desc_value), &descriptor); + ret = bt_gatt_descriptor_create(CA_GATT_CONFIGURATION_DESC_UUID, permissions, + desc_value, sizeof(desc_value), + &descriptor); if (0 != ret) { OIC_LOG_V(ERROR, TAG, diff --git a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h index 0d934b0..100ea9b 100644 --- a/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h +++ b/resource/csdk/connectivity/src/bt_le_adapter/tizen/caleserver.h @@ -31,6 +31,10 @@ #ifndef TZ_BLE_SERVER_H_ #define TZ_BLE_SERVER_H_ +#include +#include +#include + #include "caadapterinterface.h" #include "logger.h" #include "cathreadpool.h" -- 2.7.4