about nrf mesh:chat example

Hi,

I use 3 devices in the Mesh application. I am looking at the Mesh:chat example. I want this,

I want to press a button on one device and light LED1 on other devices.
I tried to do some things while doing this, but I was not successful.

I set up a button interrupt into the button interrupt,

void button_pressed(const struct device *dev, struct gpio_callback *cb,
uint32_t pins)
{
bt_mesh_chat_cli_private_message_send(chat,0x001A,‘0x4C454459414B0A’);
}

I wrote it down when I took the data,

static void handle_chat_private_message(struct bt_mesh_chat_cli *chat,
struct bt_mesh_msg_msg_ctx *ctx,
const uint8_t *msg)
{
/* Don't print own messages. */
if (address_is_local(chat->model, ctx->addr)) {
return;
}

if (strcmp((const char *)msg, ‘LEDYAK’) == 0) {
gpio_pin_set_dt(&led, 1);
}
shell_print(chat_shell, ‘<0x%04X>: *you* %s’, ctx->addr, msg);
}

I used this code. But I was not successful. Is there a solution?

Parents Reply Children
Related