From 6ea34f955e8704696072e4ce9eaaa7d357330d7e Mon Sep 17 00:00:00 2001 From: Kristian Lauszus Date: Fri, 13 Dec 2013 11:18:30 +0100 Subject: [PATCH] Fixed flag macros Needed if you want to clear multiple flags at once --- BTD.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/BTD.h b/BTD.h index ca1e903e..cc328deb 100755 --- a/BTD.h +++ b/BTD.h @@ -71,9 +71,9 @@ #define HCI_FLAG_CONNECT_EVENT 0x100 /* Macros for HCI event flag tests */ -#define hci_check_flag(flag) (hci_event_flag & flag) -#define hci_set_flag(flag) (hci_event_flag |= flag) -#define hci_clear_flag(flag) (hci_event_flag &= ~flag) +#define hci_check_flag(flag) (hci_event_flag & (flag)) +#define hci_set_flag(flag) (hci_event_flag |= (flag)) +#define hci_clear_flag(flag) (hci_event_flag &= ~(flag)) /* HCI Events managed */ #define EV_INQUIRY_COMPLETE 0x01 @@ -157,9 +157,9 @@ #define L2CAP_FLAG_DISCONNECT_RESPONSE 0x00004000 /* Macros for L2CAP event flag tests */ -#define l2cap_check_flag(flag) (l2cap_event_flag & flag) -#define l2cap_set_flag(flag) (l2cap_event_flag |= flag) -#define l2cap_clear_flag(flag) (l2cap_event_flag &= ~flag) +#define l2cap_check_flag(flag) (l2cap_event_flag & (flag)) +#define l2cap_set_flag(flag) (l2cap_event_flag |= (flag)) +#define l2cap_clear_flag(flag) (l2cap_event_flag &= ~(flag)) /* L2CAP signaling commands */ #define L2CAP_CMD_COMMAND_REJECT 0x01