Struct bluer::Adapter[][src]

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

Interface to a Bluetooth adapter.

Implementations

The Bluetooth adapter name.

For example hci0.

Bluetooth addresses of discovered Bluetooth devices.

Get interface to Bluetooth device of specified address.

This method starts the device discovery session.

This includes an inquiry procedure and remote device name resolving.

This process will start streaming device addresses as new devices are discovered. A device may be discovered multiple times.

All already known devices are also included in the device stream. This may include devices that are currently not in range. Check the Device::rssi property to see if the device is currently present.

Device properties are queried asynchronously and may not be available yet when a DeviceAdded event occurs. Use discover_devices_with_changes when you want to be notified when the device properties change.

This method starts the device discovery session and notifies of device property changes.

This includes an inquiry procedure and remote device name resolving.

This process will start streaming device addresses as new devices are discovered. Each time device properties change you will receive an additional DeviceAdded event for that device.

All already known devices are also included in the device stream. This may include devices that are currently not in range. Check the Device::rssi property to see if the device is currently present.

Streams adapter property and device changes.

The stream ends when the adapter is removed.

Registers an advertisement object to be sent over the LE Advertising channel.

InvalidArguments error indicates that the object has invalid or conflicting properties.

InvalidLength error indicates that the data provided generates a data packet which is too long.

The properties of this object are parsed when it is registered, and any changes are ignored.

If the same object is registered twice it will result in an AlreadyExists error.

If the maximum number of advertisement instances is reached it will result in NotPermitted error.

Drop the returned AdvertisementHandle to unregister the advertisement.

Registers a local GATT services hierarchy (GATT Server).

Registering a service allows applications to publish a local GATT service, which then becomes available to remote devices.

Drop the returned ApplicationHandle to unregister the application.

Registers local GATT profiles (GATT Client).

By registering this type of object an application effectively indicates support for a specific GATT profile and requests automatic connections to be established to devices supporting it.

Drop the returned ProfileHandle to unregister the application.

This removes the remote device object for the given device address.

It will remove also the pairing information.

This method connects to device without need of performing General Discovery.

Connection mechanism is similar to Connect method from Device1 interface with exception that this method returns success when physical connection is established. After this method returns, services discovery will continue and any supported profile will be connected. There is no need for calling Connect on Device1 after this call. If connection was successful this method returns the created device object.

Parameters are the following:

  • address - The Bluetooth device address of the remote device.
  • address_type - The Bluetooth device Address Type. This is address type that should be used for initial connection.

This method is experimental.

The Bluetooth adapter address.

The Bluetooth adapter address type.

For dual-mode and BR/EDR only adapter this defaults to “public”. Single mode LE adapters may have either value. With privacy enabled this contains type of Identity Address and not type of address used for connection.

The Bluetooth system name (pretty hostname).

This property is either a static system default or controlled by an external daemon providing access to the pretty hostname configuration.

The Bluetooth friendly name.

This value can be changed.

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

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

On a well configured system, this property never needs to be changed since it defaults to the system name and provides the pretty hostname. Only if the local name needs to be different from the pretty hostname, this property should be used as last resort.

The Bluetooth friendly name.

This value can be changed.

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

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

On a well configured system, this property never needs to be changed since it defaults to the system name and provides the pretty hostname. Only if the local name needs to be different from the pretty hostname, this property should be used as last resort.

The Bluetooth class of device.

This property represents the value that is either automatically configured by DMI/ACPI information or provided as static configuration.

Switch an adapter on or off. This will also set the appropriate connectable state of the controller.

The value of this property is not persistent. After restart or unplugging of the adapter it will reset back to false.

Switch an adapter on or off. This will also set the appropriate connectable state of the controller.

The value of this property is not persistent. After restart or unplugging of the adapter it will reset back to false.

Switch an adapter to discoverable or non-discoverable to either make it visible or hide it.

This is a global setting and should only be used by the settings application.

If the DiscoverableTimeout is set to a non-zero value then the system will set this value back to false after the timer expired.

In case the adapter is switched off, setting this value will fail.

When changing the Powered property the new state of this property will be updated via a PropertiesChanged signal.

For any new adapter this settings defaults to false.

To send Bluetooth LE advertisements use the advertise method instead.

Switch an adapter to discoverable or non-discoverable to either make it visible or hide it.

This is a global setting and should only be used by the settings application.

If the DiscoverableTimeout is set to a non-zero value then the system will set this value back to false after the timer expired.

In case the adapter is switched off, setting this value will fail.

When changing the Powered property the new state of this property will be updated via a PropertiesChanged signal.

For any new adapter this settings defaults to false.

To send Bluetooth LE advertisements use the advertise method instead.

Switch an adapter to pairable or non-pairable.

This is a global setting and should only be used by the settings application.

Note that this property only affects incoming pairing requests.

For any new adapter this settings defaults to true.

Switch an adapter to pairable or non-pairable.

This is a global setting and should only be used by the settings application.

Note that this property only affects incoming pairing requests.

For any new adapter this settings defaults to true.

The pairable timeout in seconds.

A value of zero means that the timeout is disabled and it will stay in pairable mode forever.

The default value for pairable timeout should be disabled (value 0).

The pairable timeout in seconds.

A value of zero means that the timeout is disabled and it will stay in pairable mode forever.

The default value for pairable timeout should be disabled (value 0).

The discoverable timeout in seconds.

A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever.

The default value for the discoverable timeout should be 180 seconds (3 minutes).

The discoverable timeout in seconds.

A value of zero means that the timeout is disabled and it will stay in discoverable/limited mode forever.

The default value for the discoverable timeout should be 180 seconds (3 minutes).

Indicates that a device discovery procedure is active.

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

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

Number of active advertising instances.

Number of available advertising instances.

List of supported system includes.

List of supported Secondary channels.

Secondary channels can be used to advertise with the corresponding PHY.

Enumerates Advertising-related controller capabilities useful to the client.

List of supported platform features.

If no features are available on the platform, the SupportedFeatures array will be empty.

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.