diff --git a/nimble/host/mesh/src/adv.c b/nimble/host/mesh/src/adv.c index a05333819..8c30f4406 100644 --- a/nimble/host/mesh/src/adv.c +++ b/nimble/host/mesh/src/adv.c @@ -175,13 +175,15 @@ void bt_mesh_adv_update(void) os_eventq_put(&adv_queue, &ev); } -struct os_mbuf *bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit_count, - u8_t xmit_int, s32_t timeout) +struct os_mbuf *bt_mesh_adv_create_from_pool(struct os_mbuf_pool *pool, + enum bt_mesh_adv_type type, + u8_t xmit_count, u8_t xmit_int, + s32_t timeout) { struct os_mbuf *adv_data; struct bt_mesh_adv *adv; - adv_data = os_mbuf_get_pkthdr(&adv_os_mbuf_pool, sizeof(struct bt_mesh_adv)); + adv_data = os_mbuf_get_pkthdr(pool, sizeof(struct bt_mesh_adv)); if (!adv_data) { return NULL; } @@ -197,6 +199,14 @@ struct os_mbuf *bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit_count, return adv_data; } +struct os_mbuf *bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit_count, + u8_t xmit_int, s32_t timeout) +{ + return bt_mesh_adv_create_from_pool(&adv_os_mbuf_pool, + type, xmit_count, + xmit_int, timeout); +} + void bt_mesh_adv_send(struct os_mbuf *buf, bt_mesh_adv_func_t sent) { BT_DBG("buf %p, type 0x%02x len %u: %s", buf, BT_MESH_ADV(buf)->type, buf->om_len, diff --git a/nimble/host/mesh/src/adv.h b/nimble/host/mesh/src/adv.h index 2f9f94b54..31d68296f 100644 --- a/nimble/host/mesh/src/adv.h +++ b/nimble/host/mesh/src/adv.h @@ -37,6 +37,9 @@ struct bt_mesh_adv /* Generic User Data */ u8_t user_data[2]; + /* Address, used e.g. for Friend Queue messages */ + u16_t addr; + /* For transport layer segment sending */ struct { @@ -53,6 +56,11 @@ struct bt_mesh_adv struct os_mbuf * bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit_count, u8_t xmit_int, s32_t timeout); +struct os_mbuf *bt_mesh_adv_create_from_pool(struct os_mbuf_pool *pool, + enum bt_mesh_adv_type type, + u8_t xmit_count, u8_t xmit_int, + s32_t timeout); + void bt_mesh_adv_send(struct os_mbuf *buf, bt_mesh_adv_func_t sent); void bt_mesh_adv_update(void);