Skip to content

Commit 88df48e

Browse files
alxelaxChromeos LUCI
authored andcommitted
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. (cherry picked from commit f9d7385) Original-Signed-off-by: Aleksandr Khromykh <[email protected]> GitOrigin-RevId: f9d7385 Change-Id: If831f5b0b6ad02800b9e09e0961835950328ae0e Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/zephyr/+/5650211 Reviewed-by: Ting Shen <[email protected]> Commit-Queue: Ting Shen <[email protected]> Tested-by: ChromeOS Prod (Robot) <[email protected]> Tested-by: Ting Shen <[email protected]>
1 parent c701da0 commit 88df48e

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
@@ -1152,6 +1152,7 @@ endif # BT_MESH_OP_AGG_CLI
11521152

11531153
config BT_MESH_LARGE_COMP_DATA_SRV
11541154
bool "Support for Large Composition Data Server Model"
1155+
depends on BT_MESH_MODEL_EXTENSIONS
11551156
help
11561157
Enable support for the Large Composition Data Server model.
11571158

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)