Skip to content

Commit

Permalink
Bluetooth: Shell: AVRCP: support unit info command receive
Browse files Browse the repository at this point in the history
Add unit_info_cmd_recv callback function in shell to respond to the unit
info command.

Signed-off-by: Make Shi <make.shi@nxp.com>
  • Loading branch information
makeshi committed Feb 18, 2025
1 parent 9892ec6 commit c4c6aa7
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions subsys/bluetooth/host/classic/shell/avrcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,24 @@ static void avrcp_unit_info_rsp(struct bt_avrcp *avrcp, struct bt_avrcp_unit_inf
rsp->unit_type, rsp->company_id);
}

static void avrcp_unit_info_cmd_recv(struct bt_avrcp *avrcp)
{
struct bt_avrcp_unit_info_rsp rsp;
int err;

bt_shell_print("AVRCP target unit info command received");

rsp.unit_type = 0x9;
rsp.company_id = 0x001958; /*BT SIG registered Company ID*/

err = bt_avrcp_response_unit_info(avrcp, &rsp);
if (!err) {
bt_shell_print("AVRCP target response unit info");
} else {
bt_shell_print("failed to response unit info");
}
}

static void avrcp_subunit_info_rsp(struct bt_avrcp *avrcp, struct bt_avrcp_subunit_info_rsp *rsp)
{
int i;
Expand Down Expand Up @@ -80,6 +98,7 @@ static struct bt_avrcp_cb avrcp_cb = {
.unit_info_rsp = avrcp_unit_info_rsp,
.subunit_info_rsp = avrcp_subunit_info_rsp,
.passthrough_rsp = avrcp_passthrough_rsp,
.unit_info_cmd_recv = avrcp_unit_info_cmd_recv,
};

static int register_cb(const struct shell *sh)
Expand Down

0 comments on commit c4c6aa7

Please sign in to comment.