Setting "struct bt_mesh_msg_ctx *ctx" for multiple addresses to send same data

Hello,

In BLE-Mesh models, we have APIs like:

int bt_mesh_model_send(struct bt_mesh_model *model, struct bt_mesh_msg_ctx *ctx,
		       struct net_buf_simple *msg,
		       const struct bt_mesh_send_cb *cb, void *cb_data)

To send data to other devices on the Mesh.

Here I observed that the context "struct bt_mesh_msg_ctx *ctx" stores the address to which the data is to be sent, like address 0x0002.

My requirement is, I want to send the same data to multiple addresses. Like 0x0002, 0x0003 etc,.

Is there any provision in context to store multiple addresses or I shall have to run "int bt_mesh_model_send()" in a for loop for all the addresses..?

Or is there a separate API to send same data to a list of addresses..?

Parents
  • Hi,

    There is no API to send the same message contents to multiple addresses, no.

    The mechanism in Bluetooth mesh for sending to multiple recipients is the use of group addresses. The models on the nodes can be configured to subscribe to multiple group addresses, and then each group address is used to reach all models subscribed to that particular group address. That way, one call to bt_mesh_model_send() is received and handled by multiple nodes, if the destination address is a group address. This is the preferred way to send to multiple nodes on a Bluetooth mesh network, as it minimizes the amount of network traffic.

    If you cannot solve this through using group addressing, then you must send individual messages to each recipient, yes.

    Regards,
    Terje

Reply
  • Hi,

    There is no API to send the same message contents to multiple addresses, no.

    The mechanism in Bluetooth mesh for sending to multiple recipients is the use of group addresses. The models on the nodes can be configured to subscribe to multiple group addresses, and then each group address is used to reach all models subscribed to that particular group address. That way, one call to bt_mesh_model_send() is received and handled by multiple nodes, if the destination address is a group address. This is the preferred way to send to multiple nodes on a Bluetooth mesh network, as it minimizes the amount of network traffic.

    If you cannot solve this through using group addressing, then you must send individual messages to each recipient, yes.

    Regards,
    Terje

Children
Related