Skip to content

Commit

Permalink
WriteValue - add type paramerter
Browse files Browse the repository at this point in the history
  • Loading branch information
buildog committed Jun 8, 2020
1 parent 25d8be0 commit daa15fa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/GattCharacteristic.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ class GattCharacteristic extends EventEmitter {
return Buffer.from(payload)
}

async writeValue (value, offset = 0) {
async writeValue (value, offset = 0, type = 'reliable') {
if (!Buffer.isBuffer(value)) {
throw new Error('Only buffers can be wrote')
}
const options = {
offset: buildTypedValue('uint16', offset),
type: buildTypedValue('string', 'reliable')
type: buildTypedValue('string', type)
}
const { data } = value.toJSON()
await this.helper.callMethod('WriteValue', data, options)
Expand Down

0 comments on commit daa15fa

Please sign in to comment.