# Using new C++ bindings over the driver transport

When a protocol has a `@transport("Driver")` attribute, the protocol operates
over the driver transport rather than the zircon channel transport:

    library fuchsia.example;

    @transport("Driver")
    protocol Protocol {
        TwoWay(struct {
            request uint32;
        }) -> (struct {
            response uint32;
        });
    };

The driver transport builds on the [Fuchsia driver runtime](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/lib/driver/runtime/) , which has
different memory management constraints and a different threading model than
with Zircon channels. As such, the FIDL client and server types are different
from those found in protocols over Zircon channels, to provide a tailored API.

Most client/server types under the `fidl::` namespace will have a counterpart in
the `fdf::` namespace, that provides the same features but is specialized to the
driver runtime. For example, whereas one would write `fidl::Client` to declare
an asynchronous client over the Zircon channel transport, to use the example
protocol above one would write `fdf::Client<fuchsia_example::Protocol>`. The
generated FIDL header is of the form
`#include <fidl/fuchsia.example/cpp/driver/fidl.h>`.

Similarly, when using the client and server APIs restricted to wire types,
whereas one would write `fidl::WireClient` to declare an asynchronous client
over the Zircon channel transport, to use the example protocol above one would
write `fdf::WireClient<fuchsia_example::Protocol>`. One may include the wire
subset header at `#include <fidl/fuchsia.example/cpp/driver/wire.h>`.

C++ bindings over the driver transport is under iteration. For now the tests may
serve as [examples](https://cs.opensource.google/fuchsia/fuchsia/+/main:/sdk/lib/fidl_driver/tests/transport/wire_async_two_way_test.cc) of using the bindings.
[](https://issues.fuchsia.dev/issues/new?component=1439230&template=1881640&description=Issue+on:+https://fuchsia.dev/docs/development/languages/fidl/tutorials/cpp/topics/driver-transport.md "Report a bug or suggest improvements on this page") [](https://cs.opensource.google/fuchsia/fuchsia/+/main:docs/development/languages/fidl/tutorials/cpp/topics/driver-transport.md "View the source code of this page") [](https://ci.android.com/edit?repo=fuchsia/fuchsia/main&file=docs/development/languages/fidl/tutorials/cpp/topics/driver-transport.md&cloneRepo=fuchsia/fuchsia:refs/heads/main&fullPath=fuchsia/docs/development/languages/fidl/tutorials/cpp/topics/driver-transport.md "Edit the source code of this page")