最近做了蓝牙适配器的移植,下面是我的蓝牙Bluez协议的移植过程 1,编译安装bluez-lib-3.36.tar.gz #tar zxvf bluez-lib-3.36.tar.gz #./configure --profix=/opt/libs --host=arm-linux --target=arm-linux CC=arm-linux-gcc #make #make install 2,编译安装 这个库是后面的dbus依赖的,你也可以用expat来代替libxml2,官方网站上说dbus必须依赖于他们中的一个。 #tar zxvflibxml2-2.7.4.tar.gz #./configure --profix=/opt/libs --host=arm-linux --target=arm-linux CC=arm-linux-gcc #make #make install
3,编译安装dbus-1.0.2.tar.gz #tar zxvf dbus-1.2.16.tar.gz #echo ac_cv_have_abstract_sockets=yes>arm-linux.cache #./configure --profix=/opt/libs --host=arm-linux --target=arm-linux CC="arm-linux-gcc -I/opt/libs/include -L/opt/libs/lib" --cache-file=arm-linux.cache --with-x=no #make #make install
4,编译安装glib-2.16.5 #tar -zxjf glib-2.16.5.tar.bz2 #echo ac_cv_type_long_long=yes>arm-linux.cache #echo glib_cv_stack_grows=no>>arm-linux.cache #echo glib_cv_uscore=no>>arm-linux.cache #echo c_cv_func_posix_getpwuid_r=yes>>arm-linux.cache #echo ac_cv_func_posix_getgrgid_r=yes>> #./configure --profix=/opt/libs --host=arm-linux --target=arm-linux CC="arm-linux-gcc -I/opt/libs/include -L/opt/libs/lib" --cache-file=arm-linux.cache #make #make install
5,编译安装libusb-0.1.12.tar.gz #tar zxvf libusb-0.1.12.tar.gz #./configure --profix=/opt/libs --host=arm-linux --target=arm-linux CC="arm-linux-gcc -I/opt/libs/include -L/opt/libs/lib" #make #make install
6,编译安装bluez-utils-3.36.tar.gz #tar zxvf bluez-utils-3.36.tar.gz #./configure --profix=/opt/libs --host=arm-linux --target=arm-linux CC="arm-linux-gcc -I/opt/libs/include -L/opt/libs/lib" --disable-audio #make #make install 以上部分成功编译且将所需文件加入到了文件系统里,相应的内核配置, 把 networking下 --- Bluetooth subsystem support 里的以下几项全部选上:
L2CAP protocol support
SCO links support
RFCOMM protocol support
RFCOMM TTY support
BNEP protocol support
HIDP protocol support
BCSP protocol support
因为我是通过usb接口使用蓝牙适配器,所以选择 了
HCI USB driver 编译内核烧写到开发板,但是我的开发板上蓝牙适配器却没办法和其他蓝牙设备相连 下面是我执行命令的输出:hciconfig hci0 up 输出: hci0: Type: BR/EDR Bus: USB BD Address: 00:1F:81:00:02:DD ACL MTU: 1021:4 SCO MTU: 180:1 UP RUNNING RX bytes:342 acl:0 sco:0 events:10 errors:0 TX bytes:33 acl:0 sco:0 commands:11 errors:0 执行hcid -f /etc/bluetooth/hcid.conf hciconfig hciO Im accept,master Sdpd pand-Iisten--role NAP 但是用其他终端却无法连接上,我用 hciconfig hciO up Hcid -f /etc/bluetooth/hcid.conf sdpd pand--Connect 00:06:6E:12:8E:97 相应终端也没有任何反应,有没有做过相应应用的大牛啊,求解决方法,比较急,谢谢啦。
|