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