mirror of
https://github.com/espressif/esp-nimble.git
synced 2026-09-28 19:57:23 +00:00
mesh: Extend advertising API with helpers for Friend support
These extensions prepare the way of implementing full Friend support. X-Original-Commit: a811e5d30d1322e32c6387de31991ed363c2f4d2
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user