The author's blog address: http://blog.sina.com.cn/samzhen1977
By Sam (zhufeng) sam_code@hotmail.com
Sam wants to port the Controller Library to the hith hi3100 EV 100 platform. The evaluation is as follows:
1. hi3100 EV 100 is an ARM platform.
2. hi3100 EV 100 uses uclibc.
These two differences determine the need to start porting from the underlying Bluetooth library.
I:
Sam compiled Bluetooth. Ko, hci_usb.ko, L2CAP. Ko from Linux kernel,
Hidp. Ko.
II:
Download the new version of bluez.
Http://www.bluez.org/
III:
Cross-compiled bluez:
Cross-compilation, the new version of bluez to be based on libraries such as D-BUS. So Sam is currently using bluez 1.0.
# Cd bluez-libs-2.12
#
Cc =/opt/hisilicon/toolchains/ARM-uclibc-Linux-soft/bin/ARM-uclibc-Linux-gcc
./Configure
-- Host = arm-Linux
# Make clean; make
# Cd bluez-libs-2.12/src/. libs
Here we can see libbluetooth. So.
IV:
Cross-compile BTX:
In BTX makefile,
Cc: =
/Opt/hisilicon/toolchains/ARM-uclibc-Linux-soft/bin/ARM-uclibc-Linux-gcc
Cflags: =-d_show-d_debugtimeout-wall-I ../include
-I/opt/hisilicon/toolchains/ARM-uclibc-Linux-soft/include/
Lflags: =-L./-l ../Resource
-L/opt/hisilicon/toolchains/sysroot-uclibc-soft/usr/lib
Libbtx. So and btx_test are compiled successfully.
The libbtx. So compilation options are as follows:
$ (CC) $ (cflags) $ (lflags)-FPIC-shared BTX. O-o libbtx. So
-Lbluetooth
However, the following message appears when running btx_test on the hi3110 ev100 platform:
Can't modify. // libbtx. So's
Text section. Use GCC option-FPIC for shared objects,
Please.
Sam had to merge BTX into the program.
V:
Compile javasth_remote:
Cc: =
/Opt/hisilicon/toolchains/ARM-uclibc-Linux-soft/bin/ARM-uclibc-Linux-gcc
Cflags: =-d_show-d_debugtimeout-wall-I ../include
-I/opt/hisilicon/toolchains/ARM-uclibc-Linux-soft/include/lflags
: =-L./-l ../Resource
-L/opt/hisilicon/toolchains/sysroot-uclibc-soft/usr/lib
Compile BTX. C.
Compiled successfully.
However, problems may occur during the operation, resulting in slow response. Sam is still checking.