Skip to content

Conditionally compile mesh files. #989

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <errno.h>
Expand Down Expand Up @@ -1311,3 +1313,5 @@ void bt_mesh_access_init(void)
"Failed to register bt_mesh_access conf");
#endif
}

#endif /* MYNEWT_VAL(BLE_MESH) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -255,3 +257,5 @@ int bt_mesh_scan_disable(void)

return 0;
}

#endif /* MYNEWT_VAL(BLE_MESH) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/adv_legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/aes-ccm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/app_keys.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
* SPDX-License-Identifier: Apache-2.0
*/

#include "nimble/porting/nimble/include/syscfg/syscfg.h"
#if MYNEWT_VAL(BLE_MESH)

#include <string.h>
#include <stdlib.h>
#include "nimble/nimble/host/mesh/include/mesh/mesh.h"
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/beacon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <errno.h>
Expand Down Expand Up @@ -470,3 +472,5 @@ void bt_mesh_beacon_disable(void)
(void)k_work_cancel_delayable(&beacon_timer);
}
}

#endif /* MYNEWT_VAL(BLE_MESH) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/cdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdlib.h>
Expand Down Expand Up @@ -1140,3 +1143,5 @@ void bt_mesh_cdb_init(void)
#endif
}
#endif

#endif /* MYNEWT_VAL(BLE_MESH) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/cfg_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string.h>
Expand Down Expand Up @@ -2643,3 +2645,5 @@ void bt_mesh_model_reset(void)
{
bt_mesh_model_foreach(mod_reset, NULL);
}

#endif /* MYNEWT_VAL(BLE_MESH) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/crypto.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string.h>
Expand Down Expand Up @@ -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) */
2 changes: 2 additions & 0 deletions src/nimble/nimble/host/mesh/src/glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/health_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string.h>
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/health_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string.h>
Expand Down Expand Up @@ -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) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/heartbeat.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
3 changes: 3 additions & 0 deletions src/nimble/nimble/host/mesh/src/light_model.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/mesh.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdbool.h>
Expand Down Expand Up @@ -414,3 +416,5 @@ int bt_mesh_start(void)

return 0;
}

#endif /* MYNEWT_VAL(BLE_MESH) */
3 changes: 3 additions & 0 deletions src/nimble/nimble/host/mesh/src/model_cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/model_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/msg.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string.h>
Expand Down Expand Up @@ -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) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/pb_adv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <stdint.h>
Expand Down Expand Up @@ -916,3 +918,5 @@ const struct prov_bearer pb_adv = {
.send = prov_send_adv,
.clear_tx = prov_clear_tx,
};

#endif /* MYNEWT_VAL(BLE_MESH) */
4 changes: 4 additions & 0 deletions src/nimble/nimble/host/mesh/src/prov.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <errno.h>
Expand Down Expand Up @@ -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) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/prov_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -634,3 +637,5 @@ int bt_mesh_prov_disable(bt_mesh_prov_bearer_t bearers)

return 0;
}

#endif /* MYNEWT_VAL(BLE_MESH) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/provisioner.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/proxy_srv.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -1013,3 +1016,5 @@ int bt_mesh_proxy_init(void)

return 0;
}

#endif /* MYNEWT_VAL(BLE_MESH) */
5 changes: 5 additions & 0 deletions src/nimble/nimble/host/mesh/src/rpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -378,3 +381,5 @@ void bt_mesh_rpl_init(void)
"Failed to register bt_mesh_rpl conf");
#endif
}

#endif /* MYNEWT_VAL(BLE_MESH) */
Loading