首先认是一下UbertoothOne
什么,Ubertooth
是一个蓝牙实验平台。 它能够嗅探蓝牙智能(BLE),发现无法发现的经典蓝牙设备,并执行基本的经典蓝牙设备嗅探。Ubertooth
不是蓝牙适配器,当运行hciconfig时,它不会显示为蓝牙适配器。下面是官网的原文描述。
Ubertooth is a platform for Bluetooth experimentation. It is able to sniff Bluetooth Smart (BLE), discover undiscoverable classic Bluetooth devices, and perform rudimentary sniffing of classic Bluetooth devices.
Ubertooth is not a Bluetooth dongle and it will not show up as one when running hciconfig.
下面是相关库移植的过程和过程中遇到的问题及解决方法。
- 编译libbtbb
tar zxvf libbtbb-2020-12-R1.tar.gz
cd libbtbb-2020-12-R1
mkdir build
cd build/
cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_INSTALL_PREFIX=/opt/ubertoothone/libbtbb
make
sudo make install
- 编译libusb
tar zxvf libusb-1.0.26.tar.gz
cd libusb-1.0.26
./configure --host=arm-linux --prefix=/opt/Xilinx/SDK/2018.3/gnu/aarch32/lin/gcc-arm-linux-gnueabi/arm-linux-gnueabihf/libc/ CC=arm-linux-gnueabihf-gcc CXX=arm-linux-gnueabihf-g++ --disable-udev
- 编译libbluetooth
tar zxvf bluez-libs-3.36.tar.gz
cd bluez-libs-3.36
./configure --prefix=/opt/ubertoothone/libbluetooth/ --host=arm-linux --target=arm-linux CC=arm-linux-gnueabihf-gcc
make
sudo make install
- 编译ubertooth
tar zxvf ubertooth-2020-12-R1.tar.gz
cd ubertooth-2020-12-R1/host/
mkdir build
cd build/
cmake .. -DCMAKE_C_COMPILER=arm-linux-gnueabihf-gcc -DCMAKE_CXX_COMPILER=arm-linux-gnueabihf-g++ -DCMAKE_INSTALL_PREFIX=/opt/ubertoothone/ubertooth
make
sudo make install
#编译过程中遇到问题
1./home/anritsen/work/prj/BluetoothOne/zynq/ubertooth-2020-12-R1/host/ubertooth-tools/src/ubertooth-follow.c:22:10: fatal error: /opt/ubertoothone/libbluetooth/bluetooth/bluetooth.h: No such file or directory
#include <bluetooth/bluetooth.h>
修改对应文件CMakeCache.txt中头文件路径为绝对路径
2.在设备上执行工具命令时提示缺少libatomic.so库,将交叉工具链SDK中的libatomic.so拷贝至设备上即可