[TBT][tizen_3.0_wearable][bluetooth][ACR-854][Add the response needed parameter] 18/102618/2
authorDoHyun Pyun <dh79.pyun@samsung.com>
Tue, 6 Dec 2016 04:38:29 +0000 (13:38 +0900)
committerjihun park <jihun87.park@samsung.com>
Fri, 9 Dec 2016 03:54:12 +0000 (12:54 +0900)
Change-Id: I30cff039f66338d384621d2fb8ba9e6aba2b6c5b
Signed-off-by: DoHyun Pyun <dh79.pyun@samsung.com>
tbtcoreapp/src/view/tbt-bluetoothle-view.c

index 1b34bfd11741f089a345572b71cc7fd0bc2f37d0..7ec5a32ed16fc6f3a6832b09c08bc43ff7a60b5c 100644 (file)
@@ -155,7 +155,7 @@ static void _disconnect_button_pressed_cb(void *user_data, Evas_Object *obj, voi
 static void bluetooth_le_advertise(void* user_data);
 static void _bt_gatt_server_read_value_requested_cb(const char *remote_address, int request_id, bt_gatt_server_h server, bt_gatt_h gatt_handle, int offset, void *user_data);
 static void _bt_gatt_server_characteristic_notification_state_changed_cb(bool notify, bt_gatt_server_h server, bt_gatt_h gatt_handle, void *user_data);
-static void _bt_gatt_server_write_value_requested_cb(const char *remote_address, int request_id, bt_gatt_server_h server, bt_gatt_h gatt_handle, int offset, const char *value, int len, void *user_data);
+static void _bt_gatt_server_write_value_requested_cb(const char *remote_address, int request_id, bt_gatt_server_h server, bt_gatt_h gatt_handle, bool response_needed, int offset, const char *value, int len, void *user_data);
 static void _bt_adapter_le_advertising_state_changed_cb(int result, bt_advertiser_h advertiser, bt_adapter_le_advertising_state_e adv_state, void *user_data);
 static void services_list_show(bluetoothle_view *this);
 static void on_hardware_back_button_pressed(void *user_data, Evas_Object *obj, void *event_info);
@@ -1920,7 +1920,7 @@ static void _bt_gatt_server_characteristic_notification_state_changed_cb(bool no
        DBG("_bt_gatt_server_characteristic_notification_state_changed_cb");
 }
 
-static void _bt_gatt_server_write_value_requested_cb(const char *remote_address, int request_id, bt_gatt_server_h server, bt_gatt_h gatt_handle, int offset, const char *value, int len, void *user_data)
+static void _bt_gatt_server_write_value_requested_cb(const char *remote_address, int request_id, bt_gatt_server_h server, bt_gatt_h gatt_handle, bool response_needed, int offset, const char *value, int len, void *user_data)
 {
        DBG("_bt_gatt_server_write_value_requested_cb");
        RETM_IF(NULL == user_data, "data is NULL");
@@ -1963,9 +1963,10 @@ static void _bt_gatt_server_write_value_requested_cb(const char *remote_address,
        elm_list_item_append(this->bluetoothle_list, str, NULL, NULL, NULL, NULL);
        SAFE_DELETE(str);
 
-       bt_gatt_server_send_response(request_id,
-                       BT_GATT_REQUEST_TYPE_WRITE, offset,
-               resp_status, NULL, 0);
+       if (response_needed == true)
+               bt_gatt_server_send_response(request_id,
+                               BT_GATT_REQUEST_TYPE_WRITE, offset,
+                       resp_status, NULL, 0);
 
        elm_list_go(this->bluetoothle_list);
 }