From bbfd53116f22a1d013dde71d30d34fba33ae718c Mon Sep 17 00:00:00 2001 From: Taejin Woo Date: Thu, 5 Nov 2015 11:48:47 +0900 Subject: [PATCH] Add the description about gatt_connect() Change-Id: Idecfd81d1015ef5e2a96c4847582f41787f813b1 Signed-off-by: Taejin Woo --- .../html/native/network/bluetooth_tutorial_n.htm | 23 +++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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 e6a48a3..d5c6c92 100755 --- a/org.tizen.tutorials/html/native/network/bluetooth_tutorial_n.htm +++ b/org.tizen.tutorials/html/native/network/bluetooth_tutorial_n.htm @@ -36,6 +36,7 @@
  • Bluetooth GATT operations
  • Bluetooth GATT operations +

    Precondition to use the GATT operations

    +

    There is an essential precondition for use GATT APIs. To use those, you need to connect BLE target you want successfully.

    +

    This is the process to connect BLE target below.

    +
    +int ret = BT_ERROR_NONE;
    +ret = bt_adapter_le_start_scan(__bt_adapter_le_scan_result_cb, NULL);
    +/* If you want to know the cb function, you can refer to the list, "Managing Bluetooth LE Scans" */
    +if (ret != BT_ERROR_NONE) {
    +	dlog_print(DLOG_ERROR, LOG_TAG, "[bt_adapter_le_start_scan] Failed.");
    +}
    +/* You should wait while searching LE target you want to connect */
    +ret = bt_adapter_le_stop_scan();
    +/* If you find LE target you want, you should stop finding LE target */
    +ret = bt_gatt_connect(ADDRESS_BLE_DEVICE_YOU_WANT, false);
    +if (ret != BT_ERROR_NONE) {
    +	dlog_print(DLOG_ERROR, LOG_TAG, "Fail to connect LE device.");
    +}
    +
  • +

    Managing the Client Operations

    To perform GATT client operations:

      @@ -2245,4 +2266,4 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga - \ No newline at end of file + -- 2.7.4