Skip to content

Instantly share code, notes, and snippets.

@mbolivar
Created July 14, 2017 20:01
Show Gist options
  • Save mbolivar/fd226964bdfd85a5efc12315f9eab159 to your computer and use it in GitHub Desktop.
Save mbolivar/fd226964bdfd85a5efc12315f9eab159 to your computer and use it in GitHub Desktop.
diff --git a/samples/bluetooth/hci_spi/src/Makefile b/samples/bluetooth/hci_spi/src/Makefile
index b9d082f6d..a76574cf6 100644
--- a/samples/bluetooth/hci_spi/src/Makefile
+++ b/samples/bluetooth/hci_spi/src/Makefile
@@ -1,4 +1,4 @@
# For includes from subsys/bluetooth/common
-ccflags-y += -I$(ZEPHYR_BASE)/subsys/bluetooth
+ccflags-y += -I$(ZEPHYR_BASE)/subsys
obj-y += main.o
diff --git a/samples/bluetooth/hci_spi/src/main.c b/samples/bluetooth/hci_spi/src/main.c
index c402f5366..4f80d8940 100644
--- a/samples/bluetooth/hci_spi/src/main.c
+++ b/samples/bluetooth/hci_spi/src/main.c
@@ -24,8 +24,7 @@
#include <bluetooth/hci.h>
#include <bluetooth/buf.h>
#include <bluetooth/hci_raw.h>
-
-#include "common/log.h"
+#include <bluetooth/common/log.h>
#define HCI_CMD 0x01
#define HCI_ACL 0x02
@@ -60,13 +59,7 @@ static u8_t txmsg[SPI_MAX_MSG_LEN];
NET_BUF_POOL_DEFINE(cmd_tx_pool, CONFIG_BLUETOOTH_HCI_CMD_COUNT, CMD_BUF_SIZE,
BT_BUF_USER_DATA_MIN, NULL);
-#if defined(CONFIG_BLUETOOTH_CONTROLLER)
-#define BT_L2CAP_MTU (CONFIG_BLUETOOTH_CONTROLLER_TX_BUFFER_SIZE - \
- BT_L2CAP_HDR_SIZE)
-#else
#define BT_L2CAP_MTU 65 /* 64-byte public key + opcode */
-#endif /* CONFIG_BLUETOOTH_CONTROLLER */
-
/* Data size needed for ACL buffers */
#define BT_BUF_ACL_SIZE BT_L2CAP_BUF_SIZE(BT_L2CAP_MTU)
@@ -280,7 +273,8 @@ void main(void)
evt_hdr = net_buf_add(buf, sizeof(*evt_hdr));
evt_hdr->evt = BT_HCI_EVT_VENDOR;
evt_hdr->len = 2;
- net_buf_add_le16(buf, EVT_BLUE_INITIALIZED);
+ u16_t *param = net_buf_add(buf, sizeof(u16_t));
+ *param = sys_cpu_to_le16(EVT_BLUE_INITIALIZED);
}
spi_send(buf);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment