summaryrefslogtreecommitdiff
path: root/monitor/avctp.c
diff options
context:
space:
mode:
authorBharat Panda <bharat.panda@samsung.com>2015-04-21 17:35:47 +0530
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-04-23 16:45:02 +0200
commitb311b1fcedb40a0c383965c5bbece281dfe30cc0 (patch)
tree17c31d8977ab1e56cd4e794b8af466f81f9c08e6 /monitor/avctp.c
parent50ed625e24766ff104ce142dd8545105670fac1b (diff)
downloadbluez-b311b1fcedb40a0c383965c5bbece281dfe30cc0.tar.gz
monitor: Add support for AVRCP GeneralReject
Support for AVRCP GeneralReject added to btmon.
Diffstat (limited to 'monitor/avctp.c')
-rw-r--r--monitor/avctp.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/monitor/avctp.c b/monitor/avctp.c
index 3f6934c96..556320c63 100644
--- a/monitor/avctp.c
+++ b/monitor/avctp.c
@@ -2022,6 +2022,30 @@ static bool avrcp_media_element_item(struct avctp_frame *avctp_frame,
return true;
}
+static bool avrcp_general_reject(struct avctp_frame *avctp_frame)
+{
+ struct l2cap_frame *frame = &avctp_frame->l2cap_frame;
+ uint8_t status, indent = 2;
+
+ if (avctp_frame->hdr & 0x02)
+ goto response;
+
+ print_field("%*cPDU Malformed", indent, ' ');
+ packet_hexdump(frame->data, frame->size);
+
+ return true;
+
+response:
+ if (!l2cap_frame_get_u8(frame, &status))
+ return false;
+
+ print_field("%*cStatus: 0x%02x (%s)", indent, ' ',
+ status, error2str(status));
+
+ return true;
+}
+
+
static bool avrcp_search_item(struct avctp_frame *avctp_frame)
{
struct l2cap_frame *frame = &avctp_frame->l2cap_frame;
@@ -2353,6 +2377,9 @@ static bool avrcp_browsing_packet(struct avctp_frame *avctp_frame)
case AVRCP_SEARCH:
avrcp_search_item(avctp_frame);
break;
+ case AVRCP_GENERAL_REJECT:
+ avrcp_general_reject(avctp_frame);
+ break;
default:
packet_hexdump(frame->data, frame->size);
}