Skip to content

Commit

Permalink
Bluetooth: peripheral: Fix check of BT_GATT_WRITE_FLAG_CMD
Browse files Browse the repository at this point in the history
Check should be done with & instead of | otherwise it will always be
evaluated as 1/true regardless of the flags.

Fixes #12308

Signed-off-by: Luiz Augusto von Dentz <[email protected]>
  • Loading branch information
Vudentz authored and jhedberg committed Jan 4, 2019
1 parent dc4151f commit 330cbfa
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion samples/bluetooth/peripheral/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ static ssize_t write_without_rsp_vnd(struct bt_conn *conn,
/* Write request received. Reject it since this char only accepts
* Write Commands.
*/
if (!(flags | BT_GATT_WRITE_FLAG_CMD)) {
if (!(flags & BT_GATT_WRITE_FLAG_CMD)) {
return BT_GATT_ERR(BT_ATT_ERR_WRITE_REQ_REJECTED);
}

Expand Down

0 comments on commit 330cbfa

Please sign in to comment.