You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by ja...@apache.org on 2021/11/02 15:22:45 UTC

[mynewt-nimble] branch master updated: nimble/host/include/host/ble_gap: add ble_gap_ext_adv_active()

This is an automated email from the ASF dual-hosted git repository.

janc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git


The following commit(s) were added to refs/heads/master by this push:
     new 9716331  nimble/host/include/host/ble_gap: add ble_gap_ext_adv_active()
9716331 is described below

commit 971633179581faff002d906c7a5d0e168b4236cd
Author: Francisco Molina <fe...@uc.cl>
AuthorDate: Thu Oct 28 15:37:54 2021 +0200

    nimble/host/include/host/ble_gap: add ble_gap_ext_adv_active()
---
 nimble/host/include/host/ble_gap.h | 12 ++++++++++++
 nimble/host/src/ble_gap.c          | 10 ++++++++++
 2 files changed, 22 insertions(+)

diff --git a/nimble/host/include/host/ble_gap.h b/nimble/host/include/host/ble_gap.h
index fa7ee56..af9c978 100644
--- a/nimble/host/include/host/ble_gap.h
+++ b/nimble/host/include/host/ble_gap.h
@@ -1314,6 +1314,18 @@ int ble_gap_ext_adv_remove(uint8_t instance);
  *                      other error code on failure.
  */
 int ble_gap_ext_adv_clear(void);
+
+/**
+ * Indicates whether an advertisement procedure is currently in progress on
+ * the specified Instance
+ *
+ * @param instance            Instance Id
+ *
+ * @return 0 if there is no active advertising procedure for the instance,
+ *         1 otherwise
+ *
+ */
+int ble_gap_ext_adv_active(uint8_t instance);
 #endif
 
 /* Periodic Advertising */
diff --git a/nimble/host/src/ble_gap.c b/nimble/host/src/ble_gap.c
index 3125870..0682914 100644
--- a/nimble/host/src/ble_gap.c
+++ b/nimble/host/src/ble_gap.c
@@ -1303,6 +1303,16 @@ ble_gap_adv_active_instance(uint8_t instance)
 }
 #endif
 
+#if MYNEWT_VAL(BLE_EXT_ADV)
+int ble_gap_ext_adv_active(uint8_t instance)
+{
+    if (instance >= BLE_ADV_INSTANCES) {
+        return 0;
+    }
+    return ble_gap_adv_active_instance(instance);
+}
+#endif
+
 /**
  * Clears advertisement and discovery state.  This function is necessary
  * when the controller loses its active state (e.g. on stack reset).