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

node-ble

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-ble - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

test-e2e/e2e-test-utils.js

31

package.json
{
"name": "node-ble",
"description": "Bluetooth Low Energy (BLE) library written with pure Node.js (no bindings) - baked by Bluez via DBus",
"version": "1.5.0",
"version": "1.6.0",
"repository": "https://github.com/chrvadala/node-ble.git",

@@ -28,23 +28,20 @@ "author": "chrvadala",

"scripts": {
"test": "jest --testPathIgnorePatterns=e2e.spec.js",
"coverage": "jest --testPathIgnorePatterns=e2e.spec.js --coverage",
"test": "npm run test:standard && npm run test:coverage && npm run test:typescript",
"test:jest": "jest --testPathIgnorePatterns=e2e.spec.js",
"test:coverage": "jest --testPathIgnorePatterns=e2e.spec.js --coverage",
"test:e2e": "jest",
"standard": "standard",
"ci": "npm-run-all standard coverage typescript",
"typescript": "tsc --strict src/index.d.ts",
"build": "exit 0"
"test:standard": "standard",
"test:typescript": "tsc --strict src/index.d.ts"
},
"dependencies": {
"dbus-next": "^0.9.1"
"dbus-next": "^0.10.2"
},
"devDependencies": {
"@babel/plugin-proposal-class-properties": "^7.12.1",
"@babel/plugin-proposal-decorators": "^7.12.12",
"@types/jest": "^26.0.20",
"@types/node": "^14.14.22",
"dotenv": "^8.2.0",
"jest": "^26.6.3",
"npm-run-all": "^4.1.5",
"standard": "^16.0.3",
"typescript": "^4.1.3"
"@babel/plugin-proposal-class-properties": "^7.16.0",
"@babel/plugin-proposal-decorators": "^7.16.0",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.6",
"jest": "^27.3.1",
"standard": "^16.0.4",
"typescript": "^4.4.4"
},

@@ -51,0 +48,0 @@ "standard": {

@@ -14,3 +14,3 @@ # node-ble

```sh
yarn add node-ble
npm install node-ble
```

@@ -170,3 +170,3 @@

| `Promise<Buffer> readValue(Number offset = 0)` | Issues a request to read the value of the characteristic and returns the value if the operation was successful. |
| `Promise<void> writeValue(Buffer buffer, Number | WriteValueOptions options = {})` | Issues a request to write the value of the characteristic. Default options `{ offset: 0, type: 'reliable' }`. |
| `Promise<void> writeValue(Buffer buffer, WriteValueOptions options = {})` | Issues a request to write the value of the characteristic. Default options `{ offset: 0, type: 'reliable' }`. |
| `Promise<void> startNotifications()` | Starts a notification session from this characteristic if it supports value notifications or indications. |

@@ -178,3 +178,3 @@ | `Promise<void> stopNotifications()` | This method will cancel any previous StartNotify transaction. |

| --- | --- |
| valuechanged | New value is notified. (invoke `startNotifications()` to enable notifications)
| `valuechanged` | New value is notified. (invoke `startNotifications()` to enable notifications)

@@ -198,2 +198,3 @@ ## Compatibility

- **1.5** - Adds write options configuration `async writeValue (value, optionsOrOffset = {})` [#20](https://github.com/chrvadala/node-ble/pull/20); Upgrades deps
- **1.6** - Upgrades deps and removes some dependencies; migrates to npm; improves gh-actions

@@ -224,3 +225,3 @@ ## Contributors

```
yarn test
npm test
```

@@ -238,3 +239,3 @@

python example-gatt-server
hcitool dev #this command shows bluetooth mac address
hcitool dev #this command shows bluetooth address
```

@@ -244,14 +245,5 @@

```shell script
# .env
TEST_DEVICE=00:00:00:00:00:00
TEST_SERVICE=12345678-1234-5678-1234-56789abcdef0
TEST_CHARACTERISTIC=12345678-1234-5678-1234-56789abcdef1
TEST_NOTIFY_SERVICE=0000180d-0000-1000-8000-00805f9b34fb
TEST_NOTIFY_CHARACTERISTIC=00002a37-0000-1000-8000-00805f9b34fb
TEST_DEVICE=00:00:00:00:00:00 npm run test:e2e
```
```shell script
yarn test:e2e
```
## References

@@ -258,0 +250,0 @@ - https://git.kernel.org/pub/scm/bluetooth/bluez.git/tree/doc/adapter-api.txt

/* global test, describe, expect, beforeAll, afterAll */
const { getTestDevice } = require('./e2e-test-utils.js')
const { createBluetooth } = require('..')
const {
TEST_DEVICE, // ADDRESS OF A BLE TEST DEVICE
const TEST_SERVICE = '12345678-1234-5678-1234-56789abcdef0' // FOR READ/WRITE TESTING
const TEST_CHARACTERISTIC = '12345678-1234-5678-1234-56789abcdef1' // FOR READ/WRITE TESTING
TEST_SERVICE, // FOR READ/WRITE TESTING
TEST_CHARACTERISTIC, // FOR READ/WRITE TESTING
const TEST_NOTIFY_SERVICE = '0000180d-0000-1000-8000-00805f9b34fb' // FOR NOTIFY TESTING
const TEST_NOTIFY_CHARACTERISTIC = '00002a37-0000-1000-8000-00805f9b34fb' // FOR NOTIFY TESTING
TEST_NOTIFY_SERVICE, // FOR NOTIFY TESTING
TEST_NOTIFY_CHARACTERISTIC // FOR NOTIFY TESTING
} = process.env
const TEST_DEVICE = getTestDevice()

@@ -22,6 +20,2 @@ let bluetooth, destroy

expect(TEST_DEVICE).not.toBeUndefined()
expect(TEST_SERVICE).not.toBeUndefined()
expect(TEST_CHARACTERISTIC).not.toBeUndefined()
expect(TEST_NOTIFY_SERVICE).not.toBeUndefined()
expect(TEST_NOTIFY_CHARACTERISTIC).not.toBeUndefined()
})

@@ -57,3 +51,4 @@

device.on('disconnect', () => console.log('disconnect'))
const isConnected = await device.isConnected()
console.log({ isConnected })
await device.connect()

@@ -60,0 +55,0 @@ }, 20 * 1000)

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