xref: /aosp_15_r20/external/pigweed/pw_bluetooth_proxy/docs.rst (revision 61c4878ac05f98d0ceed94b57d316916de578985)
1.. _module-pw_bluetooth_proxy:
2
3==================
4pw_bluetooth_proxy
5==================
6.. pigweed-module::
7   :name: pw_bluetooth_proxy
8
9The ``pw_bluetooth_proxy`` module provides a lightweight proxy host that
10can be placed between a Bluetooth host and Bluetooth controller to add
11additional functionality or inspection. All without modifying the host or the
12controller.
13
14An example use case could be offloading some functionality from a main host
15located on the application processor to instead be handled on the MCU (to reduce
16power usage).
17
18The proxy acts as a proxy of all host controller interface (HCI) packets between
19the host and the controller.
20
21:cpp:class:`pw::bluetooth::proxy::ProxyHost` acts as the main coordinator for
22proxy functionality.
23
24.. literalinclude:: proxy_host_test.cc
25   :language: cpp
26   :start-after: [pw_bluetooth_proxy-examples-basic]
27   :end-before: [pw_bluetooth_proxy-examples-basic]
28
29.. grid:: 2
30
31   .. grid-item-card:: :octicon:`rocket` Get Started
32      :link: module-pw_bluetooth_proxy-getstarted
33      :link-type: ref
34      :class-item: sales-pitch-cta-primary
35
36      How to set up in your build system
37
38   .. grid-item-card:: :octicon:`code-square` API Reference
39      :link: module-pw_bluetooth_proxy-reference
40      :link-type: ref
41      :class-item: sales-pitch-cta-secondary
42
43      Reference information about the API
44
45.. grid:: 2
46
47   .. grid-item-card:: :octicon:`code-square` Roadmap
48      :link: module-pw_bluetooth_proxy-roadmap
49      :link-type: ref
50      :class-item: sales-pitch-cta-secondary
51
52      Upcoming plans
53
54   .. grid-item-card:: :octicon:`code-square` Code size analysis
55      :link: module-pw_bluetooth_proxy-size-reports
56      :link-type: ref
57      :class-item: sales-pitch-cta-secondary
58
59      Understand code footprint and savings potential
60
61
62.. _module-pw_bluetooth_proxy-getstarted:
63
64-----------
65Get started
66-----------
67.. repository: https://bazel.build/concepts/build-ref#repositories
68
691. Add Emboss to your project as described in
70   :ref:`module-pw_third_party_emboss`.
71
72.. tab-set::
73
74   .. tab-item:: Bazel
75
76      Bazel isn't supported yet.
77
78   .. tab-item:: GN
79      :selected:
80
81      2. Then add ``$dir_pw_bluetooth_proxy`` to
82      the ``deps`` list in your ``pw_executable()`` build target:
83
84      .. code-block::
85
86         pw_executable("...") {
87           # ...
88           deps = [
89             # ...
90             "$dir_pw_bluetooth_proxy",
91             # ...
92           ]
93         }
94
95   .. tab-item:: CMake
96
97      2. Then add ``pw_bluetooth_proxy`` to
98      the ``DEPS`` list in your cmake target:
99
100.. _module-pw_bluetooth_proxy-reference:
101
102-------------
103API reference
104-------------
105
106pw::bluetooth::proxy::ProxyHost
107===============================
108.. doxygenclass:: pw::bluetooth::proxy::ProxyHost
109   :members:
110
111.. _module-pw_bluetooth_proxy-size-reports:
112
113------------------
114Code size analysis
115------------------
116Delta when constructing a proxy and just sending packets through.
117
118.. include:: use_passthrough_proxy_size_report
119
120
121.. _module-pw_bluetooth_proxy-roadmap:
122
123-------
124Roadmap
125-------
126- ACL flow control
127- Sending GATT notifications
128- CMake support
129- Receiving GATT notifications
130- Taking ownership of a L2CAP channel
131- Bazel support
132- And more...
133