The following is my previous experience of using bluz-2.22 on arm-xscale.
mkdir -p /nfsroot/arm-xscale-linux-gnu/steven_root/ <= It is the root file system of my arm-xscale board.
export PKG_CONFIG_LIBDIR/nfsroot/arm-xscale-linux-gnu/steven_root/lib/pkgconfig <= It is to configue my cross compile pkg-config.
pkg-config --list-all
1.cross compile bluez-libs-2.22
./configure --host=arm-xscale-linux-gnu --prefix=/nfsroot/arm-xscale-linux-gnu/steven_root/ --includedir=/opt/gcc-4.1.2-glibc-2.4/arm-xscale-linux-gnu/arm-xscale-linux-gnu/include --libdir=/opt/gcc-4.1.2-glibc-2.4/arm-xscale-linux-gnu/arm-xscale-linux-gnu/lib
make
make install
> The shared libs "libbluetooth.so*" would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/lib/
2.corss compile bluez-utils-2.22
./configure --host=arm-xscale-linux-gnu --prefix=/nfsroot/arm-xscale-linux-gnu/steven_root/ --includedir=/opt/gcc-4.1.2-glibc-2.4/arm-xscale-linux-gnu/arm-xscale-linux-gnu/include --libdir=/opt/gcc-4.1.2-glibc-2.4/arm-xscale-linux-gnu/arm-xscale-linux-gnu/lib
make
make install
> The binary "hciconfig " would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/bin/
> The binary "hciattach " would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/bin/
> The binary "hcitool" would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/bin/
> The binary "sdptool" would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/bin/
> The binary "rfcomm" would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/bin/
3. How to run bluz-utils on arm-xscale
#insmod bluetooth.ko
#insmod hci_uart.ko
#insmod l2cap.ko
#insmod rfcomm.ko
#mknod -m 666 /dev/rfcomm0 c 216 0
#reset_bt_gpio <= Our BT chip is controlled by a GPIO port, We have to set the GPIO level to high first before using the chip.
#hciattach -s 115200 ttyS1 bcsp 115200
#hciconfig hci0 reset
#hciconfig -a
#hcitool scan
#sdptool browse XX:XX:XX:XX:XX:XX <=XX:XX:XX:XX:XX:XX is the specified Phone's address)
For example we get the information for AT(SPP) service:
...
Service Name: AT
Service RecHandle: 0x10004
Service Class ID List:
"Serial Port" (0x1101)
Protocol Descriptor List:
"L2CAP" (0x0100)
"RFCOMM" (0x0003)
Channel: 4
....
# rfcomm bind 0 XX:XX:XX:XX:XX:XX Y
(Y is the channel number of the AT(SPP) service)
4. Then we can use some tools like "gnokii" to do the bluetooth serial operations
4.1 cross comple gnokii-0.6.26
./configure --host=arm-xscale-linux-gnu --disable-shared --prefix=/nfsroot/arm-xscale-linux-gnu/steven_root/
make
make install
> The binary "gnokii" would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/bin/
> The binary "gnokiid" would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/bin/
> The etc ".gnokiirc" would be generated under /nfsroot/arm-xscale-linux-gnu/steven_root/etc/
4.2 run gnokii on arm-xscale
Modify the line of the file ".gnokiirc" on board
"port = XX:XX:XX:XX:XX:XX"
(XX:XX:XX:XX:XX:XX is the specified Phone's bluetooth address)
"rfcomm_channel = Y"
(Y is the channel number of the AT(SPP) service)
#gnokii --identify
#gnokii --getsms ME 1
#gnokii --getphonebook ME 1
......
That's all (Steven.)