Class AdvertisementData

extends Advertisement
Deprecated. Use Advertisement instead.

Class summary


constructor --name/string= --service-classes/List= --manufacturer-data/Data= --connectable/bool= --flags/int= --check-size/bool=
Deprecated. Use the Advertisement.constructor instead. The argument manufacturer-data has been renamed to 'manufacturer-specific', and service-classes has been renamed to 'services'.

Constructors

constructor --name/string=null --service-classes/List=[] --manufacturer-data/Data=#[] --connectable/bool=false --flags/int=0 --check-size/bool=true
Deprecated. Use the Advertisement.constructor instead. The argument manufacturer-data has been renamed to 'manufacturer-specific', and service-classes has been renamed to 'services'.

Methods

Whether this advertisement contains the given service UUID.

Advertise flags. This must be a bitwise 'or' of the BLE-ADVERTISE-FLAG_* constants (see BLE-ADVERTISE-FLAGS-GENERAL-DISCOVERY and similar).
For backwards compatibility, returns 0 if no flags are present.

Manufacturer data as a byte array.
For backwards compatibility, returns an empty byte array if no manufacturer data is present.
Returns the concatenation of the manufacturer-id and the manufacturer-specific data.
Deprecated. Use Advertisement.manufacturer-specific instead.

manufacturer-specific [block] -> any
Calls the given block with the first field of manufacturer specific data.
Calls the block with the company ID and manufacturer specific data.
If no manufacturer specific data is present, the block is not called.
Returns the result of calling the block, or null if no manufacturer specific data is present.

The advertised name of the device.

operator == other/any -> bool
Whether this object is equal to the other.
By default, identical is used for equality.
Inheritance
Classes overwrite this operator to get an equality specific to their needs. Equality operators often compare the type and field contents. For example:

class Pin:
  number/int

  constructor .number:

  operator == other:
    if other is not Pin: return false
    return number == other.number
A class doesn't have to follow the above format, but it must keep the operator in sync with any hash-code method. That is, if a class has a hash-code member, then the equality and hash-code must agree. If two instances are equal (a == b), then their hash codes must also be equal (a.hash-code == b.hash-code).

Advertised service classes as a list of BleUuid.
Deprecated. Use Advertisement.services instead.

Advertised services as a list of BleUuid.
Returns the empty list if no services are present.

The size of the advertisement data packet.
Returns the size of all the data blocks.

Encodes the advertisement data into a byte array.
Does not check if the size of the advertisement data exceeds 31 bytes.

The transmit power level.

Fields

Whether connections are allowed.
Deprecated: Use RemoteScannedDevice.is-connectable instead.

inherited
The DataBlock fields of this instance.