diff --git a/include/bluetooth/bluetooth.h b/include/bluetooth/bluetooth.h index f2b0e621c44..ee3fa2fe06d 100644 --- a/include/bluetooth/bluetooth.h +++ b/include/bluetooth/bluetooth.h @@ -421,6 +421,19 @@ int bt_br_set_discoverable(bool enable); */ int bt_br_set_connectable(bool enable); +/** @brief Generate random data. + * + * A random number generation helper which utilizes the Bluetooth + * controller's own RNG. + * + * @param buf Buffer to insert the random data + * @param len Length of random data to generate + * + * @return Zero on success or error code otherwise, positive in case + * of protocol error or negative (POSIX) in case of stack internal error + */ +int bt_rand(void *buf, size_t len); + /** * @} */ diff --git a/net/bluetooth/hci_core.h b/net/bluetooth/hci_core.h index bb4ad9a3f10..b6ae3d15d96 100644 --- a/net/bluetooth/hci_core.h +++ b/net/bluetooth/hci_core.h @@ -178,8 +178,6 @@ const char *bt_addr_str(const bt_addr_t *addr); const char *bt_addr_le_str(const bt_addr_le_t *addr); #endif -int bt_rand(void *buf, size_t len); - int bt_le_scan_update(bool fast_scan); bool bt_addr_le_is_bonded(const bt_addr_le_t *addr); diff --git a/net/bluetooth/hci_ecc.c b/net/bluetooth/hci_ecc.c index 70a1179817a..3a331eb3f88 100644 --- a/net/bluetooth/hci_ecc.c +++ b/net/bluetooth/hci_ecc.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include