Lines Matching refs:avrcp
43 void (*func)(struct bt_avrcp *avrcp, struct net_buf *buf, bt_avctp_cr_t cr);
205 struct bt_avrcp *avrcp; in get_new_connection() local
212 avrcp = &avrcp_connection[bt_conn_index(conn)]; in get_new_connection()
213 memset(avrcp, 0, sizeof(struct bt_avrcp)); in get_new_connection()
214 return avrcp; in get_new_connection()
219 struct bt_avrcp *avrcp = AVRCP_KWORK(work); in avrcp_timeout() local
221 LOG_WRN("Timeout: tid 0x%X, opc 0x%02X", avrcp->req.tid, avrcp->req.opcode); in avrcp_timeout()
227 struct bt_avrcp *avrcp = AVRCP_AVCTP(session); in avrcp_connected() local
230 avrcp_cb->connected(avrcp); in avrcp_connected()
233 k_work_init_delayable(&avrcp->timeout_work, avrcp_timeout); in avrcp_connected()
239 struct bt_avrcp *avrcp = AVRCP_AVCTP(session); in avrcp_disconnected() local
242 avrcp_cb->disconnected(avrcp); in avrcp_disconnected()
246 static void avrcp_vendor_dependent_handler(struct bt_avrcp *avrcp, struct net_buf *buf, in avrcp_vendor_dependent_handler() argument
252 static void avrcp_unit_info_handler(struct bt_avrcp *avrcp, struct net_buf *buf, bt_avctp_cr_t cr) in avrcp_unit_info_handler() argument
269 avrcp_cb->unit_info_rsp(avrcp, &rsp); in avrcp_unit_info_handler()
274 static void avrcp_subunit_info_handler(struct bt_avrcp *avrcp, struct net_buf *buf, in avrcp_subunit_info_handler() argument
300 avrcp_cb->subunit_info_rsp(avrcp, &rsp); in avrcp_subunit_info_handler()
305 static void avrcp_pass_through_handler(struct bt_avrcp *avrcp, struct net_buf *buf, in avrcp_pass_through_handler() argument
321 struct bt_avrcp *avrcp = AVRCP_AVCTP(session); in avrcp_recv() local
356 } else if (tid != avrcp->req.tid || subunit_type != avrcp->req.subunit || in avrcp_recv()
357 avrcp_hdr->opcode != avrcp->req.opcode) { in avrcp_recv()
360 avrcp->req.tid, avrcp->req.subunit, avrcp->req.opcode); in avrcp_recv()
362 k_work_cancel_delayable(&avrcp->timeout_work); in avrcp_recv()
368 handler[i].func(avrcp, buf, cr); in avrcp_recv()
384 struct bt_avrcp *avrcp; in avrcp_accept() local
386 avrcp = get_new_connection(conn); in avrcp_accept()
387 if (!avrcp) { in avrcp_accept()
391 *session = &(avrcp->session); in avrcp_accept()
392 avrcp->session.ops = &avctp_ops; in avrcp_accept()
394 LOG_DBG("session: %p", &(avrcp->session)); in avrcp_accept()
428 struct bt_avrcp *avrcp; in bt_avrcp_connect() local
431 avrcp = get_new_connection(conn); in bt_avrcp_connect()
432 if (!avrcp) { in bt_avrcp_connect()
437 avrcp->session.ops = &avctp_ops; in bt_avrcp_connect()
438 err = bt_avctp_connect(conn, &(avrcp->session)); in bt_avrcp_connect()
441 memset(avrcp, 0, sizeof(struct bt_avrcp)); in bt_avrcp_connect()
447 return avrcp; in bt_avrcp_connect()
450 int bt_avrcp_disconnect(struct bt_avrcp *avrcp) in bt_avrcp_disconnect() argument
454 err = bt_avctp_disconnect(&(avrcp->session)); in bt_avrcp_disconnect()
463 static struct net_buf *avrcp_create_pdu(struct bt_avrcp *avrcp, bt_avctp_cr_t cr) in avrcp_create_pdu() argument
467 buf = bt_avctp_create_pdu(&(avrcp->session), cr, BT_AVCTP_PKT_TYPE_SINGLE, in avrcp_create_pdu()
468 BT_AVCTP_IPID_NONE, &avrcp->local_tid, in avrcp_create_pdu()
474 static struct net_buf *avrcp_create_unit_pdu(struct bt_avrcp *avrcp, bt_avctp_cr_t cr) in avrcp_create_unit_pdu() argument
479 buf = avrcp_create_pdu(avrcp, cr); in avrcp_create_unit_pdu()
495 static struct net_buf *avrcp_create_subunit_pdu(struct bt_avrcp *avrcp, bt_avctp_cr_t cr) in avrcp_create_subunit_pdu() argument
500 buf = avrcp_create_pdu(avrcp, cr); in avrcp_create_subunit_pdu()
516 static int avrcp_send(struct bt_avrcp *avrcp, struct net_buf *buf) in avrcp_send() argument
529 err = bt_avctp_send(&(avrcp->session), buf); in avrcp_send()
535 avrcp->req.tid = tid; in avrcp_send()
536 avrcp->req.subunit = subunit_type; in avrcp_send()
537 avrcp->req.opcode = avrcp_hdr->opcode; in avrcp_send()
539 k_work_reschedule(&avrcp->timeout_work, AVRCP_TIMEOUT); in avrcp_send()
545 int bt_avrcp_get_unit_info(struct bt_avrcp *avrcp) in bt_avrcp_get_unit_info() argument
550 buf = avrcp_create_unit_pdu(avrcp, BT_AVCTP_CMD); in bt_avrcp_get_unit_info()
558 return avrcp_send(avrcp, buf); in bt_avrcp_get_unit_info()
561 int bt_avrcp_get_subunit_info(struct bt_avrcp *avrcp) in bt_avrcp_get_subunit_info() argument
566 buf = avrcp_create_subunit_pdu(avrcp, BT_AVCTP_CMD); in bt_avrcp_get_subunit_info()
576 return avrcp_send(avrcp, buf); in bt_avrcp_get_subunit_info()