diff --git a/README.md b/README.md index b3e9cddb..1cbd3242 100644 --- a/README.md +++ b/README.md @@ -134,8 +134,8 @@ bleno.startAdvertisingIBeacon(uuid, major, minor, measuredPower[, callback(error ##### Start advertising with EIR data (__Linux only__) ```javascript -var scanData = new Buffer(...); // maximum 31 bytes -var advertisementData = new Buffer(...); // maximum 31 bytes +var scanData = Buffer.alloc(...); // maximum 31 bytes +var advertisementData = Buffer.alloc(...); // maximum 31 bytes bleno.startAdvertisingWithEIRData(advertisementData[, scanData, callback(error)]); ``` @@ -227,7 +227,7 @@ Parameters to handler are ```javascript var result = Characteristic.RESULT_SUCCESS; -var data = new Buffer( ... ); +var data = Buffer.alloc( ... ); callback(result, data); ``` diff --git a/examples/battery-service/battery-level-characteristic.js b/examples/battery-service/battery-level-characteristic.js index c63a850e..e1150bbf 100644 --- a/examples/battery-service/battery-level-characteristic.js +++ b/examples/battery-service/battery-level-characteristic.js @@ -18,7 +18,7 @@ var BatteryLevelCharacteristic = function() { }), new Descriptor({ uuid: '2904', - value: new Buffer([0x04, 0x01, 0x27, 0xAD, 0x01, 0x00, 0x00 ]) // maybe 12 0xC unsigned 8 bit + value: Buffer.from([0x04, 0x01, 0x27, 0xAD, 0x01, 0x00, 0x00 ]) // maybe 12 0xC unsigned 8 bit }) ] }); @@ -34,11 +34,11 @@ BatteryLevelCharacteristic.prototype.onReadRequest = function(offset, callback) var percent = data.split('\t')[1].split(';')[0]; console.log(percent); percent = parseInt(percent, 10); - callback(this.RESULT_SUCCESS, new Buffer([percent])); + callback(this.RESULT_SUCCESS, Buffer.from([percent])); }); } else { // return hardcoded value - callback(this.RESULT_SUCCESS, new Buffer([98])); + callback(this.RESULT_SUCCESS, Buffer.from([98])); } }; diff --git a/examples/battery-service/package-lock.json b/examples/battery-service/package-lock.json index e1da221f..1c0cf134 100644 --- a/examples/battery-service/package-lock.json +++ b/examples/battery-service/package-lock.json @@ -1,8 +1,1545 @@ { "name": "battery-service", "version": "0.1.0", - "lockfileVersion": 1, + "lockfileVersion": 2, "requires": true, + "packages": { + "": { + "version": "0.1.0", + "os": [ + "darwin", + "linux" + ], + "dependencies": { + "@abandonware/bleno": "~0.5.1-2" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/@abandonware/bleno": { + "version": "0.5.1-2", + "resolved": "https://registry.npmjs.org/@abandonware/bleno/-/bleno-0.5.1-2.tgz", + "integrity": "sha512-NYGw4sC6v/UI6jHhWv0OOzViQ/icJEPYkpG+FQow1ziV/HzQ/QPqrM8Jc/M0HTW0y6dFZ3cPtiGETrlLEjnGMw==", + "os": [ + "darwin", + "linux", + "android", + "freebsd", + "win32" + ], + "dependencies": { + "@abandonware/bluetooth-hci-socket": "^0.5.3-5", + "bplist-parser": "0.2.0", + "debug": "^4.1.1", + "xpc-connect": "^2.0.0" + }, + "engines": { + "node": ">=0.8" + }, + "optionalDependencies": { + "@abandonware/bluetooth-hci-socket": "^0.5.3-5", + "bplist-parser": "0.2.0", + "xpc-connect": "^2.0.0" + } + }, + "node_modules/@abandonware/bluetooth-hci-socket": { + "version": "0.5.3-6", + "resolved": "https://registry.npmjs.org/@abandonware/bluetooth-hci-socket/-/bluetooth-hci-socket-0.5.3-6.tgz", + "integrity": "sha512-LwZtu31vgcm6T4GRtHDCye1JZepvjfqW418DYccgcu4podXbBoogkt4NhRP6rnoOxY+49F1Do7oK5K8fModxuw==", + "hasInstallScript": true, + "optional": true, + "os": [ + "linux", + "android", + "freebsd", + "win32" + ], + "dependencies": { + "debug": "^4.2.0", + "nan": "^2.14.1", + "node-pre-gyp": "^0.15.0", + "usb": "^1.6.3" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "optional": true, + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "node_modules/ansi-regex": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", + "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/aproba": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", + "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", + "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^2.0.6" + } + }, + "node_modules/asn1": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", + "integrity": "sha512-jxwzQpLQjSmWXgwaCZE9Nz+glAG01yF1QnWgbhGwHI5A6FRIEY6IVqtHhIepHqI7/kyEyQEagBC5mBEFlIYvdg==", + "optional": true, + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", + "optional": true, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", + "optional": true + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", + "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "optional": true + }, + "node_modules/balanced-match": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", + "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "optional": true + }, + "node_modules/base64-js": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==", + "optional": true + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", + "optional": true, + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/big-integer": { + "version": "1.6.48", + "resolved": "https://registry.npmjs.org/big-integer/-/big-integer-1.6.48.tgz", + "integrity": "sha512-j51egjPa7/i+RdiRuJbPdJ2FIUYYPhvYLjzoYbcMMm62ooO6F94fETG4MTs46zPAF9Brs04OajboA/qTGuz78w==", + "optional": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.0.3.tgz", + "integrity": "sha512-fs4G6/Hu4/EE+F75J8DuN/0IpQqNjAdC7aEQv7Qt8MHGUH7Ckv2MwTEEeN9QehD0pfIDkMI1bkHYkKy7xHyKIg==", + "optional": true, + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/block-stream": { + "version": "0.0.9", + "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", + "integrity": "sha1-E+v+d4oDIFz+A3UUgeu0szAMEmo=", + "optional": true, + "dependencies": { + "inherits": "~2.0.0" + }, + "engines": { + "node": "0.4 || >=0.5.8" + } + }, + "node_modules/bplist-parser": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/bplist-parser/-/bplist-parser-0.2.0.tgz", + "integrity": "sha512-z0M+byMThzQmD9NILRniCUXYsYpjwnlO8N5uCFaCqIOpqRsJCrQL9NK3JsD67CN5a08nF5oIL2bD6loTdHOuKw==", + "optional": true, + "dependencies": { + "big-integer": "^1.6.44" + }, + "engines": { + "node": ">= 5.10.0" + } + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/buffer": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.0.tgz", + "integrity": "sha512-cd+5r1VLBwUqTrmnzW+D7ABkJUM6mr7uv1dv+6jRw4Rcl7tFIFHDqHPL98LhpGFn3dbAt3gtLxtrWp4m1kFrqg==", + "optional": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", + "optional": true + }, + "node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "optional": true + }, + "node_modules/code-point-at": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", + "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "optional": true, + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "optional": true + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "optional": true + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "optional": true + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "optional": true, + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + } + }, + "node_modules/decompress-response": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-4.2.1.tgz", + "integrity": "sha512-jOSne2qbyE+/r8G1VU+G/82LBs2Fs4LAsTiLSHOCOMZQl2OKZ6i8i4IyHemTe+/yIXOtTcRQMzPcgyhoFlqPkw==", + "optional": true, + "dependencies": { + "mimic-response": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "optional": true, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", + "optional": true, + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "optional": true + }, + "node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "optional": true, + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "optional": true, + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "optional": true + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", + "engines": [ + "node >=0.6.0" + ], + "optional": true + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "optional": true + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "optional": true + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "optional": true, + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "optional": true + }, + "node_modules/fs-minipass": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.7.tgz", + "integrity": "sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==", + "optional": true, + "dependencies": { + "minipass": "^2.6.0" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "optional": true + }, + "node_modules/fstream": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/fstream/-/fstream-1.0.12.tgz", + "integrity": "sha512-WvJ193OHa0GHPEL+AycEJgxvBEwyfRkN1vhjca23OaPVMCaLCXTd5qAu82AjTcgP1UJmytkOKb63Ypde7raDIg==", + "optional": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "inherits": "~2.0.0", + "mkdirp": ">=0.5 0", + "rimraf": "2" + }, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/gauge": { + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", + "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "optional": true, + "dependencies": { + "aproba": "^1.0.3", + "console-control-strings": "^1.0.0", + "has-unicode": "^2.0.0", + "object-assign": "^4.1.0", + "signal-exit": "^3.0.0", + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1", + "wide-align": "^1.1.0" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "optional": true, + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=", + "optional": true + }, + "node_modules/glob": { + "version": "7.1.6", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", + "optional": true + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", + "optional": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "optional": true, + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "optional": true + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", + "optional": true, + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "optional": true + }, + "node_modules/ignore-walk": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.3.tgz", + "integrity": "sha512-m7o6xuOaT1aqheYHKf8W6J5pYH85ZI9w077erOzLje3JsB1gkafkAhHHY19dqjulgIZHFm32Cp5uNZgcQqdJKw==", + "optional": true, + "dependencies": { + "minimatch": "^3.0.4" + } + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "optional": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "optional": true + }, + "node_modules/ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", + "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "optional": true, + "dependencies": { + "number-is-nan": "^1.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "optional": true + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "optional": true + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "optional": true + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", + "optional": true + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", + "optional": true + }, + "node_modules/json-schema": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", + "integrity": "sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=", + "optional": true + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "optional": true + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", + "optional": true + }, + "node_modules/jsprim": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", + "integrity": "sha1-MT5mvB5cwG5Di8G3SZwuXFastqI=", + "engines": [ + "node >=0.6.0" + ], + "optional": true, + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.2.3", + "verror": "1.10.0" + } + }, + "node_modules/mime-db": { + "version": "1.44.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", + "optional": true, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.27", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", + "optional": true, + "dependencies": { + "mime-db": "1.44.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-2.1.0.tgz", + "integrity": "sha512-wXqjST+SLt7R009ySCglWBCFpjUygmCIfD790/kVbiGmUgfYGuB14PiTd5DwVxSV4NcYHjzMkoj5LjQZwTQLEA==", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "optional": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", + "optional": true + }, + "node_modules/minipass": { + "version": "2.9.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.9.0.tgz", + "integrity": "sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==", + "optional": true, + "dependencies": { + "safe-buffer": "^5.1.2", + "yallist": "^3.0.0" + } + }, + "node_modules/minizlib": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.3.3.tgz", + "integrity": "sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==", + "optional": true, + "dependencies": { + "minipass": "^2.9.0" + } + }, + "node_modules/mkdirp": { + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "optional": true, + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "optional": true + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/nan": { + "version": "2.14.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", + "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "optional": true + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "optional": true + }, + "node_modules/needle": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/needle/-/needle-2.5.2.tgz", + "integrity": "sha512-LbRIwS9BfkPvNwNHlsA41Q29kL2L/6VaOJ0qisM5lLWsTV3nP15abO5ITL6L81zqFhzjRKDAYjpcBcwM0AVvLQ==", + "optional": true, + "dependencies": { + "debug": "^3.2.6", + "iconv-lite": "^0.4.4", + "sax": "^1.2.4" + }, + "bin": { + "needle": "bin/needle" + }, + "engines": { + "node": ">= 4.4.x" + } + }, + "node_modules/needle/node_modules/debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "optional": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/node-abi": { + "version": "2.19.1", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-2.19.1.tgz", + "integrity": "sha512-HbtmIuByq44yhAzK7b9j/FelKlHYISKQn0mtvcBrU5QBkhoCMp5bu8Hv5AI34DcKfOAcJBcOEMwLlwO62FFu9A==", + "optional": true, + "dependencies": { + "semver": "^5.4.1" + } + }, + "node_modules/node-gyp": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-3.8.0.tgz", + "integrity": "sha512-3g8lYefrRRzvGeSowdJKAKyks8oUpLEd/DyPV4eMhVlhJ0aNaZqIrNUIPuEWWTAoPqyFkfGrM67MC69baqn6vA==", + "optional": true, + "dependencies": { + "fstream": "^1.0.0", + "glob": "^7.0.3", + "graceful-fs": "^4.1.2", + "mkdirp": "^0.5.0", + "nopt": "2 || 3", + "npmlog": "0 || 1 || 2 || 3 || 4", + "osenv": "0", + "request": "^2.87.0", + "rimraf": "2", + "semver": "~5.3.0", + "tar": "^2.0.0", + "which": "1" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/node-gyp/node_modules/nopt": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-3.0.6.tgz", + "integrity": "sha1-xkZdvwirzU2zWTF/eaxopkayj/k=", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/node-gyp/node_modules/semver": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.3.0.tgz", + "integrity": "sha1-myzl094C0XxgEq0yaqa00M9U+U8=", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/node-gyp/node_modules/tar": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/tar/-/tar-2.2.2.tgz", + "integrity": "sha512-FCEhQ/4rE1zYv9rYXJw/msRqsnmlje5jHP6huWeBZ704jUTy02c5AZyWujpMR1ax6mVw9NyJMfuK2CMDWVIfgA==", + "optional": true, + "dependencies": { + "block-stream": "*", + "fstream": "^1.0.12", + "inherits": "2" + } + }, + "node_modules/node-pre-gyp": { + "version": "0.15.0", + "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.15.0.tgz", + "integrity": "sha512-7QcZa8/fpaU/BKenjcaeFF9hLz2+7S9AqyXFhlH/rilsQ/hPZKK32RtR5EQHJElgu+q5RfbJ34KriI79UWaorA==", + "optional": true, + "dependencies": { + "detect-libc": "^1.0.2", + "mkdirp": "^0.5.3", + "needle": "^2.5.0", + "nopt": "^4.0.1", + "npm-packlist": "^1.1.6", + "npmlog": "^4.0.2", + "rc": "^1.2.7", + "rimraf": "^2.6.1", + "semver": "^5.3.0", + "tar": "^4.4.2" + }, + "bin": { + "node-pre-gyp": "bin/node-pre-gyp" + } + }, + "node_modules/noop-logger": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/noop-logger/-/noop-logger-0.1.1.tgz", + "integrity": "sha1-lKKxYzxPExdVMAfYlm/Q6EG2pMI=", + "optional": true + }, + "node_modules/nopt": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.3.tgz", + "integrity": "sha512-CvaGwVMztSMJLOeXPrez7fyfObdZqNUK1cPAEzLHrTybIua9pMdmmPR5YwtfNftIOMv3DPUhFaxsZMNTQO20Kg==", + "optional": true, + "dependencies": { + "abbrev": "1", + "osenv": "^0.1.4" + }, + "bin": { + "nopt": "bin/nopt.js" + } + }, + "node_modules/npm-bundled": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.1.1.tgz", + "integrity": "sha512-gqkfgGePhTpAEgUsGEgcq1rqPXA+tv/aVBlgEzfXwA1yiUJF7xtEt3CtVwOjNYQOVknDk0F20w58Fnm3EtG0fA==", + "optional": true, + "dependencies": { + "npm-normalize-package-bin": "^1.0.1" + } + }, + "node_modules/npm-normalize-package-bin": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/npm-normalize-package-bin/-/npm-normalize-package-bin-1.0.1.tgz", + "integrity": "sha512-EPfafl6JL5/rU+ot6P3gRSCpPDW5VmIzX959Ob1+ySFUuuYHWHekXpwdUZcKP5C+DS4GEtdJluwBjnsNDl+fSA==", + "optional": true + }, + "node_modules/npm-packlist": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.4.8.tgz", + "integrity": "sha512-5+AZgwru5IevF5ZdnFglB5wNlHG1AOOuw28WhUq8/8emhBmLv6jX5by4WJCh7lW0uSYZYS6DXqIsyZVIXRZU9A==", + "optional": true, + "dependencies": { + "ignore-walk": "^3.0.1", + "npm-bundled": "^1.0.1", + "npm-normalize-package-bin": "^1.0.1" + } + }, + "node_modules/npmlog": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", + "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "optional": true, + "dependencies": { + "are-we-there-yet": "~1.1.2", + "console-control-strings": "~1.1.0", + "gauge": "~2.7.3", + "set-blocking": "~2.0.0" + } + }, + "node_modules/number-is-nan": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "optional": true, + "engines": { + "node": "*" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "optional": true, + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/os-homedir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", + "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/osenv": { + "version": "0.1.5", + "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", + "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "optional": true, + "dependencies": { + "os-homedir": "^1.0.0", + "os-tmpdir": "^1.0.0" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", + "optional": true + }, + "node_modules/prebuild-install": { + "version": "5.3.6", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-5.3.6.tgz", + "integrity": "sha512-s8Aai8++QQGi4sSbs/M1Qku62PFK49Jm1CbgXklGz4nmHveDq0wzJkg7Na5QbnO1uNH8K7iqx2EQ/mV0MZEmOg==", + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^2.7.0", + "noop-logger": "^0.1.1", + "npmlog": "^4.0.1", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^3.0.3", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0", + "which-pm-runs": "^1.0.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "optional": true + }, + "node_modules/psl": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", + "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", + "optional": true + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "optional": true, + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.5.2", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz", + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", + "optional": true, + "engines": { + "node": ">=0.6" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "optional": true, + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "optional": true, + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "optional": true, + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/rimraf": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.7.1.tgz", + "integrity": "sha512-uWjbaKIK3T1OSVptzX7Nl6PvQ3qAGtKEtVRjRuazjfL3Bx5eI409VZSqgND+4UNnmzLVdPj9FqFJNPqBZFve4w==", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + } + }, + "node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "optional": true + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "optional": true + }, + "node_modules/sax": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", + "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "optional": true + }, + "node_modules/semver": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", + "optional": true, + "bin": { + "semver": "bin/semver" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", + "optional": true + }, + "node_modules/signal-exit": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", + "optional": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "optional": true + }, + "node_modules/simple-get": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-3.1.0.tgz", + "integrity": "sha512-bCR6cP+aTdScaQCnQKbPKtJOKDp/hj9EDLJo3Nw4y1QksqaovlW/bnptB6/c1e+qmNIDHRK+oXFDdEqBT8WzUA==", + "optional": true, + "dependencies": { + "decompress-response": "^4.2.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/sshpk": { + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", + "optional": true, + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "optional": true, + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/string-width": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "optional": true, + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-ansi": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", + "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "optional": true, + "dependencies": { + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/tar": { + "version": "4.4.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.13.tgz", + "integrity": "sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==", + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "fs-minipass": "^1.2.5", + "minipass": "^2.8.6", + "minizlib": "^1.2.1", + "mkdirp": "^0.5.0", + "safe-buffer": "^5.1.2", + "yallist": "^3.0.3" + }, + "engines": { + "node": ">=4.5" + } + }, + "node_modules/tar-fs": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.0.tgz", + "integrity": "sha512-9uW5iDvrIMCVpvasdFHW0wJPez0K4JnMZtsuIeDI7HyMGJNxmDZDOCQROr7lXyS+iL/QMpj07qcjGYTSdRFXUg==", + "optional": true, + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.0.0" + } + }, + "node_modules/tar-stream": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.1.4.tgz", + "integrity": "sha512-o3pS2zlG4gxr67GmFYBLlq+dM8gyRGUOvsrHclSkvtVtQbjV0s/+ZE8OpICbaj8clrX3tjeHngYGP7rweaBnuw==", + "optional": true, + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/tar-stream/node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "optional": true, + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", + "optional": true, + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", + "optional": true + }, + "node_modules/uri-js": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", + "optional": true, + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/usb": { + "version": "1.6.3", + "resolved": "https://registry.npmjs.org/usb/-/usb-1.6.3.tgz", + "integrity": "sha512-23KYMjaWydACd8wgGKMQ4MNwFspAT6Xeim4/9Onqe5Rz/nMb4TM/WHL+qPT0KNFxzNKzAs63n1xQWGEtgaQ2uw==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "bindings": "^1.4.0", + "nan": "2.13.2", + "prebuild-install": "^5.3.3" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/usb/node_modules/nan": { + "version": "2.13.2", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.13.2.tgz", + "integrity": "sha512-TghvYc72wlMGMVMluVo9WRJc0mB8KxxF/gZ4YYFy7V2ZQX9l7rgbPg7vjS9mt6U5HXODVFVI2bOduCzwOMv/lw==", + "optional": true + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "optional": true + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "optional": true, + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", + "engines": [ + "node >=0.6.0" + ], + "optional": true, + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "optional": true + }, + "node_modules/wide-align": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", + "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "optional": true + }, + "node_modules/xpc-connect": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/xpc-connect/-/xpc-connect-2.0.0.tgz", + "integrity": "sha512-r7J493GkXt+c931hju91N0UDSZCjqQ4/02MJNSe+948myXSAf/oyBd8zQ9XP1l/IZWuQhdkroMyCaj7gmg413Q==", + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "dependencies": { + "bindings": "^1.5.0", + "nan": "^2.14.0", + "node-gyp": "^3.8.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/yallist": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", + "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", + "optional": true + } + }, "dependencies": { "@abandonware/bleno": { "version": "0.5.1-2", @@ -1087,6 +2624,15 @@ "tweetnacl": "~0.14.0" } }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", @@ -1098,15 +2644,6 @@ "strip-ansi": "^3.0.0" } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "optional": true, - "requires": { - "safe-buffer": "~5.1.0" - } - }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", diff --git a/examples/blink1/blink1-fade-rgb-characteristic.js b/examples/blink1/blink1-fade-rgb-characteristic.js index f5865c9c..c193f967 100644 --- a/examples/blink1/blink1-fade-rgb-characteristic.js +++ b/examples/blink1/blink1-fade-rgb-characteristic.js @@ -34,7 +34,7 @@ Blink1FaceRGBCharacteristic.prototype.onWriteRequest = function(data, offset, wi this.blink1.fadeToRGB(fadeMillis, r, g, b, function() { if (this.updateValueCallback) { - this.updateValueCallback(new Buffer([r, g, b])); + this.updateValueCallback(Buffer.from([r, g, b])); } }.bind(this)); diff --git a/examples/blink1/hardware-revision-characteristic.js b/examples/blink1/hardware-revision-characteristic.js index d39d657d..ac2850bf 100644 --- a/examples/blink1/hardware-revision-characteristic.js +++ b/examples/blink1/hardware-revision-characteristic.js @@ -26,7 +26,7 @@ HardwareRevisionCharacteristic.prototype.onReadRequest = function(offset, callba callback(this.RESULT_ATTR_NOT_LONG, null); } else { this.blink1.version(function(version) { - callback(this.RESULT_SUCCESS, new Buffer(version)); + callback(this.RESULT_SUCCESS, Buffer.from(version)); }.bind(this)); } }; diff --git a/examples/blink1/serial-number-characteristic.js b/examples/blink1/serial-number-characteristic.js index 7c06eb53..09c1d320 100644 --- a/examples/blink1/serial-number-characteristic.js +++ b/examples/blink1/serial-number-characteristic.js @@ -9,7 +9,7 @@ function SerialNumberCharacteristic(blink1) { SerialNumberCharacteristic.super_.call(this, { uuid: '2a25', properties: ['read'], - value: new Buffer(blink1.serialNumber), + value: Buffer.from(blink1.serialNumber), descriptors: [ new BlenoDescriptor({ uuid: '2901', diff --git a/examples/echo/characteristic.js b/examples/echo/characteristic.js index 5e8e9657..68174765 100644 --- a/examples/echo/characteristic.js +++ b/examples/echo/characteristic.js @@ -11,7 +11,7 @@ var EchoCharacteristic = function() { value: null }); - this._value = new Buffer(0); + this._value = Buffer.alloc(0); this._updateValueCallback = null; }; diff --git a/examples/pizza/pizza-bake-characteristic.js b/examples/pizza/pizza-bake-characteristic.js index 984058af..bc58b237 100644 --- a/examples/pizza/pizza-bake-characteristic.js +++ b/examples/pizza/pizza-bake-characteristic.js @@ -31,7 +31,7 @@ PizzaBakeCharacteristic.prototype.onWriteRequest = function(data, offset, withou var self = this; this.pizza.once('ready', function(result) { if (self.updateValueCallback) { - var data = new Buffer(1); + var data = Buffer.alloc(1); data.writeUInt8(result, 0); self.updateValueCallback(data); } @@ -41,4 +41,4 @@ PizzaBakeCharacteristic.prototype.onWriteRequest = function(data, offset, withou } }; -module.exports = PizzaBakeCharacteristic; \ No newline at end of file +module.exports = PizzaBakeCharacteristic; diff --git a/examples/pizza/pizza-crust-characteristic.js b/examples/pizza/pizza-crust-characteristic.js index 287db2b8..18ec4546 100644 --- a/examples/pizza/pizza-crust-characteristic.js +++ b/examples/pizza/pizza-crust-characteristic.js @@ -47,10 +47,10 @@ PizzaCrustCharacteristic.prototype.onReadRequest = function(offset, callback) { callback(this.RESULT_ATTR_NOT_LONG, null); } else { - var data = new Buffer(1); + var data = Buffer.alloc(1); data.writeUInt8(this.pizza.crust, 0); callback(this.RESULT_SUCCESS, data); } }; -module.exports = PizzaCrustCharacteristic; \ No newline at end of file +module.exports = PizzaCrustCharacteristic; diff --git a/examples/pizza/pizza-toppings-characteristic.js b/examples/pizza/pizza-toppings-characteristic.js index cd1f8084..0e6ddce0 100644 --- a/examples/pizza/pizza-toppings-characteristic.js +++ b/examples/pizza/pizza-toppings-characteristic.js @@ -37,10 +37,10 @@ PizzaToppingsCharacteristic.prototype.onReadRequest = function(offset, callback) callback(this.RESULT_ATTR_NOT_LONG, null); } else { - var data = new Buffer(2); + var data = Buffer.alloc(2); data.writeUInt16BE(this.pizza.toppings, 0); callback(this.RESULT_SUCCESS, data); } }; -module.exports = PizzaToppingsCharacteristic; \ No newline at end of file +module.exports = PizzaToppingsCharacteristic; diff --git a/lib/bleno.js b/lib/bleno.js index 0ec8b18e..0919ee02 100644 --- a/lib/bleno.js +++ b/lib/bleno.js @@ -134,9 +134,9 @@ Bleno.prototype.startAdvertisingIBeacon = function(uuid, major, minor, measuredP } } else { var undashedUuid = UuidUtil.removeDashes(uuid); - var uuidData = new Buffer(undashedUuid, 'hex'); + var uuidData = Buffer.from(undashedUuid, 'hex'); var uuidDataLength = uuidData.length; - var iBeaconData = new Buffer(uuidData.length + 5); + var iBeaconData = Buffer.alloc(uuidData.length + 5); for (var i = 0; i < uuidDataLength; i++) { iBeaconData[i] = uuidData[i]; diff --git a/lib/descriptor.js b/lib/descriptor.js index 2e42682e..8dda1c00 100644 --- a/lib/descriptor.js +++ b/lib/descriptor.js @@ -4,7 +4,7 @@ var UuidUtil = require('./uuid-util'); function Descriptor(options) { this.uuid = UuidUtil.removeDashes(options.uuid); - this.value = options.value || new Buffer(0); + this.value = options.value || Buffer.alloc(0); } Descriptor.prototype.toString = function() { diff --git a/lib/hci-socket/crypto.js b/lib/hci-socket/crypto.js index 148f62d7..b9300804 100644 --- a/lib/hci-socket/crypto.js +++ b/lib/hci-socket/crypto.js @@ -15,7 +15,7 @@ function c1(k, r, pres, preq, iat, ia, rat, ra) { var p2 = Buffer.concat([ ra, ia, - new Buffer('00000000', 'hex') + Buffer.from('00000000', 'hex') ]); var res = xor(r, p1); @@ -47,7 +47,7 @@ function e(key, data) { } function xor(b1, b2) { - var result = new Buffer(b1.length); + var result = Buffer.alloc(b1.length); for (var i = 0; i < b1.length; i++) { result[i] = b1[i] ^ b2[i]; @@ -57,7 +57,7 @@ function xor(b1, b2) { } function swap(input) { - var output = new Buffer(input.length); + var output = Buffer.alloc(input.length); for (var i = 0; i < output.length; i++) { output[i] = input[input.length - i - 1]; diff --git a/lib/hci-socket/gap.js b/lib/hci-socket/gap.js index 57382876..7cf14734 100644 --- a/lib/hci-socket/gap.js +++ b/lib/hci-socket/gap.js @@ -41,7 +41,7 @@ Gap.prototype.startAdvertising = function(name, serviceUuids) { if (serviceUuids && serviceUuids.length) { for (i = 0; i < serviceUuids.length; i++) { - var serviceUuid = new Buffer(serviceUuids[i].match(/.{1,2}/g).reverse().join(''), 'hex'); + var serviceUuid = Buffer.from(serviceUuids[i].match(/.{1,2}/g).reverse().join(''), 'hex'); if (serviceUuid.length === 2) { serviceUuids16bit.push(serviceUuid); @@ -59,8 +59,8 @@ Gap.prototype.startAdvertising = function(name, serviceUuids) { advertisementDataLength += 2 + 16 * serviceUuids128bit.length; } - var advertisementData = new Buffer(advertisementDataLength); - var scanData = new Buffer(scanDataLength); + var advertisementData = Buffer.alloc(advertisementDataLength); + var scanData = Buffer.alloc(scanDataLength); // flags advertisementData.writeUInt8(2, 0); @@ -97,7 +97,7 @@ Gap.prototype.startAdvertising = function(name, serviceUuids) { // name if (name && name.length) { - var nameBuffer = new Buffer(name); + var nameBuffer = Buffer.from(name); scanData.writeUInt8(1 + nameBuffer.length, 0); scanData.writeUInt8(0x08, 1); @@ -116,8 +116,8 @@ Gap.prototype.startAdvertisingIBeacon = function(data) { var advertisementDataLength = 5 + manufacturerDataLength; var scanDataLength = 0; - var advertisementData = new Buffer(advertisementDataLength); - var scanData = new Buffer(0); + var advertisementData = Buffer.alloc(advertisementDataLength); + var scanData = Buffer.alloc(0); // flags advertisementData.writeUInt8(2, 0); @@ -136,8 +136,8 @@ Gap.prototype.startAdvertisingIBeacon = function(data) { }; Gap.prototype.startAdvertisingWithEIRData = function(advertisementData, scanData) { - advertisementData = advertisementData || new Buffer(0); - scanData = scanData || new Buffer(0); + advertisementData = advertisementData || Buffer.alloc(0); + scanData = scanData || Buffer.alloc(0); debug('startAdvertisingWithEIRData: advertisement data = ' + advertisementData.toString('hex') + ', scan data = ' + scanData.toString('hex')); diff --git a/lib/hci-socket/gatt.js b/lib/hci-socket/gatt.js index 818e2176..18dc52bf 100644 --- a/lib/hci-socket/gatt.js +++ b/lib/hci-socket/gatt.js @@ -88,14 +88,14 @@ Gatt.prototype.setServices = function(services) { uuid: '2a00', properties: ['read'], secure: [], - value: new Buffer(deviceName), + value: Buffer.from(deviceName), descriptors: [] }, { uuid: '2a01', properties: ['read'], secure: [], - value: new Buffer([0x80, 0x00]), + value: Buffer.from([0x80, 0x00]), descriptors: [] } ] @@ -107,7 +107,7 @@ Gatt.prototype.setServices = function(services) { uuid: '2a05', properties: ['indicate'], secure: [], - value: new Buffer([0x00, 0x00, 0x00, 0x00]), + value: Buffer.from([0x00, 0x00, 0x00, 0x00]), descriptors: [] } ] @@ -214,7 +214,7 @@ Gatt.prototype.setServices = function(services) { attribute: characteristic, properties: (0x02 | 0x04 | 0x08), // read/write secure: (secure & 0x10) ? (0x02 | 0x04 | 0x08) : 0, - value: new Buffer([0x00, 0x00]) + value: Buffer.from([0x00, 0x00]) }; } @@ -282,7 +282,7 @@ Gatt.prototype.onAclStreamEnd = function() { if (this._handles[i] && this._handles[i].type === 'descriptor' && this._handles[i].uuid === '2902' && this._handles[i].value.readUInt16LE(0) !== 0) { - this._handles[i].value = new Buffer([0x00, 0x00]); + this._handles[i].value = Buffer.from([0x00, 0x00]); if (this._handles[i].attribute && this._handles[i].attribute.emit) { this._handles[i].attribute.emit('unsubscribe'); @@ -297,7 +297,7 @@ Gatt.prototype.send = function(data) { }; Gatt.prototype.errorResponse = function(opcode, handle, status) { - var buf = new Buffer(5); + var buf = Buffer.alloc(5); buf.writeUInt8(ATT_OP_ERROR, 0); buf.writeUInt8(opcode, 1); @@ -383,7 +383,7 @@ Gatt.prototype.handleMtuRequest = function(request) { this.emit('mtuChange', this._mtu); - var response = new Buffer(3); + var response = Buffer.alloc(3); response.writeUInt8(ATT_OP_MTU_RESP, 0); response.writeUInt16LE(mtu, 1); @@ -445,7 +445,7 @@ Gatt.prototype.handleFindInfoRequest = function(request) { var maxInfo = Math.floor((this._mtu - 2) / lengthPerInfo); numInfo = Math.min(numInfo, maxInfo); - response = new Buffer(2 + numInfo * lengthPerInfo); + response = Buffer.alloc(2 + numInfo * lengthPerInfo); response[0] = ATT_OP_FIND_INFO_RESP; response[1] = (uuidSize === 2) ? 0x01 : 0x2; @@ -455,7 +455,7 @@ Gatt.prototype.handleFindInfoRequest = function(request) { response.writeUInt16LE(info.handle, 2 + i * lengthPerInfo); - uuid = new Buffer(info.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); + uuid = Buffer.from(info.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); for (var j = 0; j < uuid.length; j++) { response[2 + i * lengthPerInfo + 2 + j] = uuid[j]; } @@ -500,7 +500,7 @@ Gatt.prototype.handleFindByTypeRequest = function(request) { numHandles = Math.min(numHandles, maxHandles); - response = new Buffer(1 + numHandles * lengthPerHandle); + response = Buffer.alloc(1 + numHandles * lengthPerHandle); response[0] = ATT_OP_FIND_BY_TYPE_RESP; @@ -558,7 +558,7 @@ Gatt.prototype.handleReadByGroupRequest = function(request) { var maxServices = Math.floor((this._mtu - 2) / lengthPerService); numServices = Math.min(numServices, maxServices); - response = new Buffer(2 + numServices * lengthPerService); + response = Buffer.alloc(2 + numServices * lengthPerService); response[0] = ATT_OP_READ_BY_GROUP_RESP; response[1] = lengthPerService; @@ -569,7 +569,7 @@ Gatt.prototype.handleReadByGroupRequest = function(request) { response.writeUInt16LE(service.startHandle, 2 + i * lengthPerService); response.writeUInt16LE(service.endHandle, 2 + i * lengthPerService + 2); - var serviceUuid = new Buffer(service.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); + var serviceUuid = Buffer.from(service.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); for (var j = 0; j < serviceUuid.length; j++) { response[2 + i * lengthPerService + 4 + j] = serviceUuid[j]; } @@ -626,7 +626,7 @@ Gatt.prototype.handleReadByTypeRequest = function(request) { var maxCharacteristics = Math.floor((this._mtu - 2) / lengthPerCharacteristic); numCharacteristics = Math.min(numCharacteristics, maxCharacteristics); - response = new Buffer(2 + numCharacteristics * lengthPerCharacteristic); + response = Buffer.alloc(2 + numCharacteristics * lengthPerCharacteristic); response[0] = ATT_OP_READ_BY_TYPE_RESP; response[1] = lengthPerCharacteristic; @@ -638,7 +638,7 @@ Gatt.prototype.handleReadByTypeRequest = function(request) { response.writeUInt8(characteristic.properties, 2 + i * lengthPerCharacteristic + 2); response.writeUInt16LE(characteristic.valueHandle, 2 + i * lengthPerCharacteristic + 3); - var characteristicUuid = new Buffer(characteristic.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); + var characteristicUuid = Buffer.from(characteristic.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); for (var j = 0; j < characteristicUuid.length; j++) { response[2 + i * lengthPerCharacteristic + 5 + j] = characteristicUuid[j]; } @@ -679,7 +679,7 @@ Gatt.prototype.handleReadByTypeRequest = function(request) { if (ATT_ECODE_SUCCESS === result) { var dataLength = Math.min(data.length, this._mtu - 4); - callbackResponse = new Buffer(4 + dataLength); + callbackResponse = Buffer.alloc(4 + dataLength); callbackResponse[0] = ATT_OP_READ_BY_TYPE_RESP; callbackResponse[1] = dataLength + 2; @@ -735,7 +735,7 @@ Gatt.prototype.handleReadOrReadBlobRequest = function(request) { if (ATT_ECODE_SUCCESS === result) { var dataLength = Math.min(data.length, this._mtu - 1); - callbackResponse = new Buffer(1 + dataLength); + callbackResponse = Buffer.alloc(1 + dataLength); callbackResponse[0] = (requestType === ATT_OP_READ_BLOB_REQ) ? ATT_OP_READ_BLOB_RESP : ATT_OP_READ_RESP; for (i = 0; i < dataLength; i++) { @@ -753,12 +753,12 @@ Gatt.prototype.handleReadOrReadBlobRequest = function(request) { if (handleType === 'service' || handleType === 'includedService') { result = ATT_ECODE_SUCCESS; - data = new Buffer(handle.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); + data = Buffer.from(handle.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); } else if (handleType === 'characteristic') { - var uuid = new Buffer(handle.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); + var uuid = Buffer.from(handle.uuid.match(/.{1,2}/g).reverse().join(''), 'hex'); result = ATT_ECODE_SUCCESS; - data = new Buffer(3 + uuid.length); + data = Buffer.alloc(3 + uuid.length); data.writeUInt8(handle.properties, 0); data.writeUInt16LE(handle.valueHandle, 1); @@ -793,7 +793,7 @@ Gatt.prototype.handleReadOrReadBlobRequest = function(request) { } if (data && typeof data === 'string') { - data = new Buffer(data); + data = Buffer.from(data); } if (result === ATT_ECODE_SUCCESS && data && offset) { @@ -842,7 +842,7 @@ Gatt.prototype.handleWriteRequestOrCommand = function(request) { var callbackResponse = null; if (ATT_ECODE_SUCCESS === result) { - callbackResponse = new Buffer([ATT_OP_WRITE_RESP]); + callbackResponse = Buffer.from([ATT_OP_WRITE_RESP]); } else { callbackResponse = this.errorResponse(requestType, valueHandle, result); } @@ -876,7 +876,7 @@ Gatt.prototype.handleWriteRequestOrCommand = function(request) { var i; if (useNotify) { - var notifyMessage = new Buffer(3 + dataLength); + var notifyMessage = Buffer.alloc(3 + dataLength); notifyMessage.writeUInt8(ATT_OP_HANDLE_NOTIFY, 0); notifyMessage.writeUInt16LE(valueHandle, 1); @@ -890,7 +890,7 @@ Gatt.prototype.handleWriteRequestOrCommand = function(request) { attribute.emit('notify'); } else if (useIndicate) { - var indicateMessage = new Buffer(3 + dataLength); + var indicateMessage = Buffer.alloc(3 + dataLength); indicateMessage.writeUInt8(ATT_OP_HANDLE_IND, 0); indicateMessage.writeUInt16LE(valueHandle, 1); @@ -960,7 +960,7 @@ Gatt.prototype.handlePrepareWriteRequest = function(request) { data ]); - response = new Buffer(request.length); + response = Buffer.alloc(request.length); request.copy(response); response[0] = ATT_OP_PREP_WRITE_RESP; } else { @@ -974,7 +974,7 @@ Gatt.prototype.handlePrepareWriteRequest = function(request) { data: data }; - response = new Buffer(request.length); + response = Buffer.alloc(request.length); request.copy(response); response[0] = ATT_OP_PREP_WRITE_RESP; } @@ -1001,14 +1001,14 @@ Gatt.prototype.handleExecuteWriteRequest = function(request) { var valueHandle = this._preparedWriteRequest.valueHandle; if (flag === 0x00) { - response = new Buffer([ATT_OP_EXEC_WRITE_RESP]); + response = Buffer.from([ATT_OP_EXEC_WRITE_RESP]); } else if (flag === 0x01) { var callback = (function(requestType, valueHandle) { return function(result) { var callbackResponse = null; if (ATT_ECODE_SUCCESS === result) { - callbackResponse = new Buffer([ATT_OP_EXEC_WRITE_RESP]); + callbackResponse = Buffer.from([ATT_OP_EXEC_WRITE_RESP]); } else { callbackResponse = this.errorResponse(requestType, valueHandle, result); } diff --git a/lib/hci-socket/hci.js b/lib/hci-socket/hci.js index 634a8f92..df55f109 100644 --- a/lib/hci-socket/hci.js +++ b/lib/hci-socket/hci.js @@ -150,7 +150,7 @@ Hci.prototype.initDev = function() { }; Hci.prototype.setSocketFilter = function() { - var filter = new Buffer(14); + var filter = Buffer.alloc(14); var typeMask = (1 << HCI_EVENT_PKT)| (1 << HCI_ACLDATA_PKT); var eventMask1 = (1 << EVT_DISCONN_COMPLETE) | (1 << EVT_ENCRYPT_CHANGE) | (1 << EVT_CMD_COMPLETE) | (1 << EVT_CMD_STATUS) | ( 1 << EVT_NUMBER_OF_COMPLETED_PACKETS); var eventMask2 = (1 << (EVT_LE_META_EVENT - 32)); @@ -166,8 +166,8 @@ Hci.prototype.setSocketFilter = function() { }; Hci.prototype.setEventMask = function() { - var cmd = new Buffer(12); - var eventMask = new Buffer('fffffbff07f8bf3d', 'hex'); + var cmd = Buffer.alloc(12); + var eventMask = Buffer.from('fffffbff07f8bf3d', 'hex'); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -183,7 +183,7 @@ Hci.prototype.setEventMask = function() { }; Hci.prototype.reset = function() { - var cmd = new Buffer(4); + var cmd = Buffer.alloc(4); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -197,7 +197,7 @@ Hci.prototype.reset = function() { }; Hci.prototype.readLeHostSupported = function() { - var cmd = new Buffer(4); + var cmd = Buffer.alloc(4); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -211,7 +211,7 @@ Hci.prototype.readLeHostSupported = function() { }; Hci.prototype.writeLeHostSupported = function() { - var cmd = new Buffer(6); + var cmd = Buffer.alloc(6); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -229,7 +229,7 @@ Hci.prototype.writeLeHostSupported = function() { }; Hci.prototype.readLocalVersion = function() { - var cmd = new Buffer(4); + var cmd = Buffer.alloc(4); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -243,7 +243,7 @@ Hci.prototype.readLocalVersion = function() { }; Hci.prototype.readBdAddr = function() { - var cmd = new Buffer(4); + var cmd = Buffer.alloc(4); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -257,8 +257,8 @@ Hci.prototype.readBdAddr = function() { }; Hci.prototype.setLeEventMask = function() { - var cmd = new Buffer(12); - var leEventMask = new Buffer('1f00000000000000', 'hex'); + var cmd = Buffer.alloc(12); + var leEventMask = Buffer.from('1f00000000000000', 'hex'); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -274,7 +274,7 @@ Hci.prototype.setLeEventMask = function() { }; Hci.prototype.setAdvertisingParameters = function() { - var cmd = new Buffer(19); + var cmd = Buffer.alloc(19); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -291,7 +291,7 @@ Hci.prototype.setAdvertisingParameters = function() { cmd.writeUInt8(0x00, 8); // adv type cmd.writeUInt8(0x00, 9); // own addr typ cmd.writeUInt8(0x00, 10); // direct addr type - (new Buffer('000000000000', 'hex')).copy(cmd, 11); // direct addr + (Buffer.from('000000000000', 'hex')).copy(cmd, 11); // direct addr cmd.writeUInt8(0x07, 17); cmd.writeUInt8(0x00, 18); @@ -300,7 +300,7 @@ Hci.prototype.setAdvertisingParameters = function() { }; Hci.prototype.setAdvertisingData = function(data) { - var cmd = new Buffer(36); + var cmd = Buffer.alloc(36); cmd.fill(0x00); @@ -320,7 +320,7 @@ Hci.prototype.setAdvertisingData = function(data) { }; Hci.prototype.setScanResponseData = function(data) { - var cmd = new Buffer(36); + var cmd = Buffer.alloc(36); cmd.fill(0x00); @@ -340,7 +340,7 @@ Hci.prototype.setScanResponseData = function(data) { }; Hci.prototype.setAdvertiseEnable = function(enabled) { - var cmd = new Buffer(5); + var cmd = Buffer.alloc(5); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -357,7 +357,7 @@ Hci.prototype.setAdvertiseEnable = function(enabled) { }; Hci.prototype.disconnect = function(handle, reason) { - var cmd = new Buffer(7); + var cmd = Buffer.alloc(7); reason = reason || HCI_OE_USER_ENDED_CONNECTION; @@ -377,7 +377,7 @@ Hci.prototype.disconnect = function(handle, reason) { }; Hci.prototype.readRssi = function(handle) { - var cmd = new Buffer(6); + var cmd = Buffer.alloc(6); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -394,7 +394,7 @@ Hci.prototype.readRssi = function(handle) { }; Hci.prototype.leReadBufferSize = function() { - var cmd = new Buffer(4); + var cmd = Buffer.alloc(4); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -408,7 +408,7 @@ Hci.prototype.leReadBufferSize = function() { }; Hci.prototype.readBufferSize = function() { - var cmd = new Buffer(4); + var cmd = Buffer.alloc(4); // header cmd.writeUInt8(HCI_COMMAND_PKT, 0); @@ -424,7 +424,7 @@ Hci.prototype.readBufferSize = function() { Hci.prototype.queueAclDataPkt = function(handle, cid, data) { var hf = handle | ACL_START_NO_FLUSH << 12; // l2cap pdu may be fragmented on hci level - var l2capPdu = new Buffer(4 + data.length); + var l2capPdu = Buffer.alloc(4 + data.length); l2capPdu.writeUInt16LE(data.length, 0); l2capPdu.writeUInt16LE(cid, 2); data.copy(l2capPdu, 4); @@ -433,7 +433,7 @@ Hci.prototype.queueAclDataPkt = function(handle, cid, data) { while (l2capPdu.length) { var frag = l2capPdu.slice(0, this._aclMtu); l2capPdu = l2capPdu.slice(frag.length); - var pkt = new Buffer(5 + frag.length); + var pkt = Buffer.alloc(5 + frag.length); // hci header pkt.writeUInt8(HCI_ACLDATA_PKT, 0); @@ -442,14 +442,14 @@ Hci.prototype.queueAclDataPkt = function(handle, cid, data) { pkt.writeUInt16LE(frag.length, 3); // hci pdu length frag.copy(pkt, 5); - + this._aclOutQueue.push({ handle: handle, pkt: pkt, fragId: fragId++ }); } - + this.pushAclOutQueue(); }; @@ -462,7 +462,7 @@ Hci.prototype.pushAclOutQueue = function() { inProgress++; this.writeOneAclDataPkt(); } - + if (inProgress >= this._aclMaxInProgress && this._aclOutQueue.length) { debug("acl out queue congested"); debug("\tin progress = " + inProgress); @@ -498,7 +498,7 @@ Hci.prototype.onSocketData = function(data) { debug('\This might be OK in a multi role scenario in which the handle is part of a noble connection.'); return; } - + var reason = data.readUInt8(6); debug('\t\treason = ' + reason); @@ -747,7 +747,7 @@ Hci.prototype.processLeConnComplete = function(status, data) { debug('\t\t\tlatency = ' + latency); debug('\t\t\tsupervision timeout = ' + supervisionTimeout); debug('\t\t\tmaster clock accuracy = ' + masterClockAccuracy); - + this._mainHandle = handle; this._handleAclsInProgress[handle] = 0; diff --git a/lib/hci-socket/mgmt.js b/lib/hci-socket/mgmt.js index 18fc9c52..5bfe7c87 100644 --- a/lib/hci-socket/mgmt.js +++ b/lib/hci-socket/mgmt.js @@ -29,7 +29,7 @@ Mgmt.prototype.onSocketError = function(error) { }; Mgmt.prototype.addLongTermKey = function(address, addressType, authenticated, master, ediv, rand, key) { - var ltkInfo = new Buffer(LTK_INFO_SIZE); + var ltkInfo = Buffer.alloc(LTK_INFO_SIZE); address.copy(ltkInfo, 0); ltkInfo.writeUInt8(addressType.readUInt8(0) + 1, 6); // BDADDR_LE_PUBLIC = 0x01, BDADDR_LE_RANDOM 0x02, so add one @@ -55,7 +55,7 @@ Mgmt.prototype.clearLongTermKeys = function() { Mgmt.prototype.loadLongTermKeys = function() { var numLongTermKeys = this._ltkInfos.length; - var op = new Buffer(2 + numLongTermKeys * LTK_INFO_SIZE); + var op = Buffer.alloc(2 + numLongTermKeys * LTK_INFO_SIZE); op.writeUInt16LE(numLongTermKeys, 0); @@ -73,7 +73,7 @@ Mgmt.prototype.write = function(opcode, index, data) { length = data.length; } - var pkt = new Buffer(6 + length); + var pkt = Buffer.alloc(6 + length); pkt.writeUInt16LE(opcode, 0); pkt.writeUInt16LE(index, 2); diff --git a/lib/hci-socket/smp.js b/lib/hci-socket/smp.js index 87b32c32..49de2cc1 100644 --- a/lib/hci-socket/smp.js +++ b/lib/hci-socket/smp.js @@ -21,10 +21,10 @@ var SMP_UNSPECIFIED = 0x08; var Smp = function(aclStream, localAddressType, localAddress, remoteAddressType, remoteAddress) { this._aclStream = aclStream; - this._iat = new Buffer([(remoteAddressType === 'random') ? 0x01 : 0x00]); - this._ia = new Buffer(remoteAddress.split(':').reverse().join(''), 'hex'); - this._rat = new Buffer([(localAddressType === 'random') ? 0x01 : 0x00]); - this._ra = new Buffer(localAddress.split(':').reverse().join(''), 'hex'); + this._iat = Buffer.from([(remoteAddressType === 'random') ? 0x01 : 0x00]); + this._ia = Buffer.from(remoteAddress.split(':').reverse().join(''), 'hex'); + this._rat = Buffer.from([(localAddressType === 'random') ? 0x01 : 0x00]); + this._ra = Buffer.from(localAddress.split(':').reverse().join(''), 'hex'); this._stk = null; this._random = null; @@ -65,12 +65,12 @@ Smp.prototype.onAclStreamEncryptChange = function(encrypted) { if (encrypted) { if (this._stk && this._diversifier && this._random) { this.write(Buffer.concat([ - new Buffer([SMP_ENCRYPT_INFO]), + Buffer.from([SMP_ENCRYPT_INFO]), this._stk ])); this.write(Buffer.concat([ - new Buffer([SMP_MASTER_IDENT]), + Buffer.from([SMP_MASTER_IDENT]), this._diversifier, this._random ])); @@ -79,7 +79,7 @@ Smp.prototype.onAclStreamEncryptChange = function(encrypted) { }; Smp.prototype.onAclStreamLtkNegReply = function() { - this.write(new Buffer([ + this.write(Buffer.from([ SMP_PAIRING_FAILED, SMP_UNSPECIFIED ])); @@ -97,7 +97,7 @@ Smp.prototype.onAclStreamEnd = function() { Smp.prototype.handlePairingRequest = function(data) { this._preq = data; - this._pres = new Buffer([ + this._pres = Buffer.from([ SMP_PAIRING_RESPONSE, 0x03, // IO capability: NoInputNoOutput 0x00, // OOB data: Authentication data not present @@ -113,11 +113,11 @@ Smp.prototype.handlePairingRequest = function(data) { Smp.prototype.handlePairingConfirm = function(data) { this._pcnf = data; - this._tk = new Buffer('00000000000000000000000000000000', 'hex'); + this._tk = Buffer.from('00000000000000000000000000000000', 'hex'); this._r = crypto.r(); this.write(Buffer.concat([ - new Buffer([SMP_PAIRING_CONFIRM]), + Buffer.from([SMP_PAIRING_CONFIRM]), crypto.c1(this._tk, this._r, this._pres, this._preq, this._iat, this._ia, this._rat, this._ra) ])); }; @@ -126,23 +126,23 @@ Smp.prototype.handlePairingRandom = function(data) { var r = data.slice(1); var pcnf = Buffer.concat([ - new Buffer([SMP_PAIRING_CONFIRM]), + Buffer.from([SMP_PAIRING_CONFIRM]), crypto.c1(this._tk, r, this._pres, this._preq, this._iat, this._ia, this._rat, this._ra) ]); if (this._pcnf.toString('hex') === pcnf.toString('hex')) { - this._diversifier = new Buffer('0000', 'hex'); - this._random = new Buffer('0000000000000000', 'hex'); + this._diversifier = Buffer.from('0000', 'hex'); + this._random = Buffer.from('0000000000000000', 'hex'); this._stk = crypto.s1(this._tk, this._r, r); mgmt.addLongTermKey(this._ia, this._iat, 0, 0, this._diversifier, this._random, this._stk); this.write(Buffer.concat([ - new Buffer([SMP_PAIRING_RANDOM]), + Buffer.from([SMP_PAIRING_RANDOM]), this._r ])); } else { - this.write(new Buffer([ + this.write(Buffer.from([ SMP_PAIRING_FAILED, SMP_PAIRING_CONFIRM ])); diff --git a/test.js b/test.js index d1c8ea1e..732954b5 100644 --- a/test.js +++ b/test.js @@ -13,7 +13,7 @@ var StaticReadOnlyCharacteristic = function() { StaticReadOnlyCharacteristic.super_.call(this, { uuid: 'fffffffffffffffffffffffffffffff1', properties: ['read'], - value: new Buffer('value'), + value: Buffer.find('value'), descriptors: [ new BlenoDescriptor({ uuid: '2901', @@ -35,7 +35,7 @@ util.inherits(DynamicReadOnlyCharacteristic, BlenoCharacteristic); DynamicReadOnlyCharacteristic.prototype.onReadRequest = function(offset, callback) { var result = this.RESULT_SUCCESS; - var data = new Buffer('dynamic value'); + var data = Buffer.find('dynamic value'); if (offset > data.length) { result = this.RESULT_INVALID_OFFSET; @@ -58,7 +58,7 @@ util.inherits(LongDynamicReadOnlyCharacteristic, BlenoCharacteristic); LongDynamicReadOnlyCharacteristic.prototype.onReadRequest = function(offset, callback) { var result = this.RESULT_SUCCESS; - var data = new Buffer(512); + var data = Buffer.alloc(512); for (var i = 0; i < data.length; i++) { data[i] = i % 256; @@ -103,7 +103,7 @@ NotifyOnlyCharacteristic.prototype.onSubscribe = function(maxValueSize, updateVa this.counter = 0; this.changeInterval = setInterval(function() { - var data = new Buffer(4); + var data = Buffer.alloc(4); data.writeUInt32LE(this.counter, 0); console.log('NotifyOnlyCharacteristic update value: ' + this.counter); @@ -139,7 +139,7 @@ IndicateOnlyCharacteristic.prototype.onSubscribe = function(maxValueSize, update this.counter = 0; this.changeInterval = setInterval(function() { - var data = new Buffer(4); + var data = Buffer.alloc(4); data.writeUInt32LE(this.counter, 0); console.log('IndicateOnlyCharacteristic update value: ' + this.counter); diff --git a/test/test-characteristic.js b/test/test-characteristic.js index 29c04c02..e49040bb 100644 --- a/test/test-characteristic.js +++ b/test/test-characteristic.js @@ -8,7 +8,7 @@ describe('Characteristic', function() { var mockUuid = 'mockuuid'; var mockProperties = ['property1', 'property2', 'property3']; var mockSecure = ['secure1', 'secure2', 'secure3']; - var mockValue = new Buffer('mock value'); + var mockValue = Buffer.from('mock value'); var mockDescriptors = [{}, {}, {}]; var mockOnReadRequest = function() {}; @@ -152,7 +152,7 @@ describe('Characteristic', function() { it('should handle write request', function(done) { var characteristic = new Characteristic({}); - characteristic.emit('writeRequest', new Buffer(0), 0, false, function(result) { + characteristic.emit('writeRequest', Buffer.alloc(0), 0, false, function(result) { result.should.equal(0x0e); done(); diff --git a/test/test-descriptor.js b/test/test-descriptor.js index 5370ee76..52d00eb5 100644 --- a/test/test-descriptor.js +++ b/test/test-descriptor.js @@ -6,7 +6,7 @@ var Descriptor = require('../lib/descriptor'); describe('Descriptor', function() { var mockUuid = 'mockuuid'; - var mockValue = new Buffer('mock value'); + var mockValue = Buffer.from('mock value'); it('should create with uuid option', function() { var descriptor = new Descriptor({ @@ -46,4 +46,4 @@ describe('Descriptor', function() { descriptor.toString().should.equal('{"uuid":"mockuuid","value":"mock value"}'); }); }); -}); \ No newline at end of file +});