|
Name |
|
Date |
Size |
#Lines |
LOC |
| .. | | - | - |
| apex/ | | 03-May-2024 | - | 184 | 172 |
| audio_a2dp_hw/ | | 03-May-2024 | - | 2,365 | 1,684 |
| audio_bluetooth_hw/ | | 03-May-2024 | - | 2,477 | 1,917 |
| audio_hal_interface/ | | 03-May-2024 | - | 4,631 | 3,804 |
| audio_hearing_aid_hw/ | | 03-May-2024 | - | 2,300 | 1,653 |
| binder/ | | 03-May-2024 | - | 2,806 | 1,366 |
| bta/ | | 03-May-2024 | - | 64,227 | 38,095 |
| btcore/ | | 03-May-2024 | - | 1,681 | 1,013 |
| btif/ | | 03-May-2024 | - | 45,398 | 30,512 |
| build/ | | 03-May-2024 | - | 2,144 | 1,806 |
| common/ | | 03-May-2024 | - | 8,620 | 6,019 |
| conf/ | | 03-May-2024 | - | 182 | 48 |
| device/ | | 03-May-2024 | - | 2,093 | 1,446 |
| doc/ | | 03-May-2024 | - | 832 | 650 |
| embdrv/ | | 03-May-2024 | - | 12,007 | 7,243 |
| gd/ | | 03-May-2024 | - | 135,428 | 99,384 |
| hci/ | | 03-May-2024 | - | 6,582 | 4,418 |
| include/ | | 03-May-2024 | - | 5,959 | 3,226 |
| internal_include/ | | 03-May-2024 | - | 2,153 | 1,364 |
| linux_include/log/ | | 03-May-2024 | - | 34 | 10 |
| main/ | | 03-May-2024 | - | 14,593 | 9,690 |
| osi/ | | 03-May-2024 | - | 10,427 | 6,347 |
| packet/ | | 03-May-2024 | - | 9,676 | 5,846 |
| profile/ | | 03-May-2024 | - | 6,585 | 4,676 |
| service/ | | 03-May-2024 | - | 28,934 | 18,563 |
| stack/ | | 03-May-2024 | - | 164,756 | 99,901 |
| test/ | | 03-May-2024 | - | 25,446 | 18,362 |
| tools/ | | 03-May-2024 | - | 2,415 | 1,770 |
| types/ | | 03-May-2024 | - | 1,392 | 883 |
| udrv/ | | 03-May-2024 | - | 945 | 555 |
| utils/ | | 03-May-2024 | - | 260 | 150 |
| vendor_libs/ | | 03-May-2024 | - | 20,390 | 14,833 |
| vnd/ | | 03-May-2024 | - | 77 | 16 |
| .clang-format | D | 03-May-2024 | 808 | 25 | 22 |
| .gitignore | D | 03-May-2024 | 52 | 7 | 6 |
| .style.yapf | D | 03-May-2024 | 115 | 6 | 5 |
| Android.bp | D | 03-May-2024 | 1.6 KiB | 69 | 65 |
| AndroidTestTemplate.xml | D | 03-May-2024 | 1.7 KiB | 37 | 22 |
| BUILD.gn | D | 03-May-2024 | 5.2 KiB | 232 | 194 |
| Cargo.toml | D | 03-May-2024 | 730 | 25 | 22 |
| CleanSpec.mk | D | 03-May-2024 | 2.4 KiB | 54 | 2 |
| EventLogTags.logtags | D | 03-May-2024 | 1.3 KiB | 39 | 37 |
| METADATA | D | 03-May-2024 | 39 | 4 | 3 |
| MODULE_LICENSE_APACHE2 | D | 03-May-2024 | 0 | | |
| NOTICE | D | 03-May-2024 | 11.1 KiB | 203 | 169 |
| OWNERS | D | 03-May-2024 | 231 | 14 | 12 |
| PREUPLOAD.cfg | D | 03-May-2024 | 304 | 14 | 10 |
| README.md | D | 03-May-2024 | 3.9 KiB | 123 | 93 |
| TEST_MAPPING | D | 03-May-2024 | 1.1 KiB | 70 | 69 |
| build.py | D | 03-May-2024 | 15.1 KiB | 459 | 340 |
| rustfmt.toml | D | 03-May-2024 | 39 | 2 | 1 |
README.md
1# Fluoride Bluetooth stack
2
3## Building and running on AOSP
4Just build AOSP - Fluoride is there by default.
5
6## Building and running on Linux
7
8Instructions for a Debian based distribution:
9* Debian Bullseye or newer
10* Ubuntu 20.10 or newer
11* Clang-11 or Clang-12
12* Flex 2.6.x
13* Bison 3.x.x (tested with 3.0.x, 3.2.x and 3.7.x)
14
15You'll want to download some pre-requisite packages as well. If you're currently
16configured for AOSP development, you should have all required packages.
17Otherwise, you can use the following apt-get list:
18
19```sh
20sudo apt-get install repo git-core gnupg flex bison gperf build-essential \
21 zip curl zlib1g-dev gcc-multilib g++-multilib \
22 x11proto-core-dev libx11-dev lib32z-dev libncurses5 \
23 libgl1-mesa-dev libxml2-utils xsltproc unzip liblz4-tool libssl-dev \
24 libc++-dev libevent-dev \
25 flatbuffers-compiler libflatbuffers1 \
26 openssl openssl-dev
27```
28
29You will also need a recent-ish version of Rust and Cargo. Please follow the
30instructions on [Rustup](https://rustup.rs/) to install a recent version.
31
32### Download source
33
34```sh
35mkdir ~/fluoride
36cd ~/fluoride
37git clone https://android.googlesource.com/platform/system/bt
38```
39
40Install dependencies (require sudo access). This adds some Ubuntu dependencies
41and also installs GN (which is the build tool we're using).
42
43```sh
44cd ~/fluoride/bt
45build/install_deps.sh
46```
47
48The following third-party dependencies are necessary but currently unavailable
49via a package manager. You may have to build these from source and install them
50to your local environment.
51
52* libchrome
53* modp_b64
54
55We provide a script to produce debian packages for those components, please
56follow the instructions in build/dpkg/README.txt.
57
58The googletest packages provided by Debian/Ubuntu (libgmock-dev and
59libgtest-dev) do not provide pkg-config files, so you can build your own
60googletest using the steps below:
61
62```
63$ git clone https://github.com/google/googletest.git -b release-1.10.0
64$ cd googletest # Main directory of the cloned repository.
65$ mkdir build # Create a directory to hold the build output.
66$ cd build
67$ cmake .. # Generate native build scripts for GoogleTest.
68$ sudo make install -DCMAKE_INSTALL_PREFIX=/usr
69```
70
71### Stage your build environment
72
73For host build, we depend on a few other repositories:
74* [Platform2](https://chromium.googlesource.com/chromiumos/platform2/)
75* [Rust crates](https://chromium.googlesource.com/chromiumos/third_party/rust_crates/)
76* [Proto logging](https://android.googlesource.com/platform/frameworks/proto_logging/)
77
78Clone these all somewhere and create your staging environment.
79```sh
80export STAGING_DIR=path/to/your/staging/dir
81mkdir ${STAGING_DIR}
82mkdir -p ${STAGING_DIR}/external
83ln -s $(readlink -f ${PLATFORM2_DIR}/common-mk) ${STAGING_DIR}/common-mk
84ln -s $(readlink -f ${PLATFORM2_DIR}/.gn) ${STAGING_DIR}/.gn
85ln -s $(readlink -f ${RUST_CRATE_DIR}) ${STAGING_DIR}/external/rust
86ln -s $(readlink -f ${PROTO_LOG_DIR}) ${STAGING_DIR}/external/proto_logging
87```
88
89### Build
90
91We provide a build script to automate building assuming you've staged your build
92environment already as above.
93
94
95```sh
96./build.py --output ${OUTPUT_DIR} --platform-dir ${STAGING_DIR} --clang
97```
98
99This will build all targets to the output directory you've given. You can also
100build each stage separately (if you want to iterate on something specific):
101
102* prepare - Generate the GN rules
103* tools - Generate host tools
104* rust - Build the rust portion of the build
105* main - Build all the C/C++ code
106* test - Build all targets and run the tests
107* clean - Clean the output directory
108
109You can choose to run only a specific stage by passing an arg via `--target`.
110
111Currently, Rust builds are a separate stage that uses Cargo to build. See
112[gd/rust/README.md](gd/rust/README.md) for more information.
113
114### Run
115
116By default on Linux, we statically link libbluetooth so you can just run the
117binary directly:
118
119```sh
120cd ~/fluoride/bt/out/Default
121./bluetoothtbd -create-ipc-socket=fluoride
122```
123