Comparing version 0.3.4 to 0.3.5
@@ -106,3 +106,3 @@ var debug = require('debug')('bindings'); | ||
} | ||
this.emit('connect', uuid, error); | ||
@@ -113,4 +113,9 @@ }; | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].disconnect(); | ||
if (l2capBle) { | ||
l2capBle.disconnect(); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -139,4 +144,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].updateRssi(); | ||
if (l2capBle) { | ||
l2capBle.updateRssi(); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -152,4 +162,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].discoverServices(uuids || []); | ||
if (l2capBle) { | ||
l2capBle.discoverServices(uuids || []); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -165,4 +180,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].discoverIncludedServices(serviceUuid, serviceUuids || []); | ||
if (l2capBle) { | ||
l2capBle.discoverIncludedServices(serviceUuid, serviceUuids || []); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -178,4 +198,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].discoverCharacteristics(serviceUuid, characteristicUuids || []); | ||
if (l2capBle) { | ||
l2capBle.discoverCharacteristics(serviceUuid, characteristicUuids || []); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -191,4 +216,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].read(serviceUuid, characteristicUuid); | ||
if (l2capBle) { | ||
l2capBle.read(serviceUuid, characteristicUuid); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -204,4 +234,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].write(serviceUuid, characteristicUuid, data, withoutResponse); | ||
if (l2capBle) { | ||
l2capBle.write(serviceUuid, characteristicUuid, data, withoutResponse); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -217,4 +252,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].broadcast(serviceUuid, characteristicUuid, broadcast); | ||
if (l2capBle) { | ||
l2capBle.broadcast(serviceUuid, characteristicUuid, broadcast); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -230,4 +270,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].notify(serviceUuid, characteristicUuid, notify); | ||
if (l2capBle) { | ||
l2capBle.notify(serviceUuid, characteristicUuid, notify); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -249,4 +294,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].discoverDescriptors(serviceUuid, characteristicUuid); | ||
if (l2capBle) { | ||
l2capBle.discoverDescriptors(serviceUuid, characteristicUuid); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -262,4 +312,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].readValue(serviceUuid, characteristicUuid, descriptorUuid); | ||
if (l2capBle) { | ||
l2capBle.readValue(serviceUuid, characteristicUuid, descriptorUuid); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -275,4 +330,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].writeValue(serviceUuid, characteristicUuid, descriptorUuid, data); | ||
if (l2capBle) { | ||
l2capBle.writeValue(serviceUuid, characteristicUuid, descriptorUuid, data); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -288,4 +348,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].readHandle(handle); | ||
if (l2capBle) { | ||
l2capBle.readHandle(handle); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -301,4 +366,9 @@ | ||
var address = this._addresses[peripheralUuid]; | ||
var l2capBle = this._l2capBle[address]; | ||
this._l2capBle[address].writeHandle(handle, data, withoutResponse); | ||
if (l2capBle) { | ||
l2capBle.writeHandle(handle, data, withoutResponse); | ||
} else { | ||
console.warn('noble warning: unknown peripheral ' + peripheralUuid); | ||
} | ||
}; | ||
@@ -305,0 +375,0 @@ |
@@ -6,4 +6,6 @@ var os = require('os'); | ||
module.exports = require('./legacy'); | ||
} else if (osRelease < 14) { | ||
module.exports = require('./mavericks'); | ||
} else { | ||
module.exports = require('./mavericks'); | ||
module.exports = require('./yosemite'); | ||
} |
@@ -5,3 +5,3 @@ { | ||
"description": "A node.js BLE (Bluetooth low energy) central library.", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232623
35
5262