Check for actual prop index and compare
This commit is contained in:
parent
e7347af656
commit
07d73d74bc
|
@ -31,11 +31,11 @@ function createChar(name, uuid, prop, write, read) {
|
|||
})
|
||||
}
|
||||
util.inherits(characteristic, bleno.Characteristic)
|
||||
if (prop.indexOf('read')) {
|
||||
if (prop.indexOf('read') !== -1) {
|
||||
//data, offset, withoutResponse, callback
|
||||
characteristic.prototype.onReadRequest = read
|
||||
}
|
||||
if (prop.indexOf('write')) {
|
||||
if (prop.indexOf('write') !== -1) {
|
||||
characteristic.prototype.onWriteRequest = write
|
||||
}
|
||||
chars.push(new characteristic())
|
||||
|
|
Loading…
Reference in New Issue