Bluetooth: Mesh: Extend advertising API with helpers for Friend support
These extensions prepare the way of implementing full Friend support. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
91e75985bd
commit
6047ccd2a1
2 changed files with 20 additions and 3 deletions
|
@ -168,13 +168,15 @@ void bt_mesh_adv_update(void)
|
|||
k_fifo_cancel_wait(&adv_queue);
|
||||
}
|
||||
|
||||
struct net_buf *bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit_count,
|
||||
u8_t xmit_int, s32_t timeout)
|
||||
struct net_buf *bt_mesh_adv_create_from_pool(struct net_buf_pool *pool,
|
||||
enum bt_mesh_adv_type type,
|
||||
u8_t xmit_count, u8_t xmit_int,
|
||||
s32_t timeout)
|
||||
{
|
||||
struct bt_mesh_adv *adv;
|
||||
struct net_buf *buf;
|
||||
|
||||
buf = net_buf_alloc(&adv_buf_pool, timeout);
|
||||
buf = net_buf_alloc(pool, timeout);
|
||||
if (!buf) {
|
||||
return NULL;
|
||||
}
|
||||
|
@ -189,6 +191,13 @@ struct net_buf *bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit_count,
|
|||
return buf;
|
||||
}
|
||||
|
||||
struct net_buf *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_buf_pool, type, xmit_count,
|
||||
xmit_int, timeout);
|
||||
}
|
||||
|
||||
void bt_mesh_adv_send(struct net_buf *buf, bt_mesh_adv_func_t sent)
|
||||
{
|
||||
BT_DBG("type 0x%02x len %u: %s", BT_MESH_ADV(buf)->type, buf->len,
|
||||
|
|
|
@ -29,6 +29,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 {
|
||||
u8_t tx_id;
|
||||
|
@ -43,6 +46,11 @@ struct bt_mesh_adv {
|
|||
struct net_buf *bt_mesh_adv_create(enum bt_mesh_adv_type type, u8_t xmit_count,
|
||||
u8_t xmit_int, s32_t timeout);
|
||||
|
||||
struct net_buf *bt_mesh_adv_create_from_pool(struct net_buf_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 net_buf *buf, bt_mesh_adv_func_t sent);
|
||||
|
||||
void bt_mesh_adv_update(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue