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

qcloud-iotexplorer-appdev-plugin-wificonf-blecombo

Package Overview
Dependencies
Maintainers
3
Versions
174
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

qcloud-iotexplorer-appdev-plugin-wificonf-blecombo - npm Package Compare versions

Comparing version 1.1.6 to 1.1.7

2

lib/protocols/BleComboDualMode/BleComboDualModeDeviceAdapter.js

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboDualModeDeviceAdapter=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_bluetooth_adapter_1=require("qcloud-iotexplorer-bluetooth-adapter"),BleComboLLSync_1=require("../BleComboLLSync"),qcloud_iotexplorer_bluetooth_adapter_llsync_1=require("qcloud-iotexplorer-bluetooth-adapter-llsync"),hex2str=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.hex2str,REPORT_EVENT_TYPE=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,arrayBufferToHexStringArray=qcloud_iotexplorer_bluetooth_adapter_1.blueToothHelper.arrayBufferToHexStringArray,DUALMODE_SERVICEID="0000FFE8-65D0-4E20-B56A-E493541BA4E2",DUALMODE_SERVICEID16="0000FFE8-0000-1000-8000-00805F9B34FB",LLSyncDualModeDeviceAdapter=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tslib_1.__extends(t,e),t.serviceId16=DUALMODE_SERVICEID16,t.serviceId=DUALMODE_SERVICEID,t}(qcloud_iotexplorer_bluetooth_adapter_llsync_1.LLSyncDeviceAdapter),BleComboDualModeDeviceAdapter=function(e){function t(t){var r=e.call(this,t)||this;return r._bleDeviceAdapter=new LLSyncDualModeDeviceAdapter(t),["CONNECT_AUTH","DEVICE_INFO","BIND_AUTH","UNBIND_AUTH"].forEach((function(e){r.on(e,(function(){for(var t,o=[],i=0;i<arguments.length;i++)o[i]=arguments[i];console.info("emit connect_auth from dualmode adapter",o),(t=r._bleDeviceAdapter).emit.apply(t,tslib_1.__spread([e],o))}))})),r}return tslib_1.__extends(t,e),t.injectOptions=function(e){t.options=e,qcloud_iotexplorer_bluetooth_adapter_llsync_1.LLSyncDeviceAdapter.injectOptions(e)},t.prototype.toString=function(){return"[BleComboDualModeDeviceAdapter]"},Object.defineProperty(t.prototype,"authorized",{get:function(){return this._bleDeviceAdapter.authorized},enumerable:!1,configurable:!0}),t.prototype.authenticateConnection=function(e){return this._bleDeviceAdapter.authenticateConnection(e)},t.prototype.bindDevice=function(e){return this._bleDeviceAdapter.bindDevice(e)},t.prototype.unbindDevice=function(e){return this._bleDeviceAdapter.unbindDevice.call(this._bleDeviceAdapter,e)},t.prototype.controlDevice=function(e){return this._bleDeviceAdapter.connectDevice.call(this._bleDeviceAdapter,e)},t.prototype.init=function(){return this._bleDeviceAdapter.init()},t.serviceId16=DUALMODE_SERVICEID16,t.serviceId=DUALMODE_SERVICEID,t.deviceFilter=function(e,r){if(!e.advertisServiceUUIDs||!e.advertisServiceUUIDs.find((function(e){return e===t.serviceId16}))||!e.advertisData)return null;try{var o=Math.floor(10*Math.random())%10==1||!0,i=arrayBufferToHexStringArray(e.advertisData);o&&t.options.reporter.info(REPORT_EVENT_TYPE,{message:"收到广播",serviceId:t.serviceId,hexArr:i.join(",")});var n=parseInt(i[2],16)-(parseInt(i[2],16)>>2<<2),c=parseInt(i[2],16)>>4,l=r.productId&&r.deviceName?r.productId+"/"+r.deviceName:"",a=l?qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.get8ByteFromStr(""+l.replace("/","")):"",d=!!l,_="",s="",u="",p=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_STATE_MAP[n],D=[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_BINDED,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_CONNECTED].indexOf(p)>-1;if(D)u=i.slice(3,11).join("").toLocaleLowerCase(),s=i.slice(11).join("").toLocaleLowerCase(),_=r.productId;else{var v=i.slice(3,9);e.name&&-1===e.name.indexOf("_")&&(e.name=e.name+"_"+v.slice(0,2).join("")),_=hex2str(i.slice(9))}o&&t.options.reporter.info(REPORT_EVENT_TYPE,{message:"解析广播",serviceId:t.serviceId,data:{bindState:p||"x",targetDeviceId:l,targetDeviceIdentify:a,deviceUserIdentify:s||"x",deviceProductId:_||"x",deviceIdentify:u||"x"}});var E=function(){var o=tslib_1.__assign(tslib_1.__assign({},e),{standard:!0,bindState:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_STATE_MAP[p],serviceId:t.serviceId,deviceName:r.deviceName||"",productId:_,extendInfo:{moduleVersion:c}});return console.log("---设备匹配成功---",o),o};return d&&D&&u===a?E():d||D?null:E()}catch(e){console.error("llsync device filter error",e),t.options.reporter.error(REPORT_EVENT_TYPE,{message:"协议广播出错",error:e})}},t}(BleComboLLSync_1.BleComboLLSyncDeviceAdapter);exports.BleComboDualModeDeviceAdapter=BleComboDualModeDeviceAdapter;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboDualModeDeviceAdapter=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_bluetooth_adapter_1=require("qcloud-iotexplorer-bluetooth-adapter"),BleComboLLSync_1=require("../BleComboLLSync"),qcloud_iotexplorer_bluetooth_adapter_llsync_1=require("qcloud-iotexplorer-bluetooth-adapter-llsync"),hex2str=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.hex2str,REPORT_EVENT_TYPE=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,arrayBufferToHexStringArray=qcloud_iotexplorer_bluetooth_adapter_1.blueToothHelper.arrayBufferToHexStringArray,DUALMODE_SERVICEID="0000FFE8-65D0-4E20-B56A-E493541BA4E2",DUALMODE_SERVICEID16="0000FFE8-0000-1000-8000-00805F9B34FB",LLSyncDualModeDeviceAdapter=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return tslib_1.__extends(t,e),t.serviceId16=DUALMODE_SERVICEID16,t.serviceId=DUALMODE_SERVICEID,t}(qcloud_iotexplorer_bluetooth_adapter_llsync_1.LLSyncDeviceAdapter),BleComboDualModeDeviceAdapter=function(e){function t(t){var o=e.call(this,t)||this;return o._bleDeviceAdapter=new LLSyncDualModeDeviceAdapter(t),["CONNECT_AUTH","DEVICE_INFO","BIND_AUTH","UNBIND_AUTH"].forEach((function(e){o.on(e,(function(){for(var t,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];console.info("emit connect_auth from dualmode adapter",r),(t=o._bleDeviceAdapter).emit.apply(t,tslib_1.__spread([e],r))}))})),o.on("connect",(function(e){console.info("ble connected",e),o._bleDeviceAdapter._deviceConnected=!0})),o.on("disconnect",(function(e){console.info("ble disconnect",e),o._bleDeviceAdapter._deviceConnected=!1})),o}return tslib_1.__extends(t,e),t.injectOptions=function(e){t.options=e,qcloud_iotexplorer_bluetooth_adapter_llsync_1.LLSyncDeviceAdapter.injectOptions(e)},t.prototype.toString=function(){return"[BleComboDualModeDeviceAdapter]"},Object.defineProperty(t.prototype,"authorized",{get:function(){return this._bleDeviceAdapter.authorized},enumerable:!1,configurable:!0}),t.prototype.authenticateConnection=function(e){return this._bleDeviceAdapter.authenticateConnection(e)},t.prototype.bindDevice=function(e){return this._bleDeviceAdapter.bindDevice(e)},t.prototype.unbindDevice=function(e){return this._bleDeviceAdapter.unbindDevice.call(this._bleDeviceAdapter,e)},t.prototype.controlDevice=function(e){return this._bleDeviceAdapter.controlDevice.call(this._bleDeviceAdapter,e)},t.prototype.init=function(){return this._bleDeviceAdapter.init()},t.serviceId16=DUALMODE_SERVICEID16,t.serviceId=DUALMODE_SERVICEID,t.deviceFilter=function(e,o){if(!e.advertisServiceUUIDs||!e.advertisServiceUUIDs.find((function(e){return e===t.serviceId16}))||!e.advertisData)return null;try{var r=Math.floor(10*Math.random())%10==1||!0,i=arrayBufferToHexStringArray(e.advertisData);r&&t.options.reporter.info(REPORT_EVENT_TYPE,{message:"收到广播",serviceId:t.serviceId,hexArr:i.join(",")});var n=parseInt(i[2],16)-(parseInt(i[2],16)>>2<<2),c=parseInt(i[2],16)>>4,l=o.productId&&o.deviceName?o.productId+"/"+o.deviceName:"",a=l?qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.get8ByteFromStr(""+l.replace("/","")):"",d=!!l,_="",s="",u="",p=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_STATE_MAP[n],D=[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_BINDED,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_CONNECTED].indexOf(p)>-1;if(D)u=i.slice(3,11).join("").toLocaleLowerCase(),s=i.slice(11).join("").toLocaleLowerCase(),_=o.productId;else{var v=i.slice(3,9);e.name&&-1===e.name.indexOf("_")&&(e.name=e.name+"_"+v.slice(0,2).join("")),_=hex2str(i.slice(9))}r&&t.options.reporter.info(REPORT_EVENT_TYPE,{message:"解析广播",serviceId:t.serviceId,data:{bindState:p||"x",targetDeviceId:l,targetDeviceIdentify:a,deviceUserIdentify:s||"x",deviceProductId:_||"x",deviceIdentify:u||"x"}});var E=function(){var r=tslib_1.__assign(tslib_1.__assign({},e),{standard:!0,bindState:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_STATE_MAP[p],serviceId:t.serviceId,deviceName:o.deviceName||"",productId:_,extendInfo:{moduleVersion:c}});return console.log("---设备匹配成功---",r),r};return d&&D&&u===a?E():d||D?null:E()}catch(e){console.error("llsync device filter error",e),t.options.reporter.error(REPORT_EVENT_TYPE,{message:"协议广播出错",error:e})}},t}(BleComboLLSync_1.BleComboLLSyncDeviceAdapter);exports.BleComboDualModeDeviceAdapter=BleComboDualModeDeviceAdapter;
//# sourceMappingURL=BleComboDualModeDeviceAdapter.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-blecombo",
"version": "1.1.6",
"version": "1.1.7",
"description": "",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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