1LOCAL_PATH := $(call my-dir)
2
3# HCI static library for target
4# ========================================================
5include $(CLEAR_VARS)
6
7LOCAL_SRC_FILES := \
8    src/btsnoop.c \
9    src/btsnoop_mem.c \
10    src/btsnoop_net.c \
11    src/buffer_allocator.c \
12    src/hci_audio.c \
13    src/hci_hal.c \
14    src/hci_hal_h4.c \
15    src/hci_hal_mct.c \
16    src/hci_inject.c \
17    src/hci_layer.c \
18    src/hci_packet_factory.c \
19    src/hci_packet_parser.c \
20    src/low_power_manager.c \
21    src/packet_fragmenter.c \
22    src/vendor.c
23
24LOCAL_C_INCLUDES += \
25    $(LOCAL_PATH)/include \
26    $(LOCAL_PATH)/.. \
27    $(LOCAL_PATH)/../include \
28    $(LOCAL_PATH)/../btcore/include \
29    $(LOCAL_PATH)/../stack/include \
30    $(LOCAL_PATH)/../utils/include \
31    $(LOCAL_PATH)/../bta/include \
32    $(bluetooth_C_INCLUDES)
33
34LOCAL_MODULE := libbt-hci
35
36ifeq ($(BLUETOOTH_HCI_USE_MCT),true)
37LOCAL_CFLAGS += -DHCI_USE_MCT
38endif
39LOCAL_CFLAGS += $(bluetooth_CFLAGS)
40LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS)
41LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS)
42
43include $(BUILD_STATIC_LIBRARY)
44
45# HCI unit tests for target
46# ========================================================
47ifeq (,$(strip $(SANITIZE_TARGET)))
48include $(CLEAR_VARS)
49
50LOCAL_C_INCLUDES := \
51    $(LOCAL_PATH)/include \
52    $(LOCAL_PATH)/.. \
53    $(LOCAL_PATH)/../include \
54    $(LOCAL_PATH)/../btcore/include \
55    $(LOCAL_PATH)/../osi/test \
56    $(LOCAL_PATH)/../stack/include \
57    $(LOCAL_PATH)/../utils/include \
58    $(bluetooth_C_INCLUDES)
59
60LOCAL_SRC_FILES := \
61    ../osi/test/AllocationTestHarness.cpp \
62    ../osi/test/AlarmTestHarness.cpp \
63    ./test/hci_hal_h4_test.cpp \
64    ./test/hci_hal_mct_test.cpp \
65    ./test/hci_layer_test.cpp \
66    ./test/low_power_manager_test.cpp \
67    ./test/packet_fragmenter_test.cpp
68
69LOCAL_MODULE := net_test_hci
70LOCAL_MODULE_TAGS := tests
71LOCAL_SHARED_LIBRARIES := liblog libdl libprotobuf-cpp-full
72LOCAL_STATIC_LIBRARIES := libbt-hci libosi libcutils libbtcore libbt-protos
73
74LOCAL_CFLAGS += $(bluetooth_CFLAGS)
75LOCAL_CONLYFLAGS += $(bluetooth_CONLYFLAGS)
76LOCAL_CPPFLAGS += $(bluetooth_CPPFLAGS)
77
78include $(BUILD_NATIVE_TEST)
79endif # SANITIZE_TARGET
80