From: Andre Dieb Martins <andre.dieb@signove.com>
To: linux-bluetooth@vger.kernel.org
Cc: andre.dieb@signove.com
Subject: [PATCH v2 3/6] Add parsing for ATT Signed Write
Date: Wed, 30 Mar 2011 11:01:31 -0300 [thread overview]
Message-ID: <1301493694-10957-3-git-send-email-andre.dieb@signove.com> (raw)
In-Reply-To: <1301493694-10957-1-git-send-email-andre.dieb@signove.com>
---
parser/att.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/parser/att.c b/parser/att.c
index 595c984..5bff925 100644
--- a/parser/att.c
+++ b/parser/att.c
@@ -488,6 +488,25 @@ static void att_write_req_dump(int level, struct frame *frm)
printf("\n");
}
+static void att_signed_write_dump(int level, struct frame *frm)
+{
+ uint16_t handle = btohs(htons(get_u16(frm)));
+ int value_len = frm->len - 12; /* handle:2 already accounted, sig: 12 */
+
+ p_indent(level, frm);
+ printf("handle 0x%4.4x value ", handle);
+
+ while (value_len--)
+ printf(" 0x%2.2x", get_u8(frm));
+ printf("\n");
+
+ p_indent(level, frm);
+ printf("auth signature ");
+ 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)));
@@ -565,6 +584,9 @@ void att_dump(int level, struct frame *frm)
case ATT_OP_WRITE_CMD:
att_write_req_dump(level + 1, frm);
break;
+ case ATT_OP_SIGNED_WRITE_CMD:
+ att_signed_write_dump(level + 1, frm);
+ break;
case ATT_OP_HANDLE_NOTIFY:
att_handle_notify_dump(level + 1, frm);
break;
--
1.7.1
next prev parent reply other threads:[~2011-03-30 14:01 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-30 14:01 [PATCH v2 1/6] Add parsing for ATT Write Request Andre Dieb Martins
2011-03-30 14:01 ` [PATCH v2 2/6] Add parsing for ATT Write Command Andre Dieb Martins
2011-03-30 14:01 ` Andre Dieb Martins [this message]
2011-03-30 14:01 ` [PATCH v2 4/6] Fix handle formatting for ATT Handle Notify Andre Dieb Martins
2011-03-30 14:01 ` [PATCH v2 5/6] Add parsing for ATT Prepare Write Andre Dieb Martins
2011-03-30 14:01 ` [PATCH v2 6/6] Add parsing for ATT Execute Write command Andre Dieb Martins
2011-03-30 16:47 ` [PATCH v2 1/6] Add parsing for ATT Write Request 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=1301493694-10957-3-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