cordova-plugin-chrome-apps-bluetoothlowenergy
Advanced tools
Comparing version 1.0.2 to 1.0.3
@@ -50,6 +50,32 @@ // Copyright (c) 2014 The Chromium Authors. All rights reserved. | ||
exports.getServices = function(deviceAddress, callback) { | ||
exec(callback, fail(callback), 'ChromeBluetoothLowEnergy', 'getServices', [deviceAddress]); | ||
}; | ||
exports.getServices = (function() { | ||
// A Map stores getServices' callbacks. Key is the deviceAddress, and value | ||
// is an array of callback. | ||
var getServicesCallbacks = {}; | ||
return function(deviceAddress, callback) { | ||
if (getServicesCallbacks[deviceAddress] !== undefined) { | ||
getServicesCallbacks[deviceAddress].push(callback); | ||
} else { | ||
getServicesCallbacks[deviceAddress] = [callback]; | ||
var handleWin = function(arg) { | ||
getServicesCallbacks[deviceAddress].forEach(function(callback) { | ||
callback(arg); | ||
}); | ||
delete getServicesCallbacks[deviceAddress]; | ||
}; | ||
var handleFail = function(arg) { | ||
getServicesCallbacks[deviceAddress].forEach(function(callback) { | ||
(fail(callback)(arg)); | ||
}); | ||
delete getServicesCallbacks[deviceAddress]; | ||
}; | ||
exec(handleWin, handleFail, 'ChromeBluetoothLowEnergy', 'getServices', [deviceAddress]); | ||
} | ||
}; | ||
}()); | ||
exports.getCharacteristic = function(characteristicId, callback) { | ||
@@ -56,0 +82,0 @@ var win = callback && function(uuid, service, properties, instanceId, value) { |
{ | ||
"name": "cordova-plugin-chrome-apps-bluetoothlowenergy", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "This plugin implements the [chrome.bluetoothLowEnergy](https://developer.chrome.com/apps/bluetoothLowEnergy) API for iOS and Android.", | ||
@@ -5,0 +5,0 @@ "cordova": { |
@@ -11,2 +11,5 @@ # chrome.bluetoothLowEnergy Plugin | ||
## 1.0.3 (Nov 10, 2015) | ||
- Fix concurrent getServices calls for same device not working (Android) | ||
## 1.0.2 (April 30, 2015) | ||
@@ -13,0 +16,0 @@ - Renamed plugin to pubilsh to NPM |
Sorry, the diff of this file is not supported yet
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
73079
10
483
22