summaryrefslogtreecommitdiff
path: root/monitor/l2cap.h
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-05-20 15:51:42 -0700
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2022-05-26 13:57:48 -0700
commit13bdb9f3bee1763143ec5af4db3bb4e213261fe7 (patch)
treed45c551e0d6127908e450d6edd9ad582439ccb9d /monitor/l2cap.h
parent53c28e3d868396fe5676751a44171dd67a7255a0 (diff)
downloadbluez-13bdb9f3bee1763143ec5af4db3bb4e213261fe7.tar.gz
monitor/att: Add decoding support for PAC Sink/Source
This adds decoding support for PAC Sink/Source attributes: < ACL Data TX: Handle 42 flags 0x00 dlen 9 Channel: 64 len 5 sdu 3 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} ATT: Read Request (0x0a) len 2 Handle: 0x0017 Type: Sink PAC (0x2bc9) > ACL Data RX: Handle 42 flags 0x02 dlen 31 Channel: 65 len 27 sdu 25 [PSM 39 mode Enhanced Credit (0x81)] {chan 0} Value: 010600000000100301ff0002020302030305041e00f00000 Number of PAC(s): 1 PAC #0: Codec: LC3 (0x06) Codec Specific Configuration #0: len 0x03 type 0x01 Codec Specific Configuration: ff00 Codec Specific Configuration #1: len 0x02 type 0x02 Codec Specific Configuration: 03 Codec Specific Configuration #2: len 0x02 type 0x03 Codec Specific Configuration: 03 Codec Specific Configuration #3: len 0x05 type 0x04 Codec Specific Configuration: 1e00f000
Diffstat (limited to 'monitor/l2cap.h')
-rw-r--r--monitor/l2cap.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/monitor/l2cap.h b/monitor/l2cap.h
index 1daeb69be..c33d4c57f 100644
--- a/monitor/l2cap.h
+++ b/monitor/l2cap.h
@@ -48,13 +48,21 @@ static inline void l2cap_frame_clone(struct l2cap_frame *frame,
}
}
-static inline void l2cap_frame_pull(struct l2cap_frame *frame,
+static inline void *l2cap_frame_pull(struct l2cap_frame *frame,
const struct l2cap_frame *source, uint16_t len)
{
+ void *data;
+
l2cap_frame_clone(frame, source);
+ if (source->size < len)
+ return NULL;
+
+ data = (void *)frame->data;
frame->data = source->data + len;
frame->size = source->size - len;
+
+ return data;
}
static inline bool l2cap_frame_get_u8(struct l2cap_frame *frame, uint8_t *value)