---
parser/att.c | 35 +++++++++++++++++++++++++++++++++++
1 files changed, 35 insertions(+), 0 deletions(-)
diff --git a/parser/att.c b/parser/att.c
index a0fb135..134143c 100644
--- a/parser/att.c
+++ b/parser/att.c
@@ -330,6 +330,35 @@ static void att_find_info_resp_dump(int level, struct frame *frm)
}
}
+static void att_find_by_type_req_dump(int level, struct frame *frm)
+{
+ uint16_t start = btohs(htons(get_u16(frm)));
+ uint16_t end = btohs(htons(get_u16(frm)));
+ uint16_t uuid = btohs(htons(get_u16(frm)));
+
+ p_indent(level, frm);
+ printf("start 0x%4.4x, end 0x%4.4x, uuid 0x%4.4x\n", start, end, uuid);
+
+ p_indent(level, frm);
+ printf("value");
+ while (frm->len > 0) {
+ printf(" 0x%2.2x", get_u8(frm));
+ }
+ printf("\n");
+}
+
+static void att_find_by_type_resp_dump(int level, struct frame *frm)
+{
+ while (frm->len > 0) {
+ uint16_t uuid = btohs(htons(get_u16(frm)));
+ uint16_t end = btohs(htons(get_u16(frm)));
+
+ p_indent(level, frm);
+ printf("Found attr 0x%4.4x, group end handle 0x%4.4x\n",
+ uuid, end);
+ }
+}
+
static void att_read_by_type_req_dump(int level, struct frame *frm)
{
uint16_t start = btohs(htons(get_u16(frm)));
@@ -426,6 +455,12 @@ void att_dump(int level, struct frame *frm)
case ATT_OP_FIND_INFO_RESP:
att_find_info_resp_dump(level + 1, frm);
break;
+ case ATT_OP_FIND_BY_TYPE_REQ:
+ att_find_by_type_req_dump(level + 1, frm);
+ break;
+ case ATT_OP_FIND_BY_TYPE_RESP:
+ att_find_by_type_resp_dump(level + 1, frm);
+ break;
case ATT_OP_READ_BY_TYPE_REQ:
att_read_by_type_req_dump(level + 1, frm);
break;
--
1.7.1
Hi Andr?,
On Mon, Mar 21, 2011, Andre Dieb Martins wrote:
> ---
> parser/att.c | 35 +++++++++++++++++++++++++++++++++++
> 1 files changed, 35 insertions(+), 0 deletions(-)
All four patches have been pushed upstream. Thanks.
Johan
---
parser/att.c | 28 ++++++++++++++++++++++++++++
1 files changed, 28 insertions(+), 0 deletions(-)
diff --git a/parser/att.c b/parser/att.c
index 124aaa7..329a0dc 100644
--- a/parser/att.c
+++ b/parser/att.c
@@ -435,6 +435,28 @@ static void att_read_blob_resp_dump(int level, struct frame *frm)
printf("\n");
}
+static void att_read_multi_req_dump(int level, struct frame *frm)
+{
+ p_indent(level, frm);
+ printf("Handles\n");
+
+ while (frm->len > 0) {
+ p_indent(level, frm);
+ printf("handle 0x%4.4x\n", btohs(htons(get_u16(frm))));
+ }
+}
+
+static void att_read_multi_resp_dump(int level, struct frame *frm)
+{
+ p_indent(level, frm);
+ printf("values");
+
+ while (frm->len > 0) {
+ printf(" 0x%2.2x", get_u8(frm));
+ }
+ printf("\n");
+}
+
static void att_read_by_group_resp_dump(int level, struct frame *frm)
{
uint8_t length = get_u8(frm);
@@ -522,6 +544,12 @@ void att_dump(int level, struct frame *frm)
case ATT_OP_READ_BLOB_RESP:
att_read_blob_resp_dump(level + 1, frm);
break;
+ case ATT_OP_READ_MULTI_REQ:
+ att_read_multi_req_dump(level + 1, frm);
+ break;
+ case ATT_OP_READ_MULTI_RESP:
+ att_read_multi_resp_dump(level + 1, frm);
+ break;
case ATT_OP_READ_BY_GROUP_RESP:
att_read_by_group_resp_dump(level + 1, frm);
break;
--
1.7.1
---
parser/att.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/parser/att.c b/parser/att.c
index 134143c..1cba543 100644
--- a/parser/att.c
+++ b/parser/att.c
@@ -415,6 +415,26 @@ static void att_read_req_dump(int level, struct frame *frm)
printf("handle 0x%2.2x\n", handle);
}
+static void att_read_blob_req_dump(int level, struct frame *frm)
+{
+ uint16_t handle = btohs(htons(get_u16(frm)));
+ uint16_t offset = btohs(htons(get_u16(frm)));
+
+ p_indent(level, frm);
+ printf("handle 0x%4.4x offset 0x%4.4x\n", handle, offset);
+}
+
+static void att_read_blob_resp_dump(int level, struct frame *frm)
+{
+ p_indent(level, frm);
+ printf("value");
+
+ while (frm->len > 0) {
+ printf(" 0x%2.2x", get_u8(frm));
+ }
+ printf("\n");
+}
+
static void att_handle_notify_dump(int level, struct frame *frm)
{
uint16_t handle = btohs(htons(get_u16(frm)));
@@ -473,6 +493,12 @@ void att_dump(int level, struct frame *frm)
case ATT_OP_READ_RESP:
raw_dump(level + 1, frm);
break;
+ case ATT_OP_READ_BLOB_REQ:
+ att_read_blob_req_dump(level + 1, frm);
+ break;
+ case ATT_OP_READ_BLOB_RESP:
+ att_read_blob_resp_dump(level + 1, frm);
+ break;
case ATT_OP_HANDLE_NOTIFY:
att_handle_notify_dump(level + 1, frm);
break;
--
1.7.1
Additionally, fix Read By Type printf formatting for handles.
---
parser/att.c | 30 ++++++++++++++++++++++++++++--
1 files changed, 28 insertions(+), 2 deletions(-)
diff --git a/parser/att.c b/parser/att.c
index 1cba543..124aaa7 100644
--- a/parser/att.c
+++ b/parser/att.c
@@ -366,11 +366,11 @@ static void att_read_by_type_req_dump(int level, struct frame *frm)
int i;
p_indent(level, frm);
- printf("start 0x%2.2x, end 0x%2.2x\n", start, end);
+ printf("start 0x%4.4x, end 0x%4.4x\n", start, end);
p_indent(level, frm);
if (frm->len == 2) {
- printf("type-uuid 0x%2.2x\n", btohs(htons(get_u16(frm))));
+ printf("type-uuid 0x%4.4x\n", btohs(htons(get_u16(frm))));
} else if (frm->len == 16) {
printf("type-uuid ");
for (i = 0; i < 16; i++) {
@@ -435,6 +435,28 @@ static void att_read_blob_resp_dump(int level, struct frame *frm)
printf("\n");
}
+static void att_read_by_group_resp_dump(int level, struct frame *frm)
+{
+ uint8_t length = get_u8(frm);
+
+ while (frm->len > 0) {
+ uint16_t attr_handle = btohs(htons(get_u16(frm)));
+ uint16_t end_grp_handle = btohs(htons(get_u16(frm)));
+ uint8_t remaining = length - 4;
+
+ p_indent(level, frm);
+ printf("attr handle 0x%4.4x, end group handle 0x%4.4x\n",
+ attr_handle, end_grp_handle);
+
+ p_indent(level, frm);
+ printf("value");
+ while (remaining > 0) {
+ printf(" 0x%2.2x", get_u8(frm));
+ }
+ printf("\n");
+ }
+}
+
static void att_handle_notify_dump(int level, struct frame *frm)
{
uint16_t handle = btohs(htons(get_u16(frm)));
@@ -482,6 +504,7 @@ void att_dump(int level, struct frame *frm)
att_find_by_type_resp_dump(level + 1, frm);
break;
case ATT_OP_READ_BY_TYPE_REQ:
+ case ATT_OP_READ_BY_GROUP_REQ: /* exact same parsing */
att_read_by_type_req_dump(level + 1, frm);
break;
case ATT_OP_READ_BY_TYPE_RESP:
@@ -499,6 +522,9 @@ void att_dump(int level, struct frame *frm)
case ATT_OP_READ_BLOB_RESP:
att_read_blob_resp_dump(level + 1, frm);
break;
+ case ATT_OP_READ_BY_GROUP_RESP:
+ att_read_by_group_resp_dump(level + 1, frm);
+ break;
case ATT_OP_HANDLE_NOTIFY:
att_handle_notify_dump(level + 1, frm);
break;
--
1.7.1