Skip to content

Commit a5782c6

Browse files
alxelaxanangl
authored andcommitted
[nrf fromtree] Bluetooth: Mesh: add extension config server by lcd server
Commit add extension of configuration server by large composition data server. Mesh Protocol v1.1 specification 4.4.21.1 The Large Composition Data Server is a main model that extends the Configuration Server model. Signed-off-by: Aleksandr Khromykh <[email protected]> (cherry picked from commit f9d7385)
1 parent ef4f383 commit a5782c6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

subsys/bluetooth/mesh/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,6 +1167,7 @@ endif # BT_MESH_OP_AGG_CLI
11671167

11681168
config BT_MESH_LARGE_COMP_DATA_SRV
11691169
bool "Support for Large Composition Data Server Model"
1170+
depends on BT_MESH_MODEL_EXTENSIONS
11701171
help
11711172
Enable support for the Large Composition Data Server model.
11721173

subsys/bluetooth/mesh/large_comp_data_srv.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,11 @@ const struct bt_mesh_model_op _bt_mesh_large_comp_data_srv_op[] = {
170170

171171
static int large_comp_data_srv_init(const struct bt_mesh_model *model)
172172
{
173-
if (!bt_mesh_model_in_primary(model)) {
174-
LOG_ERR("Large Composition Data Server only allowed in primary element");
173+
const struct bt_mesh_model *config_srv =
174+
bt_mesh_model_find(bt_mesh_model_elem(model), BT_MESH_MODEL_ID_CFG_SRV);
175+
176+
if (config_srv == NULL) {
177+
LOG_ERR("Large Composition Data Server cannot extend Configuration server");
175178
return -EINVAL;
176179
}
177180

@@ -181,6 +184,8 @@ static int large_comp_data_srv_init(const struct bt_mesh_model *model)
181184

182185
srv.model = model;
183186

187+
bt_mesh_model_extend(model, config_srv);
188+
184189
return 0;
185190
}
186191

0 commit comments

Comments
 (0)