mirror of
https://github.com/espressif/esp-idf.git
synced 2025-11-27 21:15:37 +00:00
ble_mesh: stack: Move bt_mesh_rand to mesh_common.c
This commit is contained in:
@@ -15,6 +15,8 @@
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "esp_system.h"
|
||||
|
||||
#include "mesh_main.h"
|
||||
#include "client_common.h"
|
||||
#include "mesh_common.h"
|
||||
@@ -96,3 +98,17 @@ uint8_t bt_mesh_get_device_role(struct bt_mesh_model *model, bool srv_send)
|
||||
|
||||
return client->msg_role;
|
||||
}
|
||||
|
||||
int bt_mesh_rand(void *buf, size_t len)
|
||||
{
|
||||
if (buf == NULL || len == 0) {
|
||||
BT_ERR("%s, Invalid parameter", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
esp_fill_random(buf, len);
|
||||
|
||||
BT_DBG("Random %s", bt_hex(buf, len));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user