From: Taejin Woo Date: Fri, 25 Sep 2015 04:54:50 +0000 (+0900) Subject: Fix the the block mark about if else X-Git-Tag: tizen_3.0/TD_SYNC/20161201~439^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0d30587641ad1cf5bee43e641134fa453b06440e;p=sdk%2Fonline-doc.git Fix the the block mark about if else Change-Id: I101ba0ef07181fb1fc04dfdbf2cded125e414fd7 Signed-off-by: Taejin Woo --- diff --git a/org.tizen.tutorials/html/native/network/bluetooth_tutorial_n.htm b/org.tizen.tutorials/html/native/network/bluetooth_tutorial_n.htm index 7fe7293..9601238 100644 --- a/org.tizen.tutorials/html/native/network/bluetooth_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/network/bluetooth_tutorial_n.htm @@ -973,15 +973,7 @@ __bt_gatt_client_foreach_desc_cb(int total, int index, bt_gatt_h desc_handle, vo         dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_characteristic_get_descriptor is failed : %d", ret);         break;      } -     ret = bt_gatt_client_read_value(desc, -                                      __bt_gatt_client_read_complete_cb, NULL); -  } -  else -  { -     ret = bt_gatt_client_read_value(chr, -                                      __bt_gatt_client_read_complete_cb, NULL); -  } - +  ret = bt_gatt_client_read_value(desc, __bt_gatt_client_read_complete_cb, NULL);   if (ret != BT_ERROR_NONE)   {      dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_read_value is failed : %d", ret); @@ -1020,7 +1012,7 @@ __bt_gatt_client_read_complete_cb(int result, bt_gatt_h gatt_handle, void *data)    bt_gatt_h desc = NULL;    ret = bt_gatt_client_get_service(client, svc_uuid, &svc); -   if (ret != BT_ERROR_NONE) +   if (ret != BT_ERROR_NONE)    {       dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_get_service is failed : %d", ret);    break; @@ -1033,42 +1025,23 @@ __bt_gatt_client_read_complete_cb(int result, bt_gatt_h gatt_handle, void *data)       break;    } -      ret = bt_gatt_characteristic_get_descriptor(chr, desc_uuid, &desc); -      if (ret != BT_ERROR_NONE) -      { -         dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_characteristic_get_descriptor is failed : %d", ret); -         break; -      } - -      ret = __bt_gatt_client_set_value("int32", -                                       "1234", desc); -      if (ret != BT_ERROR_NONE) -      { -         dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_set_value is failed : %d", ret); -         break; -      } - -      ret = bt_gatt_client_write_value(desc, -                                       __bt_gatt_client_write_complete_cb, NULL); -   } -   else +   ret = bt_gatt_characteristic_get_descriptor(chr, desc_uuid, &desc); +   if (ret != BT_ERROR_NONE)    { -      ret = __bt_gatt_client_set_value(desc_uuid, -                                       "int32", chr); -      if (ret != BT_ERROR_NONE) -      { -         dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_set_value is failed : %d", ret); -         break; -      } - -      ret = bt_gatt_client_write_value(chr, -                                       __bt_gatt_client_write_complete_cb, NULL); +      dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_characteristic_get_descriptor is failed : %d", ret); +      break;    } -   if (ret != BT_ERROR_NONE) +   ret = __bt_gatt_client_set_value("int32", +                                       "1234", desc); +   if (ret != BT_ERROR_NONE)    { -      dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_client_write_value is failed : %d", ret); +      dlog_print(DLOG_INFO, LOG_TAG, "bt_gatt_set_value is failed : %d", ret); +      break;    } + +   ret = bt_gatt_client_write_value(desc, __bt_gatt_client_write_complete_cb, NULL); +

After the writing operation is complete, use the bt_gatt_client_write_complete_cb() callback to finish the task: