From 6d854975a9dd6d20826a664d434e53e6a8199f64 Mon Sep 17 00:00:00 2001 From: "jihwan.seo" Date: Thu, 19 Jan 2017 19:22:19 +0900 Subject: [PATCH] update description related start/stop advertisement API. Change-Id: I6ece93384e0204957b3dd406b0796c50544b5220 Signed-off-by: jihwan.seo Reviewed-on: https://gerrit.iotivity.org/gerrit/16583 Tested-by: jenkins-iotivity Reviewed-by: Jaehong Jo Reviewed-by: Dan Mihai Reviewed-by: Ashok Babu Channa --- .../src/main/java/org/iotivity/ca/CaInterface.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/java/iotivity-android/src/main/java/org/iotivity/ca/CaInterface.java b/java/iotivity-android/src/main/java/org/iotivity/ca/CaInterface.java index 9a05ca7..f8f0661 100644 --- a/java/iotivity-android/src/main/java/org/iotivity/ca/CaInterface.java +++ b/java/iotivity-android/src/main/java/org/iotivity/ca/CaInterface.java @@ -220,6 +220,21 @@ public class CaInterface { /** * start BLE Advertising. + * precondition : since android gatt server in IoTivity doesn't start to advertise by default. + * (it can prevent battery consumption issue) + * ble adv flag should be set to enable flag, if you want to use this method. + * we provide BT configure setter API which has ble adv flag like below method + * 'void setBTConfigure(...)' + * it should be set before call init ocstack like PlatformConfig setter. + * + * 1. gatt server stop advertisement after connect with someone by default. + * thur, you should call this method, if you want to connect others continuously. + * + * 2. if you want to start advertisement in initialization step, + * you can call just setBTConfigure API. + * since advertisement will be triggered by the flag, when gatt server is started. + * to conclude, you don't need to call startLeAdvertising API, + * if adv enable flag is set in setBTConfigure API. */ public synchronized static void startLeAdvertising(){ CaInterface.startLeAdvertisingImpl(); @@ -228,6 +243,12 @@ public class CaInterface { /** * stop BLE Advertising. + * it can stop to advertise le for gatt server even though there is no connected endpoint. + * it will help to reduce battery consumption, + * when someone doesn't want to advertise by user scenario. + * + * if you want to stop advertiment in initialize step. + * you can call just setBTConfigure API with adv disable flag. */ public synchronized static void stopLeAdvertising(){ CaInterface.stopLeAdvertisingImpl(); -- 2.7.4