aboutsummaryrefslogtreecommitdiff
path: root/extmod/btstack/btstack.mk
diff options
context:
space:
mode:
authorJim Mussared2020-04-07 15:02:52 +1000
committerDamien George2020-04-29 16:45:46 +1000
commit7563d582100d7947eb61960c9116c8fc10f1e996 (patch)
treef7f3884fa8f98b012c8ffa8814d8ea5c46ae9511 /extmod/btstack/btstack.mk
parentc987adb9e938dbcb1a50e7b0947913c4e37e0943 (diff)
unix: Add support for modbluetooth and BLE using btstack.
This commit adds full support to the unix port for Bluetooth using the common extmod/modbluetooth Python bindings. This uses the libusb HCI transport, which supports many common USB BT adaptors.
Diffstat (limited to 'extmod/btstack/btstack.mk')
-rw-r--r--extmod/btstack/btstack.mk14
1 files changed, 12 insertions, 2 deletions
diff --git a/extmod/btstack/btstack.mk b/extmod/btstack/btstack.mk
index ecb1c84bd..6c883578e 100644
--- a/extmod/btstack/btstack.mk
+++ b/extmod/btstack/btstack.mk
@@ -2,6 +2,8 @@
ifeq ($(MICROPY_BLUETOOTH_BTSTACK),1)
+MICROPY_BLUETOOTH_BTSTACK_USB ?= 0
+
BTSTACK_EXTMOD_DIR = extmod/btstack
EXTMOD_SRC_C += extmod/btstack/modbluetooth_btstack.c
@@ -24,9 +26,17 @@ INC += -I$(BTSTACK_DIR)/3rd-party/yxml
SRC_BTSTACK = \
$(addprefix lib/btstack/src/, $(SRC_FILES)) \
$(addprefix lib/btstack/src/ble/, $(filter-out %_tlv.c, $(SRC_BLE_FILES))) \
- lib/btstack/platform/embedded/btstack_run_loop_embedded.c \
+ lib/btstack/platform/embedded/btstack_run_loop_embedded.c
+
+ifeq ($(MICROPY_BLUETOOTH_BTSTACK_USB),1)
+SRC_BTSTACK += \
+ lib/btstack/platform/libusb/hci_transport_h2_libusb.c
+
+CFLAGS += $(shell pkg-config libusb-1.0 --cflags)
+LDFLAGS += $(shell pkg-config libusb-1.0 --libs)
+endif
-ifeq ($MICROPY_BLUETOOTH_BTSTACK_ENABLE_CLASSIC,1)
+ifeq ($(MICROPY_BLUETOOTH_BTSTACK_ENABLE_CLASSIC),1)
include $(BTSTACK_DIR)/src/classic/Makefile.inc
SRC_BTSTACK += \
$(addprefix lib/btstack/src/classic/, $(SRC_CLASSIC_FILES))