Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cordova-plugin-ble-central

Package Overview
Dependencies
Maintainers
0
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cordova-plugin-ble-central - npm Package Compare versions

Comparing version 1.7.3 to 1.7.4-slim

4

CHANGELOG.md

@@ -0,1 +1,5 @@

## 1.7.4
- More cleanly support isConnected usage with a bool return value #1018 with review from @MaximBelov
## 1.7.3

@@ -2,0 +6,0 @@

3

package.json
{
"name": "cordova-plugin-ble-central",
"version": "1.7.3",
"version": "1.7.4-slim",
"description": "Bluetooth Low Energy (BLE) Central Plugin",

@@ -18,2 +18,3 @@ "scripts": {

"publishConfig": {
"tag": "slim",
"registry": "https://registry.npmjs.org"

@@ -20,0 +21,0 @@ },

@@ -841,5 +841,10 @@ # Bluetooth Low Energy (BLE) Central Plugin for Apache Cordova

```javascript
// Callbacks
ble.isConnected(device_id, success, failure);
// Or using await with promises
await ble.withPromises.isConnected(device_id);
// Promises with boolean return
const isConnected = await ble.withPromises.isConnected(device_id, false);
// Promises with rejection
await ble.withPromises.isConnected(device_id); // throws if not connected
```

@@ -862,2 +867,3 @@

```javascript
// Callbacks
ble.isConnected(

@@ -872,2 +878,18 @@ 'FFCA0B09-CB1D-4DC0-A1EF-31AFD3EDFB53',

);
// Promises with boolean return
const isConnected = await ble.withPromises.isConnected(device_id, false);
if (isConnected) {
console.log('Peripheral is connected');
} else {
console.log('Peripheral is *not* connected');
}
// Promises with rejection
try {
await ble.withPromises.isConnected(device_id);
console.log('Peripheral is connected');
} catch (e) {
console.log('Peripheral is *not* connected');
}
```

@@ -1618,5 +1640,3 @@

1. `npm version patch`
2. Align `plugin.xml` version with npm version
3. Update release notes based on `git log --oneline --no-merges <last release>...master`
4. `npm publish`
2. `npm publish`

@@ -1623,0 +1643,0 @@ ## Release (slim)

@@ -163,5 +163,10 @@ declare namespace BLECentralPlugin {

/* Returns a rejected promise if the device is not connected */
/* Returns a resolved promise if the device is connected,
otherwise returns rejected promise if the device is not connected */
isConnected(device_id: string): Promise<void>;
/* Returns a promise that resolves to true if the device is connected,
otherwise resolves to false if the device is not connected or an error occurs */
isConnected(device_id: string, rejectWhenDisconnected: false): Promise<boolean>;
/* Returns a rejected promise if bluetooth is not connected */

@@ -168,0 +173,0 @@ isEnabled(): Promise<void>;

@@ -365,5 +365,13 @@ // (c) 2014-2016 Don Coleman

isConnected: function (device_id) {
isConnected: function (device_id, rejectWhenDisconnected) {
return new Promise(function (resolve, reject) {
module.exports.isConnected(device_id, resolve, reject);
if (rejectWhenDisconnected === false) {
module.exports.isConnected(
device_id,
() => resolve(true),
() => resolve(false)
);
} else {
module.exports.isConnected(device_id, resolve, reject);
}
});

@@ -370,0 +378,0 @@ },

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc