summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@codecoup.pl>2015-11-22 21:20:18 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2015-12-01 10:42:26 +0200
commitd7dc361de3e458413d7ca645086b24c7444f3253 (patch)
tree5751aa4d9478e5b6eb66515ddb0c643a408527b9
parent9fecb9e64df8b81445df2cf47e6d50c245964c45 (diff)
downloadbluez-d7dc361de3e458413d7ca645086b24c7444f3253.tar.gz
monitor/avdtp: Decode AVDTP_GET_CONFIGURATION
-rw-r--r--monitor/avdtp.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/monitor/avdtp.c b/monitor/avdtp.c
index 3e7138451..8377afe18 100644
--- a/monitor/avdtp.c
+++ b/monitor/avdtp.c
@@ -335,6 +335,29 @@ static bool avdtp_set_configuration(struct avdtp_frame *avdtp_frame)
return false;
}
+static bool avdtp_get_configuration(struct avdtp_frame *avdtp_frame)
+{
+ struct l2cap_frame *frame = &avdtp_frame->l2cap_frame;
+ uint8_t type = avdtp_frame->hdr & 0x03;
+ uint8_t seid;
+
+ switch (type) {
+ case AVDTP_MSG_TYPE_COMMAND:
+ if (!l2cap_frame_get_u8(frame, &seid))
+ return false;
+
+ print_field("ACP SEID: %d", seid >> 2);
+
+ return true;
+ case AVDTP_MSG_TYPE_RESPONSE_ACCEPT:
+ return decode_capabilities(avdtp_frame);
+ case AVDTP_MSG_TYPE_RESPONSE_REJECT:
+ return avdtp_reject_common(avdtp_frame);
+ }
+
+ return false;
+}
+
static bool avdtp_signalling_packet(struct avdtp_frame *avdtp_frame)
{
struct l2cap_frame *frame = &avdtp_frame->l2cap_frame;
@@ -396,6 +419,8 @@ static bool avdtp_signalling_packet(struct avdtp_frame *avdtp_frame)
return avdtp_get_capabilities(avdtp_frame);
case AVDTP_SET_CONFIGURATION:
return avdtp_set_configuration(avdtp_frame);
+ case AVDTP_GET_CONFIGURATION:
+ return avdtp_get_configuration(avdtp_frame);
}
packet_hexdump(frame->data, frame->size);