Commit 3e9197a5 authored by Emil Gydesen's avatar Emil Gydesen Committed by Anas Nashif
Browse files

Bluetooth: Mesh: Rename mesh test primitives



Since testing.c/h was moved to mesh, all functions and
structs in those files now follow a bt_mesh_test_*
naming scheme to be consistent with the naming in Zephyr.

Due to missing includes in many files, this commit also
added some that were missing in order to build since
the order of includes have changed.

Signed-off-by: default avatarEmil Gydesen <emil.gydesen@nordicsemi.no>
parent f1b182b5
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1530,8 +1530,7 @@ int bt_mesh_model_recv(struct bt_mesh_msg_ctx *ctx, struct net_buf_simple *buf)
	LOG_DBG("len %u: %s", buf->len, bt_hex(buf->data, buf->len));

	if (IS_ENABLED(CONFIG_BT_TESTING)) {
		bt_test_mesh_model_recv(ctx->addr, ctx->recv_dst, buf->data,
					buf->len);
		bt_mesh_test_model_recv(ctx->addr, ctx->recv_dst, buf->data, buf->len);
	}

	if (get_opcode(buf, &opcode) < 0) {
+6 −0
Original line number Diff line number Diff line
@@ -4,6 +4,12 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#include <stdint.h>

#include <zephyr/bluetooth/bluetooth.h>
#include <zephyr/sys/util_macro.h>
#include <zephyr/sys_clock.h>

#ifndef ZEPHYR_SUBSYS_BLUETOOTH_MESH_ADV_H_
#define ZEPHYR_SUBSYS_BLUETOOTH_MESH_ADV_H_

+2 −2
Original line number Diff line number Diff line
@@ -1889,7 +1889,7 @@ static int mod_app_bind(const struct bt_mesh_model *model,
	status = mod_bind(mod, key_app_idx);

	if (IS_ENABLED(CONFIG_BT_TESTING) && status == STATUS_SUCCESS) {
		bt_test_mesh_model_bound(ctx->addr, mod, key_app_idx);
		bt_mesh_test_model_bound(ctx->addr, mod, key_app_idx);
	}

send_status:
@@ -1946,7 +1946,7 @@ static int mod_app_unbind(const struct bt_mesh_model *model,
	status = mod_unbind(mod, key_app_idx, true);

	if (IS_ENABLED(CONFIG_BT_TESTING) && status == STATUS_SUCCESS) {
		bt_test_mesh_model_unbound(ctx->addr, mod, key_app_idx);
		bt_mesh_test_model_unbound(ctx->addr, mod, key_app_idx);
	}

send_status:
+7 −0
Original line number Diff line number Diff line
@@ -4,9 +4,16 @@
 * SPDX-License-Identifier: Apache-2.0
 */

#include <stdint.h>

#include "adv.h"
#include "subnet.h"
#include <zephyr/bluetooth/mesh/keys.h>
#include <zephyr/bluetooth/mesh/sar_cfg.h>
#include <zephyr/kernel.h>
#include <zephyr/net/buf.h>
#include <zephyr/sys/atomic.h>
#include <zephyr/sys/slist.h>

#define BT_MESH_IV_UPDATE(flags)   ((flags >> 1) & 0x01)
#define BT_MESH_KEY_REFRESH(flags) (flags & 0x01)
+1 −1
Original line number Diff line number Diff line
@@ -683,7 +683,7 @@ static void gen_prov_ctl(struct prov_rx *rx, struct net_buf_simple *buf)
		LOG_ERR("Unknown bearer opcode: 0x%02x", BEARER_CTL(rx->gpc));

		if (IS_ENABLED(CONFIG_BT_TESTING)) {
			bt_test_mesh_prov_invalid_bearer(BEARER_CTL(rx->gpc));
			bt_mesh_test_prov_invalid_bearer(BEARER_CTL(rx->gpc));
		}

		return;
Loading