Instance Properties
characteristics
characteristics: Array.<BleCharacteristic>Type
- Array.<BleCharacteristic>
id
id: stringId of the service assigned by Homey
Type
- string
name
name: stringThe name of the service
Type
- string
type
type: stringThe type of the service
Type
- string
uuid
uuid: stringUuid of the service
Type
- string
Instance Methods
discoverCharacteristics
(async) discoverCharacteristics(characteristicsFilteropt): Promise.<Array.<BleCharacteristic>>Discover characteristics of this service
Parameters
Name | Type | Description |
---|---|---|
characteristicsFilter
|
Array.<string>
<optional> |
List of characteristicUuids to search for |
Throws
Will throw an error if peripheral is not connected
Returns
getCharacteristic
(async) getCharacteristic(uuid): Promise.<BleCharacteristic>gets a characteristic for given characteristicUuid
Parameters
Name | Type | Description |
---|---|---|
uuid
|
string | The characteristicUuid to get |
Throws
Will throw an error if peripheral is not connected
Returns
read
(async) read(characteristicUuid): Promise.<Buffer>Shorthand to read a characteristic for given characteristicUuid
Parameters
Name | Type | Description |
---|---|---|
characteristicUuid
|
string | The uuid of the characteristic that needs to be read |
Throws
Will throw an error if peripheral is not connected
Returns
write
(async) write(characteristicUuid, data): Promise.<Buffer>Shorthand to write to a characteristic for given characteristicUuid
Parameters
Name | Type | Description |
---|---|---|
characteristicUuid
|
string | The uuid of the characteristic that needs to be written to |
data
|
Buffer | The data that needs to be written |
Throws
Will throw an error if peripheral is not connected