Socket
Socket
Sign inDemoInstall

qcloud-iotexplorer-bluetooth-adapter

Package Overview
Dependencies
Maintainers
5
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qcloud-iotexplorer-bluetooth-adapter - npm Package Compare versions

Comparing version 0.8.7-alpha.0 to 0.10.0-alpha.0

2

lib/h5/BlueToothAdapter4H5.js

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BlueToothAdapter4H5=void 0;var tslib_1=require("tslib"),base_1=require("../base"),BlueToothBridge_1=require("./BlueToothBridge"),BlueToothAdapter4H5=function(e){function t(t){var o=t.h5Websocket,n=t.devMode,i=t.actions,r=tslib_1.__rest(t,["h5Websocket","devMode","actions"]),c=this,s=new BlueToothBridge_1.BlueToothBridge({h5Websocket:o});return(c=e.call(this,tslib_1.__assign({actions:tslib_1.__assign({registerDevice:function(e){var t=e.deviceName,o=e.productId;return tslib_1.__awaiter(c,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){switch(e.label){case 0:return[4,s.control("registryDevice",{deviceName:t,productId:this.devMode?o:""})];case 1:return e.sent(),[2]}}))}))},bindDevice:function(e){var t=e.deviceName,o=e.productId;return tslib_1.__awaiter(c,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){switch(e.label){case 0:return[4,s.control("bindDevice",{deviceName:t,productId:this.devMode?o:""})];case 1:return e.sent(),[2]}}))}))}},i),devMode:n,h5Websocket:o,bluetoothApi:s},r))||this)._onDeviceFoundThrottle=0,c._blueToothBridge=s,c._h5Websocket.on("connect",(function(){c.syncDeviceConnectStatus()})),c._h5Websocket.on("message",(function(e){e&&"connect"===e.action&&c.syncDeviceConnectStatus()})),c}return tslib_1.__extends(t,e),t.prototype.onBluetoothDeviceFound=function(e){var t=(void 0===e?{}:e).devices;return tslib_1.__awaiter(this,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){switch(e.label){case 0:return t?[3,2]:[4,this.getBluetoothDevices()];case 1:return t=e.sent(),console.log("onBluetoothDeviceFound from getBluetoothDevices",t),[3,3];case 2:console.log("onBluetoothDeviceFound from mp event",t),e.label=3;case 3:try{"function"==typeof this._onBluetoothDeviceFoundHandler&&this._onBluetoothDeviceFoundHandler(t)}catch(e){console.error("_onBluetoothDeviceFoundHandler error",e)}return[2,t]}}))}))},t.prototype.syncDeviceConnectStatus=function(){var e=this._deviceAdapterStore.getAll().filter((function(e){return e.isConnected})).map((function(e){return{deviceId:e.deviceId,connected:e.isConnected}}));e.length&&this._blueToothBridge.control("syncDeviceConnectStatus",{devices:e})},t}(base_1.BlueToothAdapter);exports.BlueToothAdapter4H5=BlueToothAdapter4H5;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BlueToothAdapter4H5=void 0;var tslib_1=require("tslib"),base_1=require("../base"),BlueToothBridge_1=require("./BlueToothBridge"),BlueToothAdapter4H5=function(e){function t(t){var o=t.h5Websocket,n=t.devMode,i=t.actions,r=tslib_1.__rest(t,["h5Websocket","devMode","actions"]),c=this,s=new BlueToothBridge_1.BlueToothBridge({h5Websocket:o});return c=e.call(this,tslib_1.__assign({actions:tslib_1.__assign({registerDevice:function(e){var t=e.deviceName,o=e.productId;return tslib_1.__awaiter(c,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){switch(e.label){case 0:return[4,s.control("registryDevice",{deviceName:t,productId:this.devMode?o:""})];case 1:return e.sent(),[2]}}))}))},bindDevice:function(e){var t=e.deviceName,o=e.productId;return tslib_1.__awaiter(c,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){switch(e.label){case 0:return[4,s.control("bindDevice",{deviceName:t,productId:this.devMode?o:""})];case 1:return e.sent(),[2]}}))}))}},i),devMode:n,h5Websocket:o,bluetoothApi:s},r))||this,c._onDeviceFoundThrottle=0,c._blueToothBridge=s,c._h5Websocket.on("connect",(function(){c.syncDeviceConnectStatus()})),c._h5Websocket.on("message",(function(e){e&&"connect"===e.action&&c.syncDeviceConnectStatus()})),c}return tslib_1.__extends(t,e),t.prototype.onBluetoothDeviceFound=function(e){var t=(void 0===e?{}:e).devices;return tslib_1.__awaiter(this,void 0,void 0,(function(){return tslib_1.__generator(this,(function(e){switch(e.label){case 0:return t?[3,2]:[4,this.getBluetoothDevices()];case 1:return t=e.sent(),console.log("onBluetoothDeviceFound from getBluetoothDevices",t),[3,3];case 2:console.log("onBluetoothDeviceFound from mp event",t),e.label=3;case 3:try{"function"==typeof this._onBluetoothDeviceFoundHandler&&this._onBluetoothDeviceFoundHandler(t)}catch(e){console.error("_onBluetoothDeviceFoundHandler error",e)}return[2,t]}}))}))},t.prototype.syncDeviceConnectStatus=function(){var e=this._deviceAdapterStore.getAll().filter((function(e){return e.isConnected})).map((function(e){return{deviceId:e.deviceId,connected:e.isConnected}}));e.length&&this._blueToothBridge.control("syncDeviceConnectStatus",{devices:e})},t}(base_1.BlueToothAdapter);exports.BlueToothAdapter4H5=BlueToothAdapter4H5;
//# sourceMappingURL=BlueToothAdapter4H5.js.map
{
"name": "qcloud-iotexplorer-bluetooth-adapter",
"version": "0.8.7-alpha.0",
"version": "0.10.0-alpha.0",
"description": "",

@@ -17,6 +17,6 @@ "main": "lib/index.js",

"dependencies": {
"event-emitter-for-miniprogram": "^0.8.6-alpha.0",
"event-emitter-for-miniprogram": "^0.10.0-alpha.0",
"lodash.uniqwith": "^4.5.0",
"qcloud-iotexplorer-appdev-sdk": "^1.9.7-alpha.0",
"qcloud-iotexplorer-common-libs": "^0.9.7-alpha.0",
"qcloud-iotexplorer-appdev-sdk": "^2.1.0-alpha.0",
"qcloud-iotexplorer-common-libs": "^0.10.0-alpha.0",
"tslib": "^2.0.1"

@@ -27,3 +27,3 @@ },

},
"gitHead": "a47b02aaf1e712f1f3ca0bf63f16dfb8b02af3a9"
"gitHead": "4a6ff2c3b5f8e1cb9ad484a245cbccbf81cfbf78"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc