Bluetooth: testing: Exclude Mesh related code if BT_MESH not set
This will exclude testing Mesh related code from build if BT_MESH option in Kconfig is not set. Signed-off-by: Mariusz Skamra <mariusz.skamra@codecoup.pl>
This commit is contained in:
parent
0433e1a840
commit
64e608be8b
3 changed files with 12 additions and 1 deletions
|
@ -11,6 +11,10 @@
|
||||||
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_TESTING_H_
|
#ifndef ZEPHYR_INCLUDE_BLUETOOTH_TESTING_H_
|
||||||
#define ZEPHYR_INCLUDE_BLUETOOTH_TESTING_H_
|
#define ZEPHYR_INCLUDE_BLUETOOTH_TESTING_H_
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_MESH)
|
||||||
|
#include <bluetooth/mesh.h>
|
||||||
|
#endif /* CONFIG_BT_MESH */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Bluetooth testing
|
* @brief Bluetooth testing
|
||||||
* @defgroup bt_test_cb Bluetooth testing callbacks
|
* @defgroup bt_test_cb Bluetooth testing callbacks
|
||||||
|
@ -28,6 +32,7 @@ extern "C" {
|
||||||
* Allows access to Bluetooth stack internals, not exposed by public API.
|
* Allows access to Bluetooth stack internals, not exposed by public API.
|
||||||
*/
|
*/
|
||||||
struct bt_test_cb {
|
struct bt_test_cb {
|
||||||
|
#if defined(CONFIG_BT_MESH)
|
||||||
void (*mesh_net_recv)(u8_t ttl, u8_t ctl, u16_t src, u16_t dst,
|
void (*mesh_net_recv)(u8_t ttl, u8_t ctl, u16_t src, u16_t dst,
|
||||||
const void *payload, size_t payload_len);
|
const void *payload, size_t payload_len);
|
||||||
void (*mesh_model_bound)(u16_t addr, struct bt_mesh_model *model,
|
void (*mesh_model_bound)(u16_t addr, struct bt_mesh_model *model,
|
||||||
|
@ -36,6 +41,7 @@ struct bt_test_cb {
|
||||||
u16_t key_idx);
|
u16_t key_idx);
|
||||||
void (*mesh_prov_invalid_bearer)(u8_t opcode);
|
void (*mesh_prov_invalid_bearer)(u8_t opcode);
|
||||||
void (*mesh_trans_incomp_timer_exp)(void);
|
void (*mesh_trans_incomp_timer_exp)(void);
|
||||||
|
#endif /* CONFIG_BT_MESH */
|
||||||
|
|
||||||
sys_snode_t node;
|
sys_snode_t node;
|
||||||
};
|
};
|
||||||
|
|
|
@ -7,12 +7,13 @@
|
||||||
#include <zephyr.h>
|
#include <zephyr.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
#include <bluetooth/mesh.h>
|
|
||||||
#include <bluetooth/testing.h>
|
#include <bluetooth/testing.h>
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_MESH)
|
||||||
#include "mesh/net.h"
|
#include "mesh/net.h"
|
||||||
#include "mesh/lpn.h"
|
#include "mesh/lpn.h"
|
||||||
#include "mesh/transport.h"
|
#include "mesh/transport.h"
|
||||||
|
#endif /* CONFIG_BT_MESH */
|
||||||
|
|
||||||
#include "testing.h"
|
#include "testing.h"
|
||||||
|
|
||||||
|
@ -28,6 +29,7 @@ void bt_test_cb_unregister(struct bt_test_cb *cb)
|
||||||
sys_slist_find_and_remove(&cb_slist, &cb->node);
|
sys_slist_find_and_remove(&cb_slist, &cb->node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_MESH)
|
||||||
void bt_test_mesh_net_recv(u8_t ttl, u8_t ctl, u16_t src, u16_t dst,
|
void bt_test_mesh_net_recv(u8_t ttl, u8_t ctl, u16_t src, u16_t dst,
|
||||||
const void *payload, size_t payload_len)
|
const void *payload, size_t payload_len)
|
||||||
{
|
{
|
||||||
|
@ -107,3 +109,4 @@ int bt_test_mesh_rpl_clear(void)
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif /* CONFIG_BT_MESH */
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
* SPDX-License-Identifier: Apache-2.0
|
* SPDX-License-Identifier: Apache-2.0
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#if defined(CONFIG_BT_MESH)
|
||||||
void bt_test_mesh_net_recv(u8_t ttl, u8_t ctl, u16_t src, u16_t dst,
|
void bt_test_mesh_net_recv(u8_t ttl, u8_t ctl, u16_t src, u16_t dst,
|
||||||
const void *payload, size_t payload_len);
|
const void *payload, size_t payload_len);
|
||||||
void bt_test_mesh_model_bound(u16_t addr, struct bt_mesh_model *model,
|
void bt_test_mesh_model_bound(u16_t addr, struct bt_mesh_model *model,
|
||||||
|
@ -17,3 +18,4 @@ void bt_test_mesh_model_unbound(u16_t addr, struct bt_mesh_model *model,
|
||||||
u16_t key_idx);
|
u16_t key_idx);
|
||||||
void bt_test_mesh_prov_invalid_bearer(u8_t opcode);
|
void bt_test_mesh_prov_invalid_bearer(u8_t opcode);
|
||||||
void bt_test_mesh_trans_incomp_timer_exp(void);
|
void bt_test_mesh_trans_incomp_timer_exp(void);
|
||||||
|
#endif /* CONFIG_BT_MESH */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue