Skip to contentSkip to conversation

shared/att: Respond to any opcode that is not command

PATCH Superseded Luiz Augusto von Dentz 1 participant 1 message Apr 28, 2017 Bluetooth drivers

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Luiz Augusto von Dentz

author maintainer
#0 lore raw

PATCH 1/1 shared/att: Respond to any opcode that is not command

From: Luiz Augusto von Dentz <[email protected]>

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 | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
src/shared/att.c +3 -3
index 494b10d..2dc9d8b 100644
@@ -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);
Signature · 1 line
2.9.3