Hi,
My BLE-Mesh client model sends an opcode to retrieve the server model state,
When server model receives the opcode, relevant handler gets triggered from where I need to acknowledge or send the server state to client.
Below handler I referred from nCS supplied "Chat" sample, wherein Chant presence is being sent.
But this is being sent to a device with an "addr", in my case I do not have an addr, as I am supposed to reply the state to the provisioning device, which is a mobile app.
int bt_mesh_chat_cli_presence_get(struct bt_mesh_chat_cli *chat,
uint16_t addr)
{
struct bt_mesh_msg_ctx ctx = {
.addr = addr,
.app_idx = chat->model->keys[0],
.send_ttl = BT_MESH_TTL_DEFAULT,
.send_rel = true,
};
BT_MESH_MODEL_BUF_DEFINE(buf, BT_MESH_CHAT_CLI_OP_PRESENCE_GET,
BT_MESH_CHAT_CLI_MSG_LEN_PRESENCE_GET);
bt_mesh_model_msg_init(&buf, BT_MESH_CHAT_CLI_OP_PRESENCE_GET);
return bt_mesh_model_send(chat->model, &ctx, &buf, NULL, NULL);
}
Please suggest how I can reply the state to mobile app and which API I can use..?
Thanks,