class AllocResources

Defined at line 332 of file fidling/gen/sdk/fidl/fuchsia.hardware.usb.function/fuchsia.hardware.usb.function/cpp/fidl/fuchsia.hardware.usb.function/cpp/markers.h

Allocate resources for the function.

This method is atomic. If any resource allocation fails, all allocations made during this

call are rolled back.

This must be called during driver initialization before `Configure`. Calling this after the

function has been configured returns `ZX_ERR_BAD_STATE`.

`interface_count` informs how many interfaces to create. `interface_nums` returns a vector

of length `interface_count` containing the allocated interface numbers.

`endpoints` is a vector of endpoints to allocate. The direction and endpoint server end are

provided. The protocol client can optionally provide endpoint channels in `endpoints`

to connect them immediately. If an endpoint channel is not provided, the protocol client

must call [`ConnectToEndpoint`] later to use it. `endpoint_addrs` returns a vector of the

same size containing the allocated endpoint addresses, where element `i` corresponds 1:1

to element `i` of `endpoints`. All endpoint channels provided here or connected later via

[`ConnectToEndpoint`] persist across [`Configure`] and [`Deconfigure`] calls.

`strings` is a vector of strings to allocate. `string_indices` returns a vector of the

same size containing the allocated string indices, where element `i` corresponds 1:1 to

element `i` of `strings`.

Returns the interface ids, endpoint ids, and string ids that were allocated. On error, no

resources are allocated.

The allocated resource numbers and addresses remain allocated for the lifetime of the

connection to `UsbFunction`. They are *not* freed on `Deconfigure`.

* error:

* `ZX_ERR_BAD_STATE` if the function has already been configured.

* `ZX_ERR_NO_RESOURCES` if any resource namespace numbers are exhausted.

* `ZX_ERR_INVALID_ARGS` if the endpoint configuration contains invalid arguments.

Public Members

static const bool kHasClientToServer
static const bool kHasClientToServerBody
static const bool kHasServerToClient
static const bool kHasServerToClientBody
static const bool kHasNonEmptyUserFacingResponse
static const bool kHasDomainError
static const bool kHasFrameworkError
static const uint64_t kOrdinal