You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/11/15 12:45:33 UTC

[GitHub] andrzej-kaczmarek closed pull request #241: host/util: doc improvements + typo fixes

andrzej-kaczmarek closed pull request #241: host/util: doc improvements + typo fixes
URL: https://github.com/apache/mynewt-nimble/pull/241
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/nimble/host/util/include/host/util/util.h b/nimble/host/util/include/host/util/util.h
index 7588192b..3f07c005 100644
--- a/nimble/host/util/include/host/util/util.h
+++ b/nimble/host/util/include/host/util/util.h
@@ -24,6 +24,19 @@
 extern "C" {
 #endif
 
+/**
+ * Tries to configure the device with at least one Bluetooth address.
+ * Addresses are restored in a hardware-specific fashion.
+ *
+ * @param prefer_random         Whether to attempt to restore a random address
+ *                                  before checking if a public address has
+ *                                  already been configured.
+ *
+ * @return                      0 on success;
+ *                              BLE_HS_ENOADDR if the device does not have any
+ *                                  available addresses.
+ *                              Other BLE host core code on error.
+ */
 int ble_hs_util_ensure_addr(int prefer_random);
 
 #ifdef __cplusplus
diff --git a/nimble/host/util/src/addr.c b/nimble/host/util/src/addr.c
index e0b7880a..58dcb182 100644
--- a/nimble/host/util/src/addr.c
+++ b/nimble/host/util/src/addr.c
@@ -70,19 +70,6 @@ ble_hs_util_ensure_rand_addr(void)
     return 0;
 }
 
-/**
- * Tries to configure the device with at least one Bluetooth address.
- * Addresses are restored in a hardware-specific fasion.
- *
- * @param prefer_random         Whether to attempt to restore a random address
- *                                  before checking if a public address has
- *                                  already been configured.
- *
- * @return                      0 on success;
- *                              BLE_HS_ENOADDR if the device does not have any
- *                                  available addresses.
- *                              Other BLE host core code on error.
- */
 int
 ble_hs_util_ensure_addr(int prefer_random)
 {
@@ -99,7 +86,7 @@ ble_hs_util_ensure_addr(int prefer_random)
         /* Try to load a public address. */
         rc = ble_hs_id_copy_addr(BLE_ADDR_PUBLIC, NULL, NULL);
         if (rc == BLE_HS_ENOADDR) {
-            /* No random address; try to load a random address. */
+            /* No public address; try to load a random address. */
             rc = ble_hs_util_ensure_rand_addr();
         }
     }


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services