From 97a34cd44c6e004766725c7245e5cb9e7d1797b3 Mon Sep 17 00:00:00 2001 From: "matthias.ringwald" Date: Tue, 29 Sep 2009 20:13:43 +0000 Subject: [PATCH] moved test macro to utils.h --- include/btstack/hci_cmds.h | 4 ---- include/btstack/utils.h | 3 +++ src/l2cap_signaling.c | 2 -- src/l2cap_signaling.h | 1 + 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/include/btstack/hci_cmds.h b/include/btstack/hci_cmds.h index d0d7da5d5..ac7b94f25 100644 --- a/include/btstack/hci_cmds.h +++ b/include/btstack/hci_cmds.h @@ -7,10 +7,6 @@ #pragma once #include -#include - -// check if command complete event for given command -#define COMMAND_COMPLETE_EVENT(event,cmd) ( event[0] == HCI_EVENT_COMMAND_COMPLETE && READ_BT_16(event,3) == cmd.opcode) // Events from host controller to host #define HCI_EVENT_INQUIRY_COMPLETE 0x01 diff --git a/include/btstack/utils.h b/include/btstack/utils.h index b05696378..7769f8434 100644 --- a/include/btstack/utils.h +++ b/include/btstack/utils.h @@ -36,6 +36,9 @@ typedef uint8_t link_key_t[LINK_KEY_LEN]; #define READ_CMD_OGF(buffer) (buffer[1] >> 2) #define READ_CMD_OCF(buffer) ((buffer[1] & 0x03) << 8 | buffer[0]) +// check if command complete event for given command +#define COMMAND_COMPLETE_EVENT(event,cmd) ( event[0] == HCI_EVENT_COMMAND_COMPLETE && READ_BT_16(event,3) == cmd.opcode) + // ACL Packet #define READ_ACL_CONNECTION_HANDLE( buffer ) ( READ_BT_16(buffer,0) & 0x0fff) #define READ_ACL_FLAGS( buffer ) ( buffer[1] >> 4 ) diff --git a/src/l2cap_signaling.c b/src/l2cap_signaling.c index b6f88ccd1..d737d6a9c 100644 --- a/src/l2cap_signaling.c +++ b/src/l2cap_signaling.c @@ -6,8 +6,6 @@ #include "l2cap_signaling.h" -#include - static char *l2cap_signaling_commands_format[] = { "D", // 0x01 command reject: reason {cmd not understood (0), sig MTU exceeded (2:max sig MTU), invalid CID (4:req CID)}, data len, data "22", // 0x02 connection request: PSM, Source CID diff --git a/src/l2cap_signaling.h b/src/l2cap_signaling.h index e2bf5d663..deeac2648 100644 --- a/src/l2cap_signaling.h +++ b/src/l2cap_signaling.h @@ -7,6 +7,7 @@ #pragma once #include +#include #include #include