Skip to content

Commit eacfed3

Browse files
alxelaxrlubos
authored andcommitted
[nrf fromtree] Bluetooth: Mesh: make corresponding group ID unique
Commit fixes bug when corresponding group ID was never incremented for independent corresponding relationships. Signed-off-by: Aleksandr Khromykh <[email protected]> (cherry picked from commit 69c5c6f) Signed-off-by: alperen sener <[email protected]>
1 parent 06c6605 commit eacfed3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

subsys/bluetooth/mesh/access.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1830,8 +1830,8 @@ int bt_mesh_model_correspond(const struct bt_mesh_model *corresponding_mod,
18301830

18311831
MOD_REL_LIST_FOR_EACH(i) {
18321832
if (mod_rel_list[i].type < RELATION_TYPE_EXT &&
1833-
mod_rel_list[i].type > cor_id) {
1834-
cor_id = mod_rel_list[i].type;
1833+
mod_rel_list[i].type >= cor_id) {
1834+
cor_id = mod_rel_list[i].type + 1;
18351835
}
18361836

18371837
if ((IS_MOD_BASE(base_mod, i, base_offset) ||

tests/bsim/bluetooth/mesh/src/test_cdp1.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static const struct bt_mesh_comp_p1_model_item test_p1_mod2 = {
197197
.cor_present = 1,
198198
.format = 0,
199199
.ext_item_cnt = 1,
200-
.cor_id = 0,
200+
.cor_id = 1,
201201
};
202202

203203
static const struct bt_mesh_comp_p1_model_item test_p1_mod3 = {
@@ -211,7 +211,7 @@ static const struct bt_mesh_comp_p1_model_item test_p1_mod4 = {
211211
.cor_present = 1,
212212
.format = 0,
213213
.ext_item_cnt = 0,
214-
.cor_id = 0,
214+
.cor_id = 1,
215215
};
216216

217217
static const struct bt_mesh_comp_p1_model_item test_p1_mod5 = {

0 commit comments

Comments
 (0)