From 07d73d74bc999fb60936def232ab3a90862ee605 Mon Sep 17 00:00:00 2001 From: mmcwilliams Date: Mon, 21 Aug 2017 23:45:56 -0400 Subject: [PATCH] Check for actual prop index and compare --- services/bluetooth/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/services/bluetooth/index.js b/services/bluetooth/index.js index 5f284db..8fbe53a 100644 --- a/services/bluetooth/index.js +++ b/services/bluetooth/index.js @@ -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())