This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to increase the number of clients per server in the BLE-MESH V2.0 network? es. 1 light bulb operated by 3 buttons.

Hello.
I'm using the example of the light_switch_server project.
I need to configure a server (light bulb) driven by 3 clients (buttons), how can I do?
I tried this way, but I would need a confirmation from you:
the commented part (//) was the original part.

1) I have to increase the number of elements in the m_element_pool []
2) I have to increase the number of models in the m_server []

in the nrf_mesh_config_app.h:
// # define ACCESS_ELEMENT_COUNT (1)
// # define ACCESS_MODEL_COUNT (3)
// # define ACCESS_SUBSCRIPTION_LIST_COUNT (1)

becomes:
#define ACCESS_ELEMENT_COUNT (1 + 2)
#define ACCESS_MODEL_COUNT (3 + 2)
#define ACCESS_SUBSCRIPTION_LIST_COUNT (1 + 2)

in the main.c:
//simple_on_off_server_t m_server;

becomes:
simple_on_off_server_t m_server[ACCESS_ELEMENT_COUNT];

in the models_init_cb()
// __LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Initializing and adding models\n");
// m_server.get_cb = on_off_server_get_cb;
// m_server.set_cb = on_off_server_set_cb;
// ERROR_CHECK(simple_on_off_server_init(&m_server, 0));
// ERROR_CHECK(access_model_subscription_list_alloc(m_server.model_handle));

becomes:
__LOG(LOG_SRC_APP, LOG_LEVEL_INFO, "Initializing and adding models\n");
for (i=0;i< ACCESS_ELEMENT_COUNT;i++)
{
m_server[i].get_cb = on_off_server_get_cb;
m_server[i].set_cb = on_off_server_set_cb;
m_server[i].set_led_cb = set_led_cb;
m_server[i].blink_cb = blink_cb;
m_server[i].get_value_cb = get_value_cb;
m_server[i].set_value_cb = set_value_cb;
ERROR_CHECK(simple_on_off_server_init(&m_server[i], i));
ERROR_CHECK(access_model_subscription_list_alloc(m_server[i].model_handle));
}

so I see the extended structures.
but what should I do now to configure my network of 3 clients and 1 server, with the provisioner device?

What SW changes do I need to make to the provisioner device?


thank you
Marco.

Parents Reply Children
No Data
Related