Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v2 1/3] shared/att: Respond to any opcode that is not command
Date: Mon,  1 May 2017 18:56:58 +0300	[thread overview]
Message-ID: <20170501155700.23761-1-luiz.dentz@gmail.com> (raw)

From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>

Although get_op_type does now check for the command mask it must
respond to anything other than ATT_OP_TYPE_CMD since there is no mask
for response opcode.
---
 src/shared/att.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/shared/att.c b/src/shared/att.c
index 494b10d..ca2d051 100644
--- a/src/shared/att.c
+++ b/src/shared/att.c
@@ -149,7 +149,7 @@ static enum att_op_type get_op_type(uint8_t opcode)
 	}
 
 	if (opcode & ATT_OP_CMD_MASK)
-		return ATT_OP_CMD_MASK;
+		return ATT_OP_TYPE_CMD;
 
 	return ATT_OP_TYPE_UNKNOWN;
 }
@@ -841,10 +841,10 @@ static void handle_notify(struct bt_att *att, uint8_t opcode, uint8_t *pdu,
 	}
 
 	/*
-	 * If this was a request and no handler was registered for it, respond
-	 * with "Not Supported"
+	 * If this was not a command and no handler was registered for it,
+	 * respond with "Not Supported"
 	 */
-	if (!found && get_op_type(opcode) == ATT_OP_TYPE_REQ)
+	if (!found && get_op_type(opcode) != ATT_OP_TYPE_CMD)
 		respond_not_supported(att, opcode);
 
 	bt_att_unref(att);
-- 
2.9.3


             reply	other threads:[~2017-05-01 15:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-01 15:56 Luiz Augusto von Dentz [this message]
2017-05-01 15:56 ` [PATCH v2 2/3] unit/test-gatt: Add test for unknown request Luiz Augusto von Dentz
2017-05-01 15:57 ` [PATCH v2 3/3] " Luiz Augusto von Dentz
2017-05-02 11:24 ` [PATCH v2 1/3] shared/att: Respond to any opcode that is not command Luiz Augusto von Dentz

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=20170501155700.23761-1-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.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