You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by cc...@apache.org on 2016/05/17 20:51:29 UTC

[06/50] [abbrv] incubator-mynewt-core git commit: BLE host - only include eddystone if specified.

BLE host - only include eddystone if specified.


Project: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/commit/7ce7eb14
Tree: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/tree/7ce7eb14
Diff: http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/diff/7ce7eb14

Branch: refs/heads/master
Commit: 7ce7eb1438c7a448da4ab799e5f36e65166748fb
Parents: 72007b5
Author: Christopher Collins <cc...@apache.org>
Authored: Mon May 9 17:40:29 2016 -0700
Committer: Christopher Collins <cc...@apache.org>
Committed: Mon May 9 17:40:50 2016 -0700

----------------------------------------------------------------------
 net/nimble/host/include/host/ble_eddystone.h |  2 +-
 net/nimble/host/src/ble_eddystone.c          | 12 +++++++++++-
 net/nimble/include/nimble/nimble_opt.h       |  8 ++++++++
 3 files changed, 20 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7ce7eb14/net/nimble/host/include/host/ble_eddystone.h
----------------------------------------------------------------------
diff --git a/net/nimble/host/include/host/ble_eddystone.h b/net/nimble/host/include/host/ble_eddystone.h
index 89d62c1..d4f97bd 100644
--- a/net/nimble/host/include/host/ble_eddystone.h
+++ b/net/nimble/host/include/host/ble_eddystone.h
@@ -23,7 +23,7 @@
 #include <inttypes.h>
 struct ble_hs_adv_fields;
 
-#define BLE_EDDYSTONE_MAX_UUIDS16       3
+#define BLE_EDDYSTONE_MAX_UUIDS16           3
 #define BLE_EDDYSTONE_URL_MAX_LEN           17
 
 #define BLE_EDDYSTONE_URL_SCHEME_HTTP_WWW   0

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7ce7eb14/net/nimble/host/src/ble_eddystone.c
----------------------------------------------------------------------
diff --git a/net/nimble/host/src/ble_eddystone.c b/net/nimble/host/src/ble_eddystone.c
index 453094a..98ce4ab 100644
--- a/net/nimble/host/src/ble_eddystone.c
+++ b/net/nimble/host/src/ble_eddystone.c
@@ -69,6 +69,8 @@ static int
 ble_eddystone_set_adv_data_gen(struct ble_hs_adv_fields *adv_fields,
                                uint8_t svc_data_len)
 {
+    int rc;
+
     if (adv_fields->num_uuids16 > BLE_EDDYSTONE_MAX_UUIDS16) {
         return BLE_HS_EINVAL;
     }
@@ -115,6 +117,10 @@ ble_eddystone_set_adv_data_gen(struct ble_hs_adv_fields *adv_fields,
 int
 ble_eddystone_set_adv_data_uid(struct ble_hs_adv_fields *adv_fields, void *uid)
 {
+#if !NIMBLE_OPT_EDDYSTONE
+    return BLE_HS_ENOTSUP;
+#endif
+
     void *svc_data;
     int rc;
 
@@ -143,7 +149,7 @@ ble_eddystone_set_adv_data_uid(struct ble_hs_adv_fields *adv_fields, void *uid)
  * @param url_suffix            The suffix of the URL; one of the
  *                                  BLE_EDDYSTONE_URL_SUFFIX values; use
  *                                  BLE_EDDYSTONE_URL_SUFFIX_NONE if the suffix
- *                                  is embeded in the body argument.
+ *                                  is embedded in the body argument.
  *
  * @return                      0 on success; BLE_HS_E... on failure.
  */
@@ -152,6 +158,10 @@ ble_eddystone_set_adv_data_url(struct ble_hs_adv_fields *adv_fields,
                                uint8_t url_scheme, char *url_body,
                                uint8_t url_body_len, uint8_t url_suffix)
 {
+#if !NIMBLE_OPT_EDDYSTONE
+    return BLE_HS_ENOTSUP;
+#endif
+
     uint8_t *svc_data;
     int8_t tx_pwr;
     int url_len;

http://git-wip-us.apache.org/repos/asf/incubator-mynewt-core/blob/7ce7eb14/net/nimble/include/nimble/nimble_opt.h
----------------------------------------------------------------------
diff --git a/net/nimble/include/nimble/nimble_opt.h b/net/nimble/include/nimble/nimble_opt.h
index 1587015..024f289 100644
--- a/net/nimble/include/nimble/nimble_opt.h
+++ b/net/nimble/include/nimble/nimble_opt.h
@@ -188,6 +188,14 @@
 #define NIMBLE_OPT_ATT_SVR_INDICATE             1
 #endif
 
+
+/** HOST: Miscellaneous features. */
+
+#ifndef NIMBLE_OPT_EDDYSTONE
+#define NIMBLE_OPT_EDDYSTONE                    1
+#endif
+
+
 /*** CONTROLLER ***/
 
 /*