Bluetooth: Mesh: Make element as rodata
the reason is that the Mesh Profile clearly stipulates that Mesh nodes cannot change their own element definitions. Signed-off-by: Lingao Meng <menglingao@xiaomi.com>
This commit is contained in:
parent
9369c6f8e1
commit
5f1c2f199b
29 changed files with 130 additions and 126 deletions
|
@ -257,7 +257,7 @@ static const struct bt_mesh_model models[] = {
|
|||
NULL),
|
||||
};
|
||||
|
||||
static struct bt_mesh_elem elements[] = {
|
||||
static const struct bt_mesh_elem elements[] = {
|
||||
BT_MESH_ELEM(0, models, BT_MESH_MODEL_NONE),
|
||||
};
|
||||
|
||||
|
|
|
@ -86,7 +86,7 @@ static int vnd_button_pressed(const struct bt_mesh_model *model,
|
|||
{
|
||||
printk("src 0x%04x\n", ctx->addr);
|
||||
|
||||
if (ctx->addr == bt_mesh_model_elem(model)->addr) {
|
||||
if (ctx->addr == bt_mesh_model_elem(model)->rt->addr) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -105,7 +105,7 @@ static const struct bt_mesh_model vnd_models[] = {
|
|||
BT_MESH_MODEL_VND(BT_COMP_ID_LF, MOD_LF, vnd_ops, NULL, NULL),
|
||||
};
|
||||
|
||||
static struct bt_mesh_elem elements[] = {
|
||||
static const struct bt_mesh_elem elements[] = {
|
||||
BT_MESH_ELEM(0, root_models, vnd_models),
|
||||
};
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ static const struct bt_mesh_model root_models[] = {
|
|||
BT_MESH_MODEL_HEALTH_CLI(&health_cli),
|
||||
};
|
||||
|
||||
static struct bt_mesh_elem elements[] = {
|
||||
static const struct bt_mesh_elem elements[] = {
|
||||
BT_MESH_ELEM(0, root_models, BT_MESH_MODEL_NONE),
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue