pub struct HciProxy { /* private fields */ }
Implementations§
Source§impl HciProxy
impl HciProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.bluetooth/Hci.
Sourcepub fn take_event_stream(&self) -> HciEventStream
pub fn take_event_stream(&self) -> HciEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn open_command_channel(
&self,
channel: Channel,
) -> QueryResponseFut<HciOpenCommandChannelResult, DefaultFuchsiaResourceDialect>
pub fn open_command_channel( &self, channel: Channel, ) -> QueryResponseFut<HciOpenCommandChannelResult, DefaultFuchsiaResourceDialect>
Open the two-way HCI command channel for sending HCI commands and receiving event packets. Returns ZX_ERR_ALREADY_BOUND if the channel is already open.
Sourcepub fn open_acl_data_channel(
&self,
channel: Channel,
) -> QueryResponseFut<HciOpenAclDataChannelResult, DefaultFuchsiaResourceDialect>
pub fn open_acl_data_channel( &self, channel: Channel, ) -> QueryResponseFut<HciOpenAclDataChannelResult, DefaultFuchsiaResourceDialect>
Open the two-way HCI ACL data channel. Returns ZX_ERR_ALREADY_BOUND if the channel is already open.
Sourcepub fn open_sco_data_channel(
&self,
channel: Channel,
) -> QueryResponseFut<HciOpenScoDataChannelResult, DefaultFuchsiaResourceDialect>
pub fn open_sco_data_channel( &self, channel: Channel, ) -> QueryResponseFut<HciOpenScoDataChannelResult, DefaultFuchsiaResourceDialect>
Opens a SCO channel on the provided handle. The zircon channel is closed in the event of an error opening the hci channel or if the hci channel is already associated with a handle to another zircon channel. Returns ZX_ERR_NOT_SUPPORTED if SCO is not supported by the current vendor or transport driver. Returns ZX_ERR_ALREADY_BOUND if the channel is already open.
Sourcepub fn configure_sco(
&self,
coding_format: ScoCodingFormat,
encoding: ScoEncoding,
sample_rate: ScoSampleRate,
) -> QueryResponseFut<HciConfigureScoResult, DefaultFuchsiaResourceDialect>
pub fn configure_sco( &self, coding_format: ScoCodingFormat, encoding: ScoEncoding, sample_rate: ScoSampleRate, ) -> QueryResponseFut<HciConfigureScoResult, DefaultFuchsiaResourceDialect>
Configure the HCI for a SCO connection with the indicated parameters. This must be called before sending/receiving data on the SCO channel. Returns ZX_ERR_NOT_SUPPORTED if SCO is not supported by the current vendor or transport driver.
Sourcepub fn reset_sco(
&self,
) -> QueryResponseFut<HciResetScoResult, DefaultFuchsiaResourceDialect>
pub fn reset_sco( &self, ) -> QueryResponseFut<HciResetScoResult, DefaultFuchsiaResourceDialect>
Releases resources held by an active SCO connection. Must be called when a SCO connection is closed. Returns ZX_ERR_NOT_SUPPORTED if SCO is not supported by the current vendor or transport driver.
Sourcepub fn open_iso_data_channel(
&self,
channel: Channel,
) -> QueryResponseFut<HciOpenIsoDataChannelResult, DefaultFuchsiaResourceDialect>
pub fn open_iso_data_channel( &self, channel: Channel, ) -> QueryResponseFut<HciOpenIsoDataChannelResult, DefaultFuchsiaResourceDialect>
Opens a channel on the provided handle for sending and receiving isochronous data packets. The zircon channel is closed in the event of an error opening the hci channel or if the hci channel is already associated with a handle to another zircon channel. Returns ZX_ERR_NOT_SUPPORTED if ISO is not supported by the current vendor or transport driver. Returns ZX_ERR_ALREADY_BOUND if the channel is already open.
Sourcepub fn open_snoop_channel(
&self,
channel: Channel,
) -> QueryResponseFut<HciOpenSnoopChannelResult, DefaultFuchsiaResourceDialect>
pub fn open_snoop_channel( &self, channel: Channel, ) -> QueryResponseFut<HciOpenSnoopChannelResult, DefaultFuchsiaResourceDialect>
Open an output-only channel for monitoring HCI traffic. The format of each message is: [1-octet flags] [n-octet payload] The flags octet is a bitfield with the following values defined:
- 0x00: The payload represents a command packet sent from the host to the controller.
- 0x01: The payload represents an event packet sent by the controller. Returns ZX_ERR_ALREADY_BOUND if the channel is already open.