mirror of
https://git.kernel.org/pub/scm/bluetooth/bluez.git
synced 2025-01-08 20:43:22 +08:00
hcidump: Add parsing for SetAddressedPlayer PDU
This commit is contained in:
parent
1935fd4bc0
commit
09caa6c815
@ -1222,6 +1222,38 @@ static void avrcp_set_absolute_volume_dump(int level, struct frame *frm,
|
||||
printf("Volume: %.2f%% (%d/127)\n", value/1.27, value);
|
||||
}
|
||||
|
||||
static void avrcp_set_addressed_player(int level, struct frame *frm,
|
||||
uint8_t ctype, uint16_t len)
|
||||
{
|
||||
uint16_t id;
|
||||
uint8_t status;
|
||||
|
||||
p_indent(level, frm);
|
||||
|
||||
if (ctype > AVC_CTYPE_GENERAL_INQUIRY)
|
||||
goto response;
|
||||
|
||||
if (len < 2) {
|
||||
printf("PDU Malformed\n");
|
||||
raw_dump(level, frm);
|
||||
return;
|
||||
}
|
||||
|
||||
id = get_u16(frm);
|
||||
printf("PlayerID: 0x%04x (%u)", id, id);
|
||||
return;
|
||||
|
||||
response:
|
||||
if (len < 1) {
|
||||
printf("PDU Malformed\n");
|
||||
raw_dump(level, frm);
|
||||
return;
|
||||
}
|
||||
|
||||
status = get_u8(frm);
|
||||
printf("Status: 0x%02x (%s)\n", status, error2str(status));
|
||||
}
|
||||
|
||||
static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
|
||||
{
|
||||
uint8_t pduid, pt;
|
||||
@ -1291,6 +1323,9 @@ static void avrcp_pdu_dump(int level, struct frame *frm, uint8_t ctype)
|
||||
case AVRCP_SET_ABSOLUTE_VOLUME:
|
||||
avrcp_set_absolute_volume_dump(level + 1, frm, ctype, len);
|
||||
break;
|
||||
case AVRCP_SET_ADDRESSED_PLAYER:
|
||||
avrcp_set_addressed_player(level + 1, frm, ctype, len);
|
||||
break;
|
||||
default:
|
||||
raw_dump(level, frm);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user