Crate profile_client

Source
Expand description

An interface for interacting with the fuchsia.bluetooth.bredr.Profile protocol. This interface provides convenience methods to register service searches and advertisements using the Profile protocol and includes a Stream implementation which can be polled to receive Profile API updates.

§Example Usage:

// Connect to the f.b.bredr.Profile protocol. let profile_svc = fuchsia_component::client::connect_to_protocol::()?;

// Create a new ProfileClient by registering an advertisement. Register searches. let svc_defs = vec![..]; let channel_params = ChannelParameters { .. }; let mut profile_client = ProfileClient::advertise(profile_svc, &svc_defs, channel_params)?; profile_client.add_search(..)?; profile_client.add_search(..)?;

// Listen for events from the ProfileClient stream implementation. while let Some(event) = profile_client.next().await? { match event { ProfileEvent::PeerConnected { .. } => {} // Do something ProfileEvent::SearchResult { .. } => {} // Do something } }

Structs§

  • Provides an interface to interact with the fuchsia.bluetooth.bredr.Profile protocol.

Enums§

Type Aliases§