BleCharacteristic

This class is a representation of a BLE Advertisement for a BlePeripheral in Homey. This class must not be initiated by the developer, but retrieved by calling BleService#discoverCharacteristics or BleService#getCharacteristic.

Table of Contents

Constructor

new Homey.BleCharacteristic()

Properties:
Name Type Description
id string

Id of the characteristic assigned by Homey

uuid string

Uuid of the characteristic

peripheral BlePeripheral

The peripheral object that is the owner of this characteristic

service BleService

The service object that is the owner of this characteristic

name string

The name of the characteristic

type string

The type of the characteristic

properties Array.<string>

The properties of the characteristic

value Buffer

The value of the characteristic. Note this is set to the last result of $BleCharacteristic#read and is initially null

Methods

discoverDescriptors(descriptorsopt, callbackopt) → {Promise}

Discovers descriptors for this characteristic

Parameters:
Name Type Attributes Description
descriptors Array.<string> <optional>

list of descriptorUuids to search for

callback function <optional>
Name Type Description
err Error
descriptors Array.<BleDescriptor>
Returns:
Type:
Promise

getInfoString(ic, callbackopt) → {Promise}

Get all available information of this characteristic as a printable string

Parameters:
Name Type Attributes Description
ic number

Indent count

callback function <optional>
Name Type Description
err Error

Will always be null

infoString string

the info string

Returns:
Type:
Promise

read(callbackopt) → {Promise}

Read the value for this characteristic

Parameters:
Name Type Attributes Description
callback function <optional>
Name Type Description
err Error
value Buffer
Returns:
Type:
Promise

write(data, callbackopt) → {Promise}

Write a value to this characteristic

Parameters:
Name Type Attributes Description
data Buffer

The data that should be written

callback function <optional>
Name Type Description
err Error
value Buffer
Returns:
Type:
Promise