Struct bluer::Device[][src]

pub struct Device { /* fields omitted */ }
This is supported on crate feature bluetoothd only.
Expand description

Interface to a Bluetooth device.

Implementations

The Bluetooth adapter name.

The Bluetooth device address of the remote device.

Streams device property changes.

The stream ends when the device is removed.

Remote GATT services.

The device must be connected for GATT services to be resolved.

Remote GATT service with specified id.

This is a generic method to connect any profiles the remote device supports that can be connected to and have been flagged as auto-connectable on our side.

If only subset of profiles is already connected it will try to connect currently disconnected ones.

If at least one profile was connected successfully this method will indicate success.

For dual-mode devices only one bearer is connected at time, the conditions are in the following order:

  1. Connect the disconnected bearer if already connected.

  2. Connect first the bonded bearer. If no bearers are bonded or both are skip and check latest seen bearer.

  3. Connect last seen bearer, in case the timestamps are the same BR/EDR takes precedence.

This method gracefully disconnects all connected profiles and then terminates low-level ACL connection.

ACL connection will be terminated even if some profiles were not disconnected properly e.g. due to misbehaving device.

This method can be also used to cancel a preceding Connect call before a reply to it has been received.

For non-trusted devices connected over LE bearer calling this method will disable incoming connections until Connect method is called again.

This method connects a specific profile of this device. The UUID provided is the remote service UUID for the profile.

This method disconnects a specific profile of this device.

The profile needs to be registered client profile.

There is no connection tracking for a profile, so as long as the profile is registered this will always succeed.

This method will connect to the remote device, initiate pairing and then retrieve all SDP records (or GATT primary services).

If the application has registered its own agent, then that specific agent will be used. Otherwise it will use the default agent.

Only for applications like a pairing wizard it would make sense to have its own agent. In almost all other cases the default agent will handle this just fine.

In case there is no application agent and also no default agent present, this method will fail.

Drop the returned future to cancel pairing.

The Bluetooth remote name.

This value can not be changed. Use the Alias property instead.

This value is only present for completeness. It is better to always use the Alias property when displaying the devices name.

If the Alias property is unset, it will reflect this value which makes it more convenient.

The Bluetooth device address type.

For dual-mode and BR/EDR only devices this defaults to “public”. Single mode LE devices may have either value. If remote device uses privacy than before pairing this represents address type used for connection and Identity Address after pairing.

Proposed icon name according to the freedesktop.org icon naming specification.

The Bluetooth class of device of the remote device.

External appearance of device, as found on GAP service.

List of 128-bit UUIDs that represents the available remote services.

Indicates if the remote device is paired.

Indicates if the remote device is paired.

Indicates if the remote is seen as trusted. This setting can be changed by the application.

Indicates if the remote is seen as trusted. This setting can be changed by the application.

If set to true any incoming connections from the device will be immediately rejected.

Any device drivers will also be removed and no new ones will be probed as long as the device is blocked.

If set to true any incoming connections from the device will be immediately rejected.

Any device drivers will also be removed and no new ones will be probed as long as the device is blocked.

If set to true this device will be allowed to wake the host from system suspend.

If set to true this device will be allowed to wake the host from system suspend.

The name alias for the remote device.

The alias can be used to have a different friendly name for the remote device.

In case no alias is set, it will return the remote device name. Setting an empty string as alias will convert it back to the remote device name.

When resetting the alias with an empty string, the property will default back to the remote name.

The name alias for the remote device.

The alias can be used to have a different friendly name for the remote device.

In case no alias is set, it will return the remote device name. Setting an empty string as alias will convert it back to the remote device name.

When resetting the alias with an empty string, the property will default back to the remote name.

Set to true if the device only supports the pre-2.1 pairing mechanism.

This property is useful during device discovery to anticipate whether legacy or simple pairing will occur if pairing is initiated.

Note that this property can exhibit false-positives in the case of Bluetooth 2.1 (or newer) devices that have disabled Extended Inquiry Response support.

Remote Device ID information in modalias format used by the kernel and udev.

Received Signal Strength Indicator of the remote device (inquiry or advertising).

None if the device is known, but not currently present.

Advertised transmitted power level (inquiry or advertising).

Manufacturer specific advertisement data.

Keys are 16 bits Manufacturer ID followed by its byte array value.

Service advertisement data.

Keys are the UUIDs followed by its byte array value.

Indicate whether or not service discovery has been resolved.

The Advertising Data Flags of the remote device.

The Advertising Data of the remote device.

Note: Only types considered safe to be handled by application are exposed.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.