Skip to content

Commit

Permalink
Bluetooth: support host HCI pass through
Browse files Browse the repository at this point in the history
  • Loading branch information
vicamo committed Apr 24, 2014
1 parent 85f9690 commit 2790080
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Makefile.common
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,7 @@ ifeq ($(HOST_OS),linux)
CONFIG_ALSA ?= yes
CONFIG_PULSEAUDIO ?= yes
CONFIG_ESD ?= yes
# CONFIG_BLUEZ ?= yes
endif

ifeq ($(HOST_OS),freebsd)
Expand Down Expand Up @@ -402,6 +403,13 @@ endif

AUDIO_SOURCES := $(call sort,$(AUDIO_SOURCES:%=audio/%))

ifeq ($(CONFIG_BLUEZ),yes)
common_LOCAL_CFLAGS += -I/usr/include
EMULATOR_LIBQEMU_LDLIBS += -lbluetooth
LIBBLUETOOTH_LDFLAGS := -L/usr/lib/i386-linux-gnu
LIBBLUETOOTH_LDFLAGS_64 := -L/usr/lib/x86_64-linux-gnu
endif

common_LOCAL_CFLAGS += -Wno-sign-compare \
-fno-strict-aliasing -W -Wall -Wno-unused-parameter \

Expand Down
4 changes: 4 additions & 0 deletions Makefile.target
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,8 @@ LOCAL_CFLAGS += $(BLOCK_CFLAGS)

LOCAL_MODULE_TAGS := debug

LOCAL_LDFLAGS += $(LIBBLUETOOTH_LDFLAGS)

$(call end-emulator-program)

##############################################################################
Expand Down Expand Up @@ -463,6 +465,7 @@ LOCAL_STATIC_LIBRARIES += \
emulator-libelff \
emulator-common \
$(SDL_STATIC_LIBRARIES)
LOCAL_LDFLAGS += $(LIBBLUETOOTH_LDFLAGS)
LOCAL_LDLIBS += $(common_LOCAL_LDLIBS)
LOCAL_CFLAGS += $(common_LOCAL_CFLAGS)
LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
Expand All @@ -488,6 +491,7 @@ ifeq ($(HOST_OS),linux)
emulator64-libelff \
emulator64-common \
$(SDL_STATIC_LIBRARIES_64)
LOCAL_LDFLAGS += $(LIBBLUETOOTH_LDFLAGS_64)
LOCAL_LDLIBS += $(common_LOCAL_LDLIBS) -m64
LOCAL_CFLAGS += $(common_LOCAL_CFLAGS) -m64
LOCAL_SRC_FILES += $(common_LOCAL_SRC_FILES)
Expand Down
28 changes: 28 additions & 0 deletions android-configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ OPTION_HELP=no
OPTION_STATIC=no
OPTION_MINGW=no
OPTION_MULTISIM=1
OPTION_BLUEZ=no

GLES_INCLUDE=
GLES_LIBS=
Expand Down Expand Up @@ -692,6 +693,33 @@ if [ "$GLES_INCLUDE" -a "$GLES_LIBS" ]; then
echo "#define CONFIG_ANDROID_OPENGLES 1" >> $config_h
fi

case $TARGET_OS in
linux-*)
cat > $TMPC << EOF
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
#undef main
int main( int argc, char** argv ) {
return hci_open_dev(0);
}
EOF
EXTRA_CFLAGS="-I/usr/include"
if [ "$OPTION_TRY_64" = "yes" ]; then
EXTRA_LDFLAGS="-L/usr/lib/x86_64-linux-gnu"
else
EXTRA_LDFLAGS="-L/usr/lib/i386-linux-gnu"
fi
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lbluetooth"
feature_check_link OPTION_BLUEZ
;;
esac

if [ "$OPTION_BLUEZ" = "yes" ]; then
echo "CONFIG_BLUEZ := true" >> $config_mk
echo "#define CONFIG_BLUEZ 1" >> $config_h
fi

echo "#define MAX_GSM_DEVICES $OPTION_MULTISIM" >> $config_h

log "Generate : $config_h"
Expand Down

0 comments on commit 2790080

Please sign in to comment.