Struct bluer::adv::Advertisement[][src]

pub struct Advertisement {
Show 17 fields pub advertisement_type: Type, pub service_uuids: BTreeSet<Uuid>, pub manufacturer_data: BTreeMap<u16, Vec<u8>>, pub solicit_uuids: BTreeSet<Uuid>, pub service_data: BTreeMap<Uuid, Vec<u8>>, pub advertisting_data: BTreeMap<u8, Vec<u8>>, pub discoverable: Option<bool>, pub discoverable_timeout: Option<Duration>, pub system_includes: BTreeSet<Feature>, pub local_name: Option<String>, pub appearance: Option<u16>, pub duration: Option<Duration>, pub timeout: Option<Duration>, pub secondary_channel: Option<SecondaryChannel>, pub min_interval: Option<Duration>, pub max_interval: Option<Duration>, pub tx_power: Option<i16>, // some fields omitted
}
This is supported on crate feature bluetoothd only.
Expand description

Bluetooth LE advertisement data definition.

Specifies the Advertisement Data to be broadcast and some advertising parameters. Properties which are not present will not be included in the data. Required advertisement data types will always be included. All UUIDs are 128-bit versions in the API, and 16 or 32-bit versions of the same UUID will be used in the advertising data as appropriate.

Use Adapter::advertise to register a new advertisement.

Fields

advertisement_type: Type

Determines the type of advertising packet requested.

service_uuids: BTreeSet<Uuid>

List of UUIDs to include in the “Service UUID” field of the Advertising Data.

manufacturer_data: BTreeMap<u16, Vec<u8>>

Manufacturer Data fields to include in the Advertising Data.

Keys are the Manufacturer ID to associate with the data.

solicit_uuids: BTreeSet<Uuid>

Array of UUIDs to include in “Service Solicitation” Advertisement Data.

service_data: BTreeMap<Uuid, Vec<u8>>

Service Data elements to include.

The keys are the UUID to associate with the data.

advertisting_data: BTreeMap<u8, Vec<u8>>

Advertising Type to include in the Advertising Data.

Key is the advertising type and value is the data as byte array.

Note: Types already handled by other properties shall not be used.

discoverable: Option<bool>

Advertise as general discoverable.

When present this will override adapter Discoverable property.

Note: This property shall not be set when Type is set to broadcast.

discoverable_timeout: Option<Duration>

The discoverable timeout in seconds.

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

Note: This property shall not be set when Type is set to broadcast.

system_includes: BTreeSet<Feature>

List of system features to be included in the advertising packet.

local_name: Option<String>

Local name to be used in the advertising report.

If the string is too big to fit into the packet it will be truncated.

appearance: Option<u16>

Appearance to be used in the advertising report.

duration: Option<Duration>

Duration of the advertisement in seconds.

If there are other applications advertising no duration is set the default is 2 seconds.

timeout: Option<Duration>

Timeout of the advertisement in seconds.

This defines the lifetime of the advertisement.

secondary_channel: Option<SecondaryChannel>

Secondary channel to be used.

Primary channel is always set to “1M” except when “Coded” is set.

min_interval: Option<Duration>

Minimum advertising interval to be used by the advertising set, in milliseconds.

Acceptable values are in the range [20ms, 10,485s]. If the provided MinInterval is larger than the provided MaxInterval, the registration will return failure.

max_interval: Option<Duration>

Maximum advertising interval to be used by the advertising set, in milliseconds.

Acceptable values are in the range [20ms, 10,485s]. If the provided MinInterval is larger than the provided MaxInterval, the registration will return failure.

tx_power: Option<i16>

Requested transmission power of this advertising set.

The provided value is used only if the “CanSetTxPower” feature is enabled on the Advertising Manager. The provided value must be in range [-127 to +20], where units are in dBm.

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

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. 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.