diff --git a/nimble/host/mesh/include/mesh/glue.h b/nimble/host/mesh/include/mesh/glue.h index 588e79a48..44631f3e5 100644 --- a/nimble/host/mesh/include/mesh/glue.h +++ b/nimble/host/mesh/include/mesh/glue.h @@ -547,6 +547,7 @@ static inline unsigned int find_msb_set(uint32_t op) #define CONFIG_BT_MESH_RELAY MYNEWT_VAL(BLE_MESH_RELAY) #define CONFIG_BT_MESH_RELAY_RETRANSMIT_COUNT MYNEWT_VAL(BLE_MESH_RELAY_RETRANSMIT_COUNT) #define CONFIG_BT_MESH_GATT_PROXY_ENABLED MYNEWT_VAL(BLE_MESH_GATT_PROXY_ENABLED) +#define CONFIG_BT_MESH_PROXY_MSG_LEN MYNEWT_VAL(BLE_MESH_PROXY_MSG_LEN) #define printk console_printf diff --git a/nimble/host/mesh/src/cfg.c b/nimble/host/mesh/src/cfg.c index 9ed212abc..e866cb791 100644 --- a/nimble/host/mesh/src/cfg.c +++ b/nimble/host/mesh/src/cfg.c @@ -15,8 +15,7 @@ #include "cfg.h" #include "mesh/glue.h" -#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_MESH_DEBUG_CFG) -#define LOG_MODULE_NAME bt_mesh_cfg +#define MESH_LOG_MODULE BLE_MESH_LOG #include "log/log.h" /* Miscellaneous configuration server model states */ diff --git a/nimble/host/mesh/src/proxy_msg.c b/nimble/host/mesh/src/proxy_msg.c index 27d53c484..aa9fd5e81 100644 --- a/nimble/host/mesh/src/proxy_msg.c +++ b/nimble/host/mesh/src/proxy_msg.c @@ -46,17 +46,7 @@ #define PDU_HDR(sar, type) (sar << 6 | (type & BIT_MASK(6))) -#define PB_GATT_BUF_LEN_MAX 66 -#define PROXY_BUF_LEN_MAX 30 - -#if defined(CONFIG_BT_MESH_PB_GATT) -#define PROXY_MSG_BUF_LEN PB_GATT_BUF_LEN_MAX -#else -#define PROXY_MSG_BUF_LEN PROXY_BUF_LEN_MAX -#endif - -static uint8_t bufs[CONFIG_BT_MAX_CONN + - ((CONFIG_BT_MAX_CONN - 1) * PROXY_BUF_LEN_MAX)]; +static uint8_t bufs[CONFIG_BT_MAX_CONN * CONFIG_BT_MESH_PROXY_MSG_LEN]; static struct bt_mesh_proxy_role roles[CONFIG_BT_MAX_CONN]; @@ -186,8 +176,9 @@ static void proxy_msg_init(struct bt_mesh_proxy_role *role) } net_buf_simple_init_with_data(role->buf, - &bufs[role->conn_handle * PROXY_MSG_BUF_LEN], - PROXY_MSG_BUF_LEN); + &bufs[role->conn_handle * + CONFIG_BT_MESH_PROXY_MSG_LEN], + CONFIG_BT_MESH_PROXY_MSG_LEN); net_buf_simple_reset(role->buf); } diff --git a/nimble/host/mesh/syscfg.yml b/nimble/host/mesh/syscfg.yml index 1ada38806..eb79b0494 100644 --- a/nimble/host/mesh/syscfg.yml +++ b/nimble/host/mesh/syscfg.yml @@ -103,6 +103,12 @@ syscfg.defs: BLE_MESH_GATT: value: 1 + BLE_MESH_PROXY_MSG_LEN: + description: > + Integer value + value: + restrictions: BLE_MESH_GATT + BLE_MESH_GATT_SERVER: value: 1 restrictions: BLE_MESH_GATT @@ -970,3 +976,8 @@ syscfg.vals.BLE_MESH_PB_GATT: syscfg.vals.BLE_MESH_PB_ADV: BLE_MESH_PROV: 1 + +syscfg.vals.'BLE_MESH_PB_GATT': + BLE_MESH_PROXY_MSG_LEN: 66 +syscfg.vals.'BLE_MESH_GATT_PROXY': + BLE_MESH_PROXY_MSG_LEN: 33 \ No newline at end of file