OSDN Git Service

Move btsnoop_hci.log to /data/misc/bluetooth/logs
[android-x86/system-bt.git] / README.md
1 # Fluoride Bluetooth stack
2
3 ## Building and running on AOSP
4 Just build AOSP - Fluoride is there by default.
5
6 ## Building and running on Linux
7
8 Instructions for Ubuntu, tested on 14.04 with Clang 3.5.0 and 16.10 with Clang
9  3.8.0
10
11 ### Download source
12
13 ```sh
14 mkdir ~/fluoride
15 cd ~/fluoride
16 git clone https://android.googlesource.com/platform/system/bt
17 ```
18
19 Install dependencies (require sudo access):
20
21 ```sh
22 cd ~/fluoride/bt
23 build/install_deps.sh
24 ```
25
26 Then fetch third party dependencies:
27
28 ```sh
29 cd ~/fluoride/bt
30 mkdir third_party
31 cd third_party
32 git clone https://github.com/google/googletest.git
33 git clone https://android.googlesource.com/platform/external/libchrome
34 git clone https://android.googlesource.com/platform/external/modp_b64
35 git clone https://android.googlesource.com/platform/external/tinyxml2
36 git clone https://android.googlesource.com/platform/hardware/libhardware
37 ```
38
39 And third party dependencies of third party dependencies:
40
41 ```sh
42 cd fluoride/bt/third_party/libchrome/base/third_party
43 mkdir valgrind
44 cd valgrind
45 curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/valgrind.h?format=TEXT | base64 -d > valgrind.h
46 curl https://chromium.googlesource.com/chromium/src/base/+/master/third_party/valgrind/memcheck.h?format=TEXT | base64 -d > memcheck.h
47 ```
48
49 NOTE: If system/bt is checked out under AOSP, then create symbolic links instead
50 of downloading sources
51
52 ```
53 cd system/bt
54 mkdir third_party
55 cd third_party
56 ln -s ../../../external/libchrome libchrome
57 ln -s ../../../external/modp_b64 modp_b64
58 ln -s ../../../external/tinyxml2 tinyxml2
59 ln -s ../../../hardware/libhardware libhardware
60 ln -s ../../../external/googletest googletest
61 ```
62
63 ### Generate your build files
64
65 ```sh
66 cd ~/fluoride/bt
67 gn gen out/Default
68 ```
69
70 ### Build
71
72 ```sh
73 cd ~/fluoride/bt
74 ninja -C out/Default all
75 ```
76
77 This will build all targets (the shared library, executables, tests, etc) and
78  put them in out/Default. To build an individual target, replace "all" with the
79  target of your choice, e.g. ```ninja -C out/Default net_test_osi```.
80
81 ### Run
82
83 ```sh
84 cd ~/fluoride/bt/out/Default
85 LD_LIBRARY_PATH=./ ./bluetoothtbd -create-ipc-socket=fluoride
86 ```
87
88 ### Eclipse IDE Support
89
90 1. Follows the Chromium project
91  [Eclipse Setup Instructions](https://chromium.googlesource.com/chromium/src/+/master/docs/linux_eclipse_dev.md)
92  until "Optional: Building inside Eclipse" section (don't do that section, we
93  will set it up differently)
94
95 2. Generate Eclipse settings:
96
97   ```sh
98   cd system/bt
99   gn gen --ide=eclipse out/Default
100   ```
101
102 3. In Eclipse, do File->Import->C/C++->C/C++ Project Settings, choose the XML
103  location under system/bt/out/Default
104
105 4. Right click on the project. Go to Preferences->C/C++ Build->Builder Settings.
106  Uncheck "Use default build command", but instead using "ninja -C out/Default"
107
108 5. Goto Behaviour tab, change clean command to "-t clean"
109