From: Andre Dieb Martins <andre.dieb@signove.com>
To: linux-bluetooth@vger.kernel.org
Cc: Andre Dieb Martins <andre.dieb@signove.com>
Subject: [PATCH 1/4] Add parsing for ATT Find By Type
Date: Mon, 21 Mar 2011 09:18:31 -0300 [thread overview]
Message-ID: <1300709914-2838-1-git-send-email-andre.dieb@signove.com> (raw)
---
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
next reply other threads:[~2011-03-21 12:18 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-21 12:18 Andre Dieb Martins [this message]
2011-03-21 12:18 ` [PATCH 2/4] Add parsing for ATT Read Blob Andre Dieb Martins
2011-03-21 12:18 ` [PATCH 3/4] Add parsing for ATT Read By Group Andre Dieb Martins
2011-03-21 12:18 ` [PATCH 4/4] Add parsing for Read Multiple Andre Dieb Martins
2011-03-22 10:41 ` [PATCH 1/4] Add parsing for ATT Find By Type Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1300709914-2838-1-git-send-email-andre.dieb@signove.com \
--to=andre.dieb@signove.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox