diff --git a/src/nimble/nimble/host/mesh/src/access.c b/src/nimble/nimble/host/mesh/src/access.c index a400c2db..03f45f7b 100644 --- a/src/nimble/nimble/host/mesh/src/access.c +++ b/src/nimble/nimble/host/mesh/src/access.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_ACCESS_LOG #include @@ -1311,3 +1313,5 @@ void bt_mesh_access_init(void) "Failed to register bt_mesh_access conf"); #endif } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/adv.c b/src/nimble/nimble/host/mesh/src/adv.c index 88ea60c7..48fc80d8 100644 --- a/src/nimble/nimble/host/mesh/src/adv.c +++ b/src/nimble/nimble/host/mesh/src/adv.c @@ -8,6 +8,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_ADV_LOG #include "nimble/nimble/host/mesh/include/mesh/mesh.h" @@ -255,3 +257,5 @@ int bt_mesh_scan_disable(void) return 0; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/adv_legacy.c b/src/nimble/nimble/host/mesh/src/adv_legacy.c index 879ac2e0..a0b7787a 100644 --- a/src/nimble/nimble/host/mesh/src/adv_legacy.c +++ b/src/nimble/nimble/host/mesh/src/adv_legacy.c @@ -7,6 +7,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_ADV_LOG #include "adv.h" @@ -250,3 +253,5 @@ int bt_mesh_adv_start(const struct ble_gap_adv_params *param, int32_t duration, return bt_le_adv_start(param, ad, ad_len, sd, sd_len); } #endif + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/aes-ccm.c b/src/nimble/nimble/host/mesh/src/aes-ccm.c index ab23c264..7fed085f 100644 --- a/src/nimble/nimble/host/mesh/src/aes-ccm.c +++ b/src/nimble/nimble/host/mesh/src/aes-ccm.c @@ -5,6 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #include "crypto.h" #define MESH_LOG_MODULE BLE_MESH_LOG @@ -222,3 +225,5 @@ int bt_ccm_encrypt(const uint8_t key[16], uint8_t nonce[13], const uint8_t *msg, return 0; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/app_keys.c b/src/nimble/nimble/host/mesh/src/app_keys.c index 52d14d23..cb41e06f 100644 --- a/src/nimble/nimble/host/mesh/src/app_keys.c +++ b/src/nimble/nimble/host/mesh/src/app_keys.c @@ -5,6 +5,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #include #include #include "nimble/nimble/host/mesh/include/mesh/mesh.h" @@ -715,3 +718,5 @@ void bt_mesh_app_key_init(void) "Failed to register bt_mesh_app_key conf"); #endif } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/beacon.c b/src/nimble/nimble/host/mesh/src/beacon.c index c5bfb680..bfe90f68 100644 --- a/src/nimble/nimble/host/mesh/src/beacon.c +++ b/src/nimble/nimble/host/mesh/src/beacon.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_BEACON_LOG #include @@ -470,3 +472,5 @@ void bt_mesh_beacon_disable(void) (void)k_work_cancel_delayable(&beacon_timer); } } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/cdb.c b/src/nimble/nimble/host/mesh/src/cdb.c index 05ee464b..c7dcaf9b 100644 --- a/src/nimble/nimble/host/mesh/src/cdb.c +++ b/src/nimble/nimble/host/mesh/src/cdb.c @@ -4,6 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_LOG #include "nimble/porting/nimble/include/log/log.h" #include @@ -1140,3 +1143,5 @@ void bt_mesh_cdb_init(void) #endif } #endif + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/cfg.c b/src/nimble/nimble/host/mesh/src/cfg.c index d0140348..7214763d 100644 --- a/src/nimble/nimble/host/mesh/src/cfg.c +++ b/src/nimble/nimble/host/mesh/src/cfg.c @@ -4,6 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #include "nimble/nimble/host/mesh/include/mesh/mesh.h" #include "mesh_priv.h" #include "net.h" @@ -386,3 +389,5 @@ void bt_mesh_cfg_default_set(void) atomic_set_bit(bt_mesh.flags, BT_MESH_FRIEND); } } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/cfg_srv.c b/src/nimble/nimble/host/mesh/src/cfg_srv.c index 4fa936d3..0b6395dc 100644 --- a/src/nimble/nimble/host/mesh/src/cfg_srv.c +++ b/src/nimble/nimble/host/mesh/src/cfg_srv.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_MODEL_LOG #include @@ -2643,3 +2645,5 @@ void bt_mesh_model_reset(void) { bt_mesh_model_foreach(mod_reset, NULL); } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/crypto.c b/src/nimble/nimble/host/mesh/src/crypto.c index e5392287..f3c80cc3 100644 --- a/src/nimble/nimble/host/mesh/src/crypto.c +++ b/src/nimble/nimble/host/mesh/src/crypto.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_CRYPTO_LOG #include @@ -603,3 +605,5 @@ int bt_mesh_beacon_auth(const uint8_t beacon_key[16], uint8_t flags, return err; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/glue.c b/src/nimble/nimble/host/mesh/src/glue.c index ad166568..8caeafeb 100644 --- a/src/nimble/nimble/host/mesh/src/glue.c +++ b/src/nimble/nimble/host/mesh/src/glue.c @@ -18,6 +18,7 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) #define MESH_LOG_MODULE BLE_MESH_LOG #include "nimble/nimble/host/mesh/include/mesh/glue.h" @@ -1037,3 +1038,4 @@ char *settings_str_from_bytes(const void *vp, int vp_len, } #endif /* MYNEWT_VAL(BLE_MESH_SETTINGS) */ +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/health_cli.c b/src/nimble/nimble/host/mesh/src/health_cli.c index 4e5f49a7..52735605 100644 --- a/src/nimble/nimble/host/mesh/src/health_cli.c +++ b/src/nimble/nimble/host/mesh/src/health_cli.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_MODEL_LOG #include @@ -523,3 +525,5 @@ static int health_cli_init(struct bt_mesh_model *model) const struct bt_mesh_model_cb bt_mesh_health_cli_cb = { .init = health_cli_init, }; + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/health_srv.c b/src/nimble/nimble/host/mesh/src/health_srv.c index 33f31bed..6939b36a 100644 --- a/src/nimble/nimble/host/mesh/src/health_srv.c +++ b/src/nimble/nimble/host/mesh/src/health_srv.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_MODEL_LOG #include @@ -473,3 +475,5 @@ void bt_mesh_attention(struct bt_mesh_model *model, uint8_t time) } k_work_reschedule(&srv->attn_timer, K_SECONDS(time)); } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/heartbeat.c b/src/nimble/nimble/host/mesh/src/heartbeat.c index 4abb82bc..d617a034 100644 --- a/src/nimble/nimble/host/mesh/src/heartbeat.c +++ b/src/nimble/nimble/host/mesh/src/heartbeat.c @@ -4,6 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_HEARTBEAT_LOG #include "mesh_priv.h" @@ -462,3 +465,5 @@ void bt_mesh_hb_pub_init(void) "Failed to register bt_mesh_hb_pub conf"); #endif } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/light_model.c b/src/nimble/nimble/host/mesh/src/light_model.c index 975262ff..7cb08300 100644 --- a/src/nimble/nimble/host/mesh/src/light_model.c +++ b/src/nimble/nimble/host/mesh/src/light_model.c @@ -5,6 +5,7 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) #include "nimble/nimble/host/mesh/include/mesh/mesh.h" #include "nimble/console/console.h" @@ -60,3 +61,5 @@ int light_model_light_lightness_set(struct bt_mesh_model *model, int16_t lightne { return light_model_gen_level_set(model, lightness); } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/mesh.c b/src/nimble/nimble/host/mesh/src/mesh.c index 8208fe4c..8257805a 100644 --- a/src/nimble/nimble/host/mesh/src/mesh.c +++ b/src/nimble/nimble/host/mesh/src/mesh.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_LOG #include @@ -414,3 +416,5 @@ int bt_mesh_start(void) return 0; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/model_cli.c b/src/nimble/nimble/host/mesh/src/model_cli.c index ef8b0cec..e3fcd4f7 100644 --- a/src/nimble/nimble/host/mesh/src/model_cli.c +++ b/src/nimble/nimble/host/mesh/src/model_cli.c @@ -5,6 +5,7 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) #define MESH_LOG_MODULE BLE_MESH_MODEL_LOG #include "nimble/nimble/host/mesh/include/mesh/mesh.h" @@ -302,3 +303,5 @@ int bt_mesh_gen_level_set(uint16_t net_idx, uint16_t addr, uint16_t app_idx, os_mbuf_free_chain(msg); return err; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/model_srv.c b/src/nimble/nimble/host/mesh/src/model_srv.c index 1666cad6..b994fd78 100644 --- a/src/nimble/nimble/host/mesh/src/model_srv.c +++ b/src/nimble/nimble/host/mesh/src/model_srv.c @@ -5,6 +5,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_MODEL_LOG #include "nimble/nimble/host/mesh/include/mesh/mesh.h" @@ -280,3 +282,5 @@ static int lightness_srv_init(struct bt_mesh_model *model) const struct bt_mesh_model_cb light_lightness_srv_cb = { .init = lightness_srv_init, }; + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/msg.c b/src/nimble/nimble/host/mesh/src/msg.c index 7c6270ff..05aad15c 100644 --- a/src/nimble/nimble/host/mesh/src/msg.c +++ b/src/nimble/nimble/host/mesh/src/msg.c @@ -6,6 +6,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #include "nimble/nimble/host/mesh/include/mesh/mesh.h" void bt_mesh_model_msg_init(struct os_mbuf *msg, uint32_t opcode) @@ -82,3 +85,5 @@ bool bt_mesh_msg_ack_ctx_match(const struct bt_mesh_msg_ack_ctx *ack, return true; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/net.c b/src/nimble/nimble/host/mesh/src/net.c index 3f780435..bd83cf03 100644 --- a/src/nimble/nimble/host/mesh/src/net.c +++ b/src/nimble/nimble/host/mesh/src/net.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_NET_LOG #include @@ -1221,3 +1223,5 @@ void bt_mesh_net_settings_commit(void) k_work_reschedule(&bt_mesh.ivu_timer, BT_MESH_IVU_TIMEOUT); } } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/pb_adv.c b/src/nimble/nimble/host/mesh/src/pb_adv.c index be8977fa..12cd871d 100644 --- a/src/nimble/nimble/host/mesh/src/pb_adv.c +++ b/src/nimble/nimble/host/mesh/src/pb_adv.c @@ -8,6 +8,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_PROV_LOG #include @@ -916,3 +918,5 @@ const struct prov_bearer pb_adv = { .send = prov_send_adv, .clear_tx = prov_clear_tx, }; + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/prov.c b/src/nimble/nimble/host/mesh/src/prov.c index 204c0940..1a1b927f 100644 --- a/src/nimble/nimble/host/mesh/src/prov.c +++ b/src/nimble/nimble/host/mesh/src/prov.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_PROV_LOG #include @@ -457,3 +459,5 @@ int bt_mesh_prov_init(const struct bt_mesh_prov *prov_info) return bt_mesh_prov_reset_state(NULL); } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/prov_device.c b/src/nimble/nimble/host/mesh/src/prov_device.c index 013dade1..af806bc9 100644 --- a/src/nimble/nimble/host/mesh/src/prov_device.c +++ b/src/nimble/nimble/host/mesh/src/prov_device.c @@ -7,6 +7,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_PROV_LOG #include "testing.h" @@ -634,3 +637,5 @@ int bt_mesh_prov_disable(bt_mesh_prov_bearer_t bearers) return 0; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/provisioner.c b/src/nimble/nimble/host/mesh/src/provisioner.c index fcc72864..aeab44ec 100644 --- a/src/nimble/nimble/host/mesh/src/provisioner.c +++ b/src/nimble/nimble/host/mesh/src/provisioner.c @@ -8,6 +8,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_PROV_LOG #include "testing.h" @@ -749,3 +752,5 @@ int bt_mesh_pb_adv_open(const uint8_t uuid[16], uint16_t net_idx, uint16_t addr, return err; } #endif + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/proxy_srv.c b/src/nimble/nimble/host/mesh/src/proxy_srv.c index 76c66edf..e18e4423 100644 --- a/src/nimble/nimble/host/mesh/src/proxy_srv.c +++ b/src/nimble/nimble/host/mesh/src/proxy_srv.c @@ -7,6 +7,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_PROXY_LOG #include "nimble/nimble/host/mesh/include/mesh/slist.h" @@ -1013,3 +1016,5 @@ int bt_mesh_proxy_init(void) return 0; } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/rpl.c b/src/nimble/nimble/host/mesh/src/rpl.c index 2b7c2173..55dca18e 100644 --- a/src/nimble/nimble/host/mesh/src/rpl.c +++ b/src/nimble/nimble/host/mesh/src/rpl.c @@ -7,6 +7,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_RPL_LOG #include "nimble/porting/nimble/include/log/log.h" @@ -378,3 +381,5 @@ void bt_mesh_rpl_init(void) "Failed to register bt_mesh_rpl conf"); #endif } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/subnet.c b/src/nimble/nimble/host/mesh/src/subnet.c index a6b784ac..3c28dc5e 100644 --- a/src/nimble/nimble/host/mesh/src/subnet.c +++ b/src/nimble/nimble/host/mesh/src/subnet.c @@ -6,6 +6,8 @@ */ #include #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_NET_KEYS_LOG #include "nimble/porting/nimble/include/log/log.h" @@ -883,3 +885,5 @@ void bt_mesh_net_key_init(void) "Failed to register bt_mesh_net_key conf"); #endif } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/testing.c b/src/nimble/nimble/host/mesh/src/testing.c index 84690e6a..7ae6e09c 100644 --- a/src/nimble/nimble/host/mesh/src/testing.c +++ b/src/nimble/nimble/host/mesh/src/testing.c @@ -4,6 +4,9 @@ * SPDX-License-Identifier: Apache-2.0 */ +#include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #include #include "nimble/console/console.h" @@ -203,3 +206,5 @@ int bt_test_bind_app_key_to_model(struct bt_mesh_model *model, uint16_t key_idx, return mod_bind(found_model, key_idx); } + +#endif /* MYNEWT_VAL(BLE_MESH) */ diff --git a/src/nimble/nimble/host/mesh/src/transport.c b/src/nimble/nimble/host/mesh/src/transport.c index e6fe02a0..fe626fd4 100644 --- a/src/nimble/nimble/host/mesh/src/transport.c +++ b/src/nimble/nimble/host/mesh/src/transport.c @@ -7,6 +7,8 @@ */ #include "nimble/porting/nimble/include/syscfg/syscfg.h" +#if MYNEWT_VAL(BLE_MESH) + #define MESH_LOG_MODULE BLE_MESH_TRANS_LOG #include @@ -1931,3 +1933,5 @@ void bt_mesh_va_pending_store(void) /* Do nothing. */ } #endif /* CONFIG_BT_MESH_LABEL_COUNT > 0 */ + +#endif /* MYNEWT_VAL(BLE_MESH) */