From c029ab61fc0b7b0ea8ed4d22d56aa283fdf0c82d Mon Sep 17 00:00:00 2001 From: randdusing Date: Sat, 9 Jul 2016 11:29:42 -0500 Subject: [PATCH] prepare 4.1.0 prepare for 4.1.0 release and fix startScan null params issue --- CHANGELOG.md | 3 ++- package.json | 2 +- plugin.xml | 2 +- src/android/BluetoothLePlugin.java | 6 +++++- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6698bbef..8547059f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,11 @@ -## master - 2016-05-01 +## 4.1.0 - 2016-07-09 - wasConnected helper function - Improved subscribe with Android. No longer need to specify whether notification or indication - Read, write, subscribe, unsubscribe, readDescriptor, writeDescriptor queueing for Android [\#263](https://github.com/randdusing/BluetoothLE/issues/263), [\#153](https://github.com/randdusing/BluetoothLE/issues/153) - Everything now runs on the single WebCore thread with Android. It should prevent issues with race conditions - Fix issue with writeDescriptor on Android - Fix issue with UUID validation on iOS +- Fix issue with undefined params obj on startScan on Android. ## 4.0.0 - 2016-03-30 - Update OS X diff --git a/package.json b/package.json index 48608d2d..b3922850 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cordova-plugin-bluetoothle", - "version": "4.0.0", + "version": "4.1.0", "description": "Use the Bluetooth Low Energy plugin to connect your Cordova app to new Bluetooth devices like heart rate monitors, thermometers, etc...", "cordova": { "id": "cordova-plugin-bluetoothle", diff --git a/plugin.xml b/plugin.xml index 8a3b04e9..9674b782 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,5 +1,5 @@ - + diff --git a/src/android/BluetoothLePlugin.java b/src/android/BluetoothLePlugin.java index b5a20f3b..bdc46fb1 100644 --- a/src/android/BluetoothLePlugin.java +++ b/src/android/BluetoothLePlugin.java @@ -1046,6 +1046,10 @@ private synchronized void startScanAction(JSONArray args, CallbackContext callba //Get the service UUIDs from the arguments JSONObject obj = getArgsObject(args); + //Default to empty object if null, ideally part of getArgsObject, but not sure how other functions would be affected + if (obj == null) { + obj = new JSONObject(); + } UUID[] uuids = getServiceUuids(obj); //Save the callback context for reporting back found connections. Also the isScanning flag @@ -1065,7 +1069,7 @@ private synchronized void startScanAction(JSONArray args, CallbackContext callba } else { /* build the ScanFilters */ ArrayList scanFilter = new ArrayList(); - for (UUID uuid : getServiceUuids(obj)) { + for (UUID uuid : uuids) { ScanFilter.Builder builder = new ScanFilter.Builder(); builder.setServiceUuid(new ParcelUuid(uuid)); scanFilter.add(builder.build());