Bluez Bluetooth protocol stack cross-compilation and porting tutorial (with video download address)

Source: Internet
Author: User

Because of the functional requirements of the project, you need to port the bluez Bluetooth protocol stack to the S3C2410 development platform. Many problems occur during the transplantation process, such as the version mismatch of the dependent library, the cross-compiler version is too high or too low. In order to reduce the migration detours, We will summarize the combined version and compilation process we tested in our own hands as follows, at the same time also comes with the full name of the video compilation process, but no sound, because there is no mic in the laboratory, we will be on the following, although no sound but does not affect the compilation process, for: http://115.com/file/aq7pjuh6 #
Cross-compiled bluez protocol stack. Avi.

The required source code packages include:

Bluez-libs-3.36.tar.gz

Libxml2-2.6.11.tar.gz

Glib-2.16.5.tar.gz

Libsndfile-1.0.17.tar.gz

Libusb-0.1.12.tar.gz

Dbus-1.0.2.tar.gz

Bluez-utils-3.36.tar.gz

Openobex-1.3.tar.gz

The specific compilation and installation steps are as follows:

1. Cross-compile and install bluez-libs

Go to the path of the source package, decompress the source package to the current path, go to the source package directory, and execute the following commands in sequence to complete cross-compilation and installation without errors during command execution:

#./Configure-Prefix =/root/bluez-Libs -- Host = arm-Linux

# Make

# Make install

# Cp/root/bluez/bluelib/lib/pkgconfig/bluez. PC/usr/lib/pkgconfig

2. Cross-compile and install libxml

Decompress the package and enter the source code directory. Execute the following commands in sequence:

#./Configure -- prefix =/root/bluez/libxml -- Host = arm-Linux cc = arm-Linux-gcc

# Make

# Make install

# Cp/root/bluez/libxml/lib/pkgconfig/libxml-2.0.pc/usr/lib/pkgconfig

3. Cross-compile and install glib

Decompress the package and enter the directory where the source code is located. Execute the following commands in sequence:

# Apt-Get install gettext

Gettext is used for internationalization and localization of the system. You can use NLS to compile the program, so that the program output can use the language set by the user rather than English.

# Apt-Get install libglib2.0-Dev

Glib is the underlying core library of GTK + and gnome, and is a lightweight C library for comprehensive purposes.

# 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 ac_cv_func_posix_getpwuid_r = Yes> arm-linux.cache

# Echo ac_cv_func_posix_getgrgid_r = Yes> arm-linux.cache

#./Configure-Prefix =/root/bluez/glib -- Host = arm-Linux cc = arm-Linux-GCC cache-file = arm-linux.cache

# Make

# Make install

# Cp/root/bluez/glib/lib/pkgconfig/*/usr/lib/pkgconfig

4. Cross-compile and install libsndfile

Decompress the package and enter the source package directory. Execute the following commands in sequence:

#./Configure-Prefix =/root/bluez/libsndfile -- Host = arm-Linux cc = arm-Linux-gcc

# Make

# Make install

# Cp/root/bluez/libsndfile/lib/pkgconfig/sndfile. PC/usr/lib/pkgconfig

5. Cross-compile and install libusb

Decompress the package and enter the directory where the source code package is located. Execute the following commands in sequence:

#./Configure-Prefix =/root/bluez/libusb -- Host = arm-Linux cc = arm-Linux-GC

# Make

# Make install

# Cp/root/bluez/libusb/lib/pkgconfig/libusb. PC/usr/lib/pkgconfig

6. Cross-compile and install idea

Decompress the package and enter the directory where the source code package is located. Execute the following commands in sequence:

# Echo ac_cv_have_effecact_sockets = Yes> arm-linux.cache

#./Configure -- Host = arm-Linux -- prefix =/root/bluez/javascc = arm-Linux-GCC -- cache-file = arm-linux.cache -- without-x

# Make

# Make install

# Cp/home/song/install_bluez/libraries/lib/pkgconfig/dbus-1.pc/usr/lib/pkgconfig/

7. Cross-compile and install bluez-utils

Decompress the package and enter the directory where the source code package is located. perform the following operations in sequence:

Open the Network/Bridge. h file and add the following macro definition:

# Define siocbraddbr 0x89a0

# Define siocbrdelbr 0x89a1

# Define siocbraddif 0x89a2

# Define siocbrdelif 0x89a3

Open the input/storage. c file and add the following macro definition:

# Define enokey 161

Run the following command to install the dependent database:

# Apt-Get install libbluetooth-Dev

# Apt-Get install libcwiid1

Finally, execute the following commands to complete compilation and installation:

#. /Configure -- prefix =/root/bluez-utils -- Host = arm-Linux cc = "arm-Linux-gcc-shared-I/root/bluez-libs/ include-L/root/bluez-libs/lib "-- disable-Audio

# Make

# Make install

8. Cross-compile and install openobex

Decompress the package and enter the directory where the source code package is located. Execute the following commands in sequence:

#. /Configure -- prefix =/root/bluez/openobex -- Host = arm-Linux cc = "arm-Linux-gcc-I/root/bluez-libs/include-L/ root/bluez-libs/lib "-- enable-Bluetooth -- disable-USB -- enable-apps

# Make

# Make install

 

Summary: The Bluetooth tool generated under the compilation and installation directory of bluez-utils is generated under the installation directory of bluez-libs, which is the library generated during Bluetooth programming communication, the other two libraries are compiled. That is to say, only files in the bluez-libs and bluez-utils installation directories need to be transplanted to the board.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.