Skip to content

Commit

Permalink
startScan fixes
Browse files Browse the repository at this point in the history
And a version bump
  • Loading branch information
randdusing committed Jul 9, 2016
1 parent c703845 commit 3f394e7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 9 deletions.
10 changes: 8 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
## 4.0.2 - 2016-07-09
- Check for null parameters, mainly applies to startScan which doesn't necessarily require parameters
- Don't try to stop scan if already stopped

## 4.0.1 - 2016-04-17
- Minor fixes to support npm

## 4.0.0 - 2016-03-30
- Merged server side functions

Expand All @@ -17,5 +24,4 @@
- Sync Angular wrapper's and Cordova plugin's version numbers
- Timeouts available on most functions
- Example updated with queueing example
- Removed build generation. App build process can handle minification.

- Removed build generation. App build process can handle minification
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ng-cordova-bluetoothle",
"main": "./ng-cordova-bluetoothle.js",
"version": "4.0.0",
"version": "4.0.2",
"description": "AngularJS Wrapper for Phonegap / Cordova Bluetooth LE Plugin",
"authors": [
"George Stocker <http://georgestocker.com>",
Expand Down
10 changes: 5 additions & 5 deletions ng-cordova-bluetoothle.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q',
q.reject(errorUnsupported);
} else {
var timeout = null;
if (params.scanTimeout) {
if (params && params.scanTimeout) {
timeout = $timeout(function() {
window.bluetoothle.isScanning(function(obj) {
if (obj.isScanning) {
Expand Down Expand Up @@ -136,7 +136,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q',
window.bluetoothle.connect(
function(obj) {
$timeout.cancel(timeout);
if (params.useResolve) {
if (params && params.useResolve) {
q.resolve(obj);
} else {
q.notify(obj);
Expand All @@ -162,7 +162,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q',
window.bluetoothle.reconnect(
function(obj) {
$timeout.cancel(timeout);
if (params.useResolve) {
if (params && params.useResolve) {
q.resolve(obj);
} else {
q.notify(obj);
Expand Down Expand Up @@ -336,7 +336,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q',
$timeout.cancel(timeout);
q.notify(obj);

if (params.subscribeTimeout && obj.status == "subscribed") {
if (params && params.subscribeTimeout && obj.status == "subscribed") {
$timeout(function() {
window.bluetoothle.unsubscribe(
function(obj) {
Expand Down Expand Up @@ -898,7 +898,7 @@ angular.module('ngCordovaBluetoothLE', []).factory('$cordovaBluetoothLE', ['$q',
};

var createTimeout = function(params, q) {
if (params.timeout) {
if (params && params.timeout) {
return $timeout(function() {
params.error = "timeout";
q.reject(params);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ng-cordova-bluetoothle",
"version": "4.0.1",
"version": "4.0.2",
"description": "AngularJS Wrapper for Phonegap / Cordova Bluetooth LE Plugin",
"author": {
"name": "George Stocker",
Expand Down

0 comments on commit 3f394e7

Please sign in to comment.