Class: Toybox.BluetoothLowEnergy.ScanResult

Overview

Encapsulates an Advertisement seen during scanning. Cannot be instantiated.

Used as an argument to pairDevice() to add a new device to the System's Paired Devices list

Since:

API Level 3.1.0

Instance Method Summary collapse

Instance Method Details

equals(other as Lang.Object or Null) as Lang.Boolean

Compares the ScanResult to another object for equality

Parameters:

  • other(Lang.Object)

    The Object to test against

Returns:

  • Lang.Boolean

    true if other is a scan result for the same device, otherwise false

Since:

API Level 3.2.0

getAppearance() as Lang.Number

Gets the Advertised Appearance of the sensor

Returns:

  • Lang.Number

    A number representing the appearance of the sensor

Since:

API Level 3.1.0

getDeviceName() as Lang.String or Null

Gets the advertised device name

If no device name is advertised this function will return null

Returns:

  • Lang.String

    The device name if present or null otherwise

Since:

API Level 3.1.0

getManufacturerSpecificData(manufacturerId as Lang.Number) as Lang.ByteArray

Gets Manufacturer Specific Data for a given Manufacturer

Manufacturer Specific Data is decoded according to the BLE Core Specification V4.0 Volume 3 Part C Section 18.11

Parameters:

  • manufacturerId(Lang.Number)

    The manufacturer id to retrieve the manufacturer specific data for.

Returns:

Since:

API Level 3.1.0

getManufacturerSpecificDataIterator() as BluetoothLowEnergy.Iterator

Gets an iterator over all of the Manufacturer Specific Data AD Entries in the advertising packet

Manufacturer Specific Data is decoded according to the BLE Core Specification V4.0 Volume 3 Part C Section 18.11

Returns:

Since:

API Level 3.1.0

getRawData() as Lang.ByteArray

Gets the Raw Data that was retrieved in the advertising packet

Returns:

  • Lang.ByteArray

    Raw bytes that were received in the advertising packet

Since:

API Level 3.1.0

getRssi() as Lang.Number

Gets the received signal strength indication (RSSI) value of the received advertisement.

Returns:

  • Lang.Number

    the RSSI Value of the advertisement associated with the scan result. In dBM

Since:

API Level 3.1.0

getServiceData(uuid as BluetoothLowEnergy.Uuid) as Lang.ByteArray

Gets Service Data for a specific UUID

Service data is decoded according to the BLE Core Specification V4.0 Volume 3 Part C Section 18.10

Parameters:

Returns:

Since:

API Level 3.1.0

getServiceUuids() as BluetoothLowEnergy.Iterator

Gets service UUIDs advertised by the device

If the advertising data contains any service UUID values. They can be accessed through this iterator. If there are no advertised UUIDs this function will return an empty iterator.

Returns:

Since:

API Level 3.1.0

hasAddress(address as Lang.ByteArray or Lang.String) as Lang.Boolean

Check that advertised device BLE address matches

Parameters:

  • address(Lang.ByteArray, Lang.String)

    Address to check for as a big-endian byte array or a string in the format "00:01:02:03:04:05"

Returns:

  • Lang.Boolean

    true if the parameter provided is the same as the address associated with this ScanResult, otherwise false

Since:

API Level 3.2.0

isSameDevice(other as BluetoothLowEnergy.ScanResult) as Lang.Boolean

Determines if another scan result represents the same device as another.

Parameters:

Returns:

  • Lang.Boolean

    Indicating if this scan result represents the same device as another

Since:

API Level 3.1.0


Generated Jun 6, 2024 10:31:52 AM