param_node.primary_unicast = 0x0001;
_bt_get_random_bytes(param_node.uuid, 16);
+ /* Update uuid as per RFC 4122, section 4.4 */
+ param_node.uuid[6] &= 0x0f;
+ param_node.uuid[6] |= 4 << 4;
+
+ param_node.uuid[8] &= 0x3f;
+ param_node.uuid[8] |= 0x80;
+
+ if (!_bt_is_uuid_valid(param_node.uuid)) {
+ BT_ERR("uuid not generated properly");
+ return BT_ERROR_OPERATION_FAILED;
+ }
+
BT_INFO("Mesh: Total Models [%d]", num_models);
param_model = (bluetooth_mesh_model_t**)g_malloc0(num_models * sizeof(bluetooth_mesh_model_t*));
param_node.num_elements = g_slist_length(node->elements);
param_node.primary_unicast = 0x0001;
+
_bt_get_random_bytes(param_node.uuid, 16);
+
+ /* Update uuid as per RFC 4122, section 4.4 */
+ param_node.uuid[6] &= 0x0f;
+ param_node.uuid[6] |= 4 << 4;
+
+ param_node.uuid[8] &= 0x3f;
+ param_node.uuid[8] |= 0x80;
+
+ if (!_bt_is_uuid_valid(param_node.uuid)) {
+ BT_ERR("uuid not generated properly");
+ return BT_ERROR_OPERATION_FAILED;
+ }
+
__bt_mesh_util_convert_hex_to_string((uint8_t *)param_node.uuid,
16, node->uuid, sizeof(node->uuid));