From 0ce292f215a99adf3d19cb31c8b3b41250c90fb8 Mon Sep 17 00:00:00 2001 From: Matthias Ringwald Date: Fri, 3 Apr 2015 22:20:11 +0200 Subject: [PATCH] fix compilation for mtk/android --- include/btstack/utils.h | 5 +++++ platforms/mtk/Makefile | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/include/btstack/utils.h b/include/btstack/utils.h index d7c61f6be..ef959e565 100644 --- a/include/btstack/utils.h +++ b/include/btstack/utils.h @@ -131,6 +131,11 @@ void bt_flip_addr(bd_addr_t dest, bd_addr_t src); void net_store_16(uint8_t *buffer, uint16_t pos, uint16_t value); void net_store_32(uint8_t *buffer, uint16_t pos, uint32_t value); +// hack: compilation with the android ndk causes an error as there's a swap64 macro +#ifdef swap64 +#undef swap64 +#endif + void swapX(const uint8_t *src, uint8_t *dst, int len); void swap24(const uint8_t src[3], uint8_t dst[3]); void swap56(const uint8_t src[7], uint8_t dst[7]); diff --git a/platforms/mtk/Makefile b/platforms/mtk/Makefile index 26eadb67c..6b7fe138d 100644 --- a/platforms/mtk/Makefile +++ b/platforms/mtk/Makefile @@ -33,7 +33,7 @@ libBTstack_OBJS = \ BTdaemon_OBJS = $(libBTstack_OBJS) \ att_dispatch.o \ - ledevice_db_memory.o \ + le_device_db_memory.o \ att.o \ att_server.o \ gatt_client.o \ @@ -91,19 +91,19 @@ libBTstack.so: $(libBTstack_OBJS) $(GCC) $(LDFLAGS) -shared -Wl,-soname,/system/lib/libBTstack.so -o $@ $^ inquiry: inquiry.o - $(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ $(BTSTACK_ROOT)/example/daemon/inquiry.o + $(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ inquiry.o rfcomm-echo: rfcomm-echo.o - $(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ $(BTSTACK_ROOT)/example/daemon/rfcomm-echo.o + $(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ rfcomm-echo.o le_scan: le_scan.o - $(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ $(BTSTACK_ROOT)/example/daemon/le_scan.o + $(GCC) $(LDFLAGS) -Wl,-rpath,/system/lib libBTstack.so -o $@ le_scan.o # minimal_peripheral: minimal_peripheral.o # $(GCC) $(LDFLAGS) libs/libbluetoothdrv.so -o $@ minimal_peripheral.o hci_dump: - -killall PacketLogger + # killall PacketLogger $(ADB) shell su root chmod 666 /data/btstack/hci_dump.pklg $(ADB) pull /data/btstack/hci_dump.pklg 2> /dev/null open hci_dump.pklg