Lines Matching refs:adv

106 		struct bt_mesh_adv *adv[3];  member
122 struct bt_mesh_adv *adv; member
172 static int send_unacked(struct bt_mesh_adv *adv, prov_bearer_send_complete_t cb, in send_unacked() argument
176 if (link.tx.unacked[i].adv != NULL) { in send_unacked()
180 link.tx.unacked[i].adv = adv; in send_unacked()
189 LOG_WRN("No memory to send unacked PDU: %s", bt_hex(adv->b.data, adv->b.len)); in send_unacked()
206 if (unacked && unacked_adv->adv != NULL) { in delayed_adv_send_end()
211 bt_mesh_adv_unref(unacked_adv->adv); in delayed_adv_send_end()
212 unacked_adv->adv = NULL; in delayed_adv_send_end()
240 if (!unacked->adv) { in tx_work_handler()
245 bt_mesh_adv_send(unacked->adv, &delayed_adv_send_cb, (void *)true); in tx_work_handler()
253 if (link.tx.next >= ARRAY_SIZE(link.tx.adv) || link.tx.adv[link.tx.next] == NULL) { in tx_work_handler()
259 bt_mesh_adv_send(link.tx.adv[link.tx.next], &delayed_adv_send_cb, (void *)false); in tx_work_handler()
263 if (link.tx.next == ARRAY_SIZE(link.tx.adv) || link.tx.adv[link.tx.next] == NULL) { in tx_work_handler()
286 for (i = 0; i < ARRAY_SIZE(link.tx.adv); i++) { in free_segments()
287 struct bt_mesh_adv *adv = link.tx.adv[i]; in free_segments() local
290 if (!adv) { in free_segments()
294 link.tx.adv[i] = NULL; in free_segments()
297 if (adv->ctx.busy == 0U) { in free_segments()
298 err = bt_mesh_adv_terminate(adv); in free_segments()
304 adv->ctx.busy = 0U; in free_segments()
308 bt_mesh_adv_unref(adv); in free_segments()
382 struct bt_mesh_adv *adv; in adv_create() local
384 adv = bt_mesh_adv_create(BT_MESH_ADV_PROV, BT_MESH_ADV_TAG_PROV, in adv_create()
387 if (!adv) { in adv_create()
392 return adv; in adv_create()
450 struct bt_mesh_adv *adv; in gen_prov_ack_send() local
461 adv = adv_create(RETRANSMITS_ACK); in gen_prov_ack_send()
462 if (!adv) { in gen_prov_ack_send()
471 net_buf_simple_add_be32(&adv->b, link.id); in gen_prov_ack_send()
472 net_buf_simple_add_u8(&adv->b, xact_id); in gen_prov_ack_send()
473 net_buf_simple_add_u8(&adv->b, GPC_ACK); in gen_prov_ack_send()
475 err = send_unacked(adv, pending ? NULL : ack_complete, NULL); in gen_prov_ack_send()
485 if (link.tx.adv[0]) { in gen_prov_cont()
558 if (!link.tx.adv[0]) { in gen_prov_ack()
578 if (link.tx.adv[0]) { in gen_prov_start()
745 struct bt_mesh_adv *adv; in ctl_adv_create() local
749 adv = adv_create(retransmits); in ctl_adv_create()
750 if (!adv) { in ctl_adv_create()
754 net_buf_simple_add_be32(&adv->b, link.id); in ctl_adv_create()
756 net_buf_simple_add_u8(&adv->b, 0x00); in ctl_adv_create()
757 net_buf_simple_add_u8(&adv->b, GPC_CTL(op)); in ctl_adv_create()
758 net_buf_simple_add_mem(&adv->b, data, data_len); in ctl_adv_create()
760 return adv; in ctl_adv_create()
763 static int bearer_ctl_send(struct bt_mesh_adv *adv) in bearer_ctl_send() argument
765 if (!adv) { in bearer_ctl_send()
773 link.tx.adv[0] = adv; in bearer_ctl_send()
791 static int bearer_ctl_send_unacked(struct bt_mesh_adv *adv, void *user_data) in bearer_ctl_send_unacked() argument
795 if (!adv) { in bearer_ctl_send_unacked()
802 err = send_unacked(adv, &buf_sent, user_data); in bearer_ctl_send_unacked()
804 bt_mesh_adv_unref(adv); in bearer_ctl_send_unacked()
813 struct bt_mesh_adv *start, *adv; in prov_send_adv() local
832 link.tx.adv[0] = start; in prov_send_adv()
844 adv = start; in prov_send_adv()
846 if (seg_id >= ARRAY_SIZE(link.tx.adv)) { in prov_send_adv()
852 adv = adv_create(RETRANSMITS_RELIABLE); in prov_send_adv()
853 if (!adv) { in prov_send_adv()
858 link.tx.adv[seg_id] = adv; in prov_send_adv()
864 net_buf_simple_add_be32(&adv->b, link.id); in prov_send_adv()
865 net_buf_simple_add_u8(&adv->b, link.tx.id); in prov_send_adv()
866 net_buf_simple_add_u8(&adv->b, GPC_CONT(seg_id)); in prov_send_adv()
867 net_buf_simple_add_mem(&adv->b, msg->data, seg_len); in prov_send_adv()