Comparing version 1.5.0 to 1.6.0
{ | ||
"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) |
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
57772
7
25
1184
2
262
+ Addedabbrev@1.1.1(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedansi-regex@2.1.1(transitive)
+ Addedaproba@1.2.0(transitive)
+ Addedare-we-there-yet@1.1.7(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedchownr@2.0.0(transitive)
+ Addedcode-point-at@1.1.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedconsole-control-strings@1.1.0(transitive)
+ Addedcore-util-is@1.0.21.0.3(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddbus-next@0.10.2(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddelegates@1.0.0(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedenv-paths@2.2.1(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedfs-minipass@2.1.0(transitive)
+ Addedfs.realpath@1.0.0(transitive)
+ Addedgauge@2.7.4(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglob@7.2.3(transitive)
+ Addedgraceful-fs@4.2.11(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhas-unicode@2.0.1(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addedinflight@1.0.6(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedis-fullwidth-code-point@1.0.0(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisarray@1.0.0(transitive)
+ Addedisexe@2.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedminimatch@3.1.2(transitive)
+ Addedminipass@3.3.65.0.0(transitive)
+ Addedminizlib@2.1.2(transitive)
+ Addedmkdirp@1.0.4(transitive)
+ Addednode-gyp@7.1.2(transitive)
+ Addednopt@5.0.0(transitive)
+ Addednpmlog@4.1.2(transitive)
+ Addednumber-is-nan@1.0.1(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedpath-is-absolute@1.0.1(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprocess-nextick-args@2.0.1(transitive)
+ Addedpsl@1.13.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.5.3(transitive)
+ Addedreadable-stream@2.3.8(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedrimraf@3.0.2(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsemver@7.6.3(transitive)
+ Addedset-blocking@2.0.0(transitive)
+ Addedsignal-exit@3.0.7(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstring-width@1.0.2(transitive)
+ Addedstring_decoder@1.1.1(transitive)
+ Addedstrip-ansi@3.0.1(transitive)
+ Addedtar@6.2.1(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedusocket@0.3.0(transitive)
+ Addedutil-deprecate@1.0.2(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedwhich@2.0.2(transitive)
+ Addedwide-align@1.1.5(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedyallist@4.0.0(transitive)
- Removedabstract-socket@2.1.1(transitive)
- Removeddbus-next@0.9.2(transitive)
Updateddbus-next@^0.10.2