Lines Matching refs:buf
94 struct net_buf_simple *buf) in handle_extended_scan_report() argument
102 status = net_buf_simple_pull_u8(buf); in handle_extended_scan_report()
108 memcpy(dev.uuid, net_buf_simple_pull_mem(buf, 16), 16); in handle_extended_scan_report()
109 if (buf->len >= 2) { in handle_extended_scan_report()
110 dev.oob = net_buf_simple_pull_le16(buf); in handle_extended_scan_report()
114 bt_hex(buf->data, buf->len)); in handle_extended_scan_report()
120 cli->scan_report(cli, &srv, &dev, buf); in handle_extended_scan_report()
127 struct net_buf_simple *buf) in handle_link_report() argument
134 link.status = net_buf_simple_pull_u8(buf); in handle_link_report()
135 link.state = net_buf_simple_pull_u8(buf); in handle_link_report()
136 if (buf->len == 1) { in handle_link_report()
137 reason = net_buf_simple_pull_u8(buf); in handle_link_report()
138 } else if (buf->len) { in handle_link_report()
165 struct net_buf_simple *buf) in handle_link_status() argument
172 link.status = net_buf_simple_pull_u8(buf); in handle_link_status()
173 link.state = net_buf_simple_pull_u8(buf); in handle_link_status()
199 struct net_buf_simple *buf) in handle_pdu_outbound_report() argument
211 num = net_buf_simple_pull_u8(buf); in handle_pdu_outbound_report()
230 struct net_buf_simple *buf) in handle_pdu_report() argument
247 pdu = net_buf_simple_pull_u8(buf); in handle_pdu_report()
253 LOG_DBG("0x%04x: %u (%u bytes)", srv.addr, pdu, buf->len); in handle_pdu_report()
255 bearer.cb->recv(&pb_remote_cli, &cb_ctx, buf); in handle_pdu_report()
261 struct net_buf_simple *buf) in handle_scan_caps_status() argument
273 caps->max_devs = net_buf_simple_pull_u8(buf); in handle_scan_caps_status()
274 caps->active_scan = net_buf_simple_pull_u8(buf); in handle_scan_caps_status()
285 struct net_buf_simple *buf) in handle_scan_report() argument
291 dev.rssi = net_buf_simple_pull_u8(buf); in handle_scan_report()
292 memcpy(dev.uuid, net_buf_simple_pull_mem(buf, 16), 16); in handle_scan_report()
293 dev.oob = net_buf_simple_pull_le16(buf); in handle_scan_report()
294 if (buf->len == 4) { in handle_scan_report()
295 memcpy(&dev.hash, net_buf_simple_pull_mem(buf, 4), 4); in handle_scan_report()
297 } else if (buf->len) { in handle_scan_report()
317 struct net_buf_simple *buf) in handle_scan_status() argument
329 status->status = net_buf_simple_pull_u8(buf); in handle_scan_status()
330 status->scan = net_buf_simple_pull_u8(buf); in handle_scan_status()
331 status->max_devs = net_buf_simple_pull_u8(buf); in handle_scan_status()
332 status->timeout = net_buf_simple_pull_u8(buf); in handle_scan_status()
424 struct net_buf_simple *buf, uint32_t rsp, void *rsp_ctx) in tx_wait() argument
434 err = bt_mesh_model_send(cli->mod, &ctx, buf, NULL, NULL); in tx_wait()
486 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_SCAN_CAPS_GET, 0); in bt_mesh_rpr_scan_caps_get()
487 bt_mesh_model_msg_init(&buf, RPR_OP_SCAN_CAPS_GET); in bt_mesh_rpr_scan_caps_get()
489 return tx_wait(cli, &cli->scan_ack_ctx, srv, &buf, RPR_OP_SCAN_CAPS_STATUS, caps); in bt_mesh_rpr_scan_caps_get()
496 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_SCAN_GET, 0); in bt_mesh_rpr_scan_get()
497 bt_mesh_model_msg_init(&buf, RPR_OP_SCAN_GET); in bt_mesh_rpr_scan_get()
499 return tx_wait(cli, &cli->scan_ack_ctx, srv, &buf, RPR_OP_SCAN_STATUS, status); in bt_mesh_rpr_scan_get()
512 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_SCAN_START, 18); in bt_mesh_rpr_scan_start()
513 bt_mesh_model_msg_init(&buf, RPR_OP_SCAN_START); in bt_mesh_rpr_scan_start()
515 net_buf_simple_add_u8(&buf, max_devs); in bt_mesh_rpr_scan_start()
516 net_buf_simple_add_u8(&buf, timeout); in bt_mesh_rpr_scan_start()
519 net_buf_simple_add_mem(&buf, uuid, 16); in bt_mesh_rpr_scan_start()
522 return tx_wait(cli, &cli->scan_ack_ctx, srv, &buf, RPR_OP_SCAN_STATUS, status); in bt_mesh_rpr_scan_start()
538 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_EXTENDED_SCAN_START, in bt_mesh_rpr_scan_start_ext()
540 bt_mesh_model_msg_init(&buf, RPR_OP_EXTENDED_SCAN_START); in bt_mesh_rpr_scan_start_ext()
542 net_buf_simple_add_u8(&buf, ad_count); in bt_mesh_rpr_scan_start_ext()
543 net_buf_simple_add_mem(&buf, ad_types, ad_count); in bt_mesh_rpr_scan_start_ext()
545 net_buf_simple_add_mem(&buf, uuid, 16); in bt_mesh_rpr_scan_start_ext()
546 net_buf_simple_add_u8(&buf, timeout); in bt_mesh_rpr_scan_start_ext()
549 return bt_mesh_model_send(cli->mod, &ctx, &buf, NULL, NULL); in bt_mesh_rpr_scan_start_ext()
556 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_SCAN_STOP, 0); in bt_mesh_rpr_scan_stop()
557 bt_mesh_model_msg_init(&buf, RPR_OP_SCAN_STOP); in bt_mesh_rpr_scan_stop()
559 return tx_wait(cli, &cli->scan_ack_ctx, srv, &buf, RPR_OP_SCAN_STATUS, status); in bt_mesh_rpr_scan_stop()
566 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_LINK_GET, 0); in bt_mesh_rpr_link_get()
567 bt_mesh_model_msg_init(&buf, RPR_OP_LINK_GET); in bt_mesh_rpr_link_get()
569 return tx_wait(cli, &cli->prov_ack_ctx, srv, &buf, RPR_OP_LINK_STATUS, rsp); in bt_mesh_rpr_link_get()
576 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_LINK_CLOSE, 1); in bt_mesh_rpr_link_close()
577 bt_mesh_model_msg_init(&buf, RPR_OP_LINK_CLOSE); in bt_mesh_rpr_link_close()
578 net_buf_simple_add_u8(&buf, PROV_BEARER_LINK_STATUS_FAIL); in bt_mesh_rpr_link_close()
580 return tx_wait(cli, &cli->prov_ack_ctx, srv, &buf, RPR_OP_LINK_STATUS, rsp); in bt_mesh_rpr_link_close()
589 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_LINK_OPEN, 17); in link_open_prov()
590 bt_mesh_model_msg_init(&buf, RPR_OP_LINK_OPEN); in link_open_prov()
592 net_buf_simple_add_mem(&buf, uuid, 16); in link_open_prov()
595 net_buf_simple_add_u8(&buf, cli->link.time); in link_open_prov()
598 return bt_mesh_model_send(cli->mod, &ctx, &buf, NULL, NULL); in link_open_prov()
607 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_LINK_OPEN, 1); in link_open_node()
608 bt_mesh_model_msg_init(&buf, RPR_OP_LINK_OPEN); in link_open_node()
610 net_buf_simple_add_u8(&buf, type); in link_open_node()
612 return bt_mesh_model_send(cli->mod, &ctx, &buf, NULL, NULL); in link_open_node()
625 BT_MESH_MODEL_BUF_DEFINE(buf, RPR_OP_LINK_CLOSE, 1); in link_close()
626 bt_mesh_model_msg_init(&buf, RPR_OP_LINK_CLOSE); in link_close()
628 net_buf_simple_add_u8(&buf, status); in link_close()
630 err = bt_mesh_model_send(cli->mod, &ctx, &buf, NULL, NULL); in link_close()
639 static int send(struct bt_mesh_rpr_cli *cli, struct net_buf_simple *buf, in send() argument
650 if (net_buf_simple_headroom(buf) < 3) { in send()
663 LOG_DBG("0x%02x", buf->data[0]); in send()
665 net_buf_simple_push_u8(buf, cli->link.tx_pdu); in send()
668 net_buf_simple_push_be16(buf, RPR_OP_PDU_SEND); in send()
670 err = bt_mesh_model_send(cli->mod, &ctx, buf, &pdu_send_cb, cli); in send()
693 static int pb_send(struct net_buf_simple *buf, prov_bearer_send_complete_t cb, in pb_send() argument
697 return send(bearer.cli, buf, cb_data); in pb_send()