summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-04-28 21:20:51 +0300
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2017-05-02 14:22:37 +0300
commitde01c27a8b508442fdf46ef20a0d299ba3da8312 (patch)
treef744183d16baf6bdb204da8b34187c1ca7a5a5b6
parente60516495a21299abe8335b1e652846ebc302a8a (diff)
downloadbluez-de01c27a8b508442fdf46ef20a0d299ba3da8312.tar.gz
shared/att: Respond to any opcode that is not command
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.
-rw-r--r--src/shared/att.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/att.c b/src/shared/att.c
index 494b10de5..ca2d05143 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);