Socket
Socket
Sign inDemoInstall

qcloud-iotexplorer-appdev-plugin-wificonf-blecombo

Package Overview
Dependencies
Maintainers
5
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.2.27 to 1.2.28

LICENSE.md

16

lib/protocols/BleComboDualMode/BleComboDualModeDeviceAdapter.d.ts

@@ -1,4 +0,4 @@

import { BleComboLLSyncDeviceAdapterBase, LLSyncComboDeviceAdapterOptions } from '../BleComboLLSync';
import { BleComboLLSyncDeviceAdapterBase } from '../BleComboLLSync';
import { DeviceFilterFunction } from 'qcloud-iotexplorer-bluetooth-adapter';
import { LLSyncDeviceAdapter } from 'qcloud-iotexplorer-bluetooth-adapter-llsync';
import { LLSyncDeviceAdapter, LLSyncDeviceAdapterOptions } from 'qcloud-iotexplorer-bluetooth-adapter-llsync';
import { AppDevSdk } from 'qcloud-iotexplorer-appdev-sdk';

@@ -9,3 +9,3 @@ declare class LLSyncDualModeDeviceAdapter extends LLSyncDeviceAdapter {

}
interface DualModeDeviceAdapterOptions extends LLSyncComboDeviceAdapterOptions {
interface DualModeDeviceAdapterOptions extends LLSyncDeviceAdapterOptions {
appDevSdk: AppDevSdk;

@@ -40,4 +40,5 @@ }

characteristicsMap: {};
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter/lib/base/types").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_bluetoothApi: any;
communicationMode: import("qcloud-iotexplorer-bluetooth-adapter").CommunicationMode;
_getNotifyId({ serviceId }?: {

@@ -111,2 +112,4 @@ serviceId?: string;

destroy(): void;
advertFilter(advert: any): any;
onScanAdvert(params: any): void;
_cleanupMap: {};

@@ -134,4 +137,5 @@ _normalizeError(error: any): any;

characteristicsMap: {};
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter/lib/base/types").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_bluetoothApi: any;
communicationMode: import("qcloud-iotexplorer-bluetooth-adapter").CommunicationMode;
_getNotifyId({ serviceId }?: {

@@ -201,2 +205,4 @@ serviceId?: string;

destroy(): void;
advertFilter(advert: any): any;
onScanAdvert(params: any): void;
_cleanupMap: {};

@@ -203,0 +209,0 @@ _normalizeError(error: any): any;

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboDualModeDeviceAdapter4H5=exports.BleComboDualModeDeviceAdapter=exports.BleComboDualModeDeviceAdapterBase=void 0;var tslib_1=require("tslib"),BleComboLLSync_1=require("../BleComboLLSync"),qcloud_iotexplorer_bluetooth_adapter_1=require("qcloud-iotexplorer-bluetooth-adapter"),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),BleComboDualModeDeviceAdapterBase=function(e){function t(t){var o=e.call(this,t)||this;return o._bleDeviceAdapter=new LLSyncDualModeDeviceAdapter(t),o._bleDeviceAdapter.write=o.write.bind(o._bleDeviceAdapter),["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("[dualmodeDeviceAdapter] 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){exports.BleComboDualModeDeviceAdapter.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,t){var o,r,i;if(!e.advertisServiceUUIDs||!e.advertisServiceUUIDs.find((function(e){return e===exports.BleComboDualModeDeviceAdapter.serviceId16}))||!e.advertisData)return null;try{var l=Math.floor(10*Math.random())%10==1||!0,a=arrayBufferToHexStringArray(e.advertisData);l&&(null===(o=exports.BleComboDualModeDeviceAdapter.options.reporter)||void 0===o||o.info(REPORT_EVENT_TYPE,{message:"收到广播",serviceId:exports.BleComboDualModeDeviceAdapter.serviceId,hexArr:a.join(",")}));var c=parseInt(a[2],16)-(parseInt(a[2],16)>>2<<2),n=parseInt(a[2],16)>>4,d=t.productId&&t.deviceName?t.productId+"/"+t.deviceName:"",_=d?qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.get8ByteFromStr(""+d.replace("/","")):"",p=!!d,s="",u="",D="",v=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_STATE_MAP[c],b=[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_BINDED,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_CONNECTED].indexOf(v)>-1;if(b)D=a.slice(3,11).join("").toLocaleLowerCase(),u=a.slice(11).join("").toLocaleLowerCase(),s=t.productId;else{var A=a.slice(3,9);e.name&&-1===e.name.indexOf("_")&&(e.name=e.name+"_"+A.slice(0,2).join("")),s=hex2str(a.slice(9))}l&&(null===(r=exports.BleComboDualModeDeviceAdapter.options.reporter)||void 0===r||r.info(REPORT_EVENT_TYPE,{message:"解析广播",serviceId:exports.BleComboDualModeDeviceAdapter.serviceId,data:{bindState:v||"x",targetDeviceId:d,targetDeviceIdentify:_,deviceUserIdentify:u||"x",deviceProductId:s||"x",deviceIdentify:D||"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[v],serviceId:exports.BleComboDualModeDeviceAdapter.serviceId,deviceName:t.deviceName||"",productId:s,extendInfo:{moduleVersion:n}});return console.log("---设备匹配成功---",o),o};return p&&b&&D===_?E():p||b?null:E()}catch(e){console.error("llsync device filter error",e),null===(i=exports.BleComboDualModeDeviceAdapter.options.reporter)||void 0===i||i.error(REPORT_EVENT_TYPE,{message:"协议广播出错",error:e})}},t}(BleComboLLSync_1.BleComboLLSyncDeviceAdapterBase);exports.BleComboDualModeDeviceAdapterBase=BleComboDualModeDeviceAdapterBase,exports.BleComboDualModeDeviceAdapter=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4Mp(BleComboDualModeDeviceAdapterBase),exports.BleComboDualModeDeviceAdapter4H5=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4H5(BleComboDualModeDeviceAdapterBase);
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboDualModeDeviceAdapter4H5=exports.BleComboDualModeDeviceAdapter=exports.BleComboDualModeDeviceAdapterBase=void 0;var tslib_1=require("tslib"),BleComboLLSync_1=require("../BleComboLLSync"),qcloud_iotexplorer_bluetooth_adapter_1=require("qcloud-iotexplorer-bluetooth-adapter"),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),BleComboDualModeDeviceAdapterBase=function(e){function t(t){var o=e.call(this,t)||this;return o._bleDeviceAdapter=new LLSyncDualModeDeviceAdapter(t),o._bleDeviceAdapter.write=o.write.bind(o._bleDeviceAdapter),["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("[dualmodeDeviceAdapter] 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){exports.BleComboDualModeDeviceAdapter.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,t){var o,r,i;if(!e.advertisServiceUUIDs||!e.advertisServiceUUIDs.find((function(e){return e===exports.BleComboDualModeDeviceAdapter.serviceId16}))||!e.advertisData)return null;try{var a=Math.floor(10*Math.random())%10==1||!0,l=arrayBufferToHexStringArray(e.advertisData);a&&(null===(o=exports.BleComboDualModeDeviceAdapter.options.appDevSdk.reporter)||void 0===o||o.info(REPORT_EVENT_TYPE,{message:"收到广播",serviceId:exports.BleComboDualModeDeviceAdapter.serviceId,hexArr:l.join(",")}));var c=parseInt(l[2],16)-(parseInt(l[2],16)>>2<<2),n=parseInt(l[2],16)>>4,d=t.productId&&t.deviceName?t.productId+"/"+t.deviceName:"",p=d?qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.get8ByteFromStr(""+d.replace("/","")):"",_=!!d,s="",u="",D="",v=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_STATE_MAP[c],b=[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_BINDED,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_HAS_CONNECTED].indexOf(v)>-1;if(b)D=l.slice(3,11).join("").toLocaleLowerCase(),u=l.slice(11).join("").toLocaleLowerCase(),s=t.productId;else{var A=l.slice(3,9);e.name&&-1===e.name.indexOf("_")&&(e.name=e.name+"_"+A.slice(0,2).join("")),s=hex2str(l.slice(9))}a&&(null===(r=exports.BleComboDualModeDeviceAdapter.options.appDevSdk.reporter)||void 0===r||r.info(REPORT_EVENT_TYPE,{message:"解析广播",serviceId:exports.BleComboDualModeDeviceAdapter.serviceId,data:{bindState:v||"x",targetDeviceId:d,targetDeviceIdentify:p,deviceUserIdentify:u||"x",deviceProductId:s||"x",deviceIdentify:D||"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[v],serviceId:exports.BleComboDualModeDeviceAdapter.serviceId,deviceName:t.deviceName||"",productId:s,extendInfo:{moduleVersion:n}});return console.log("---设备匹配成功---",o),o};return _&&b&&D===p?E():_||b?null:E()}catch(e){console.error("llsync device filter error",e),null===(i=exports.BleComboDualModeDeviceAdapter.options.appDevSdk.reporter)||void 0===i||i.error(REPORT_EVENT_TYPE,{message:"协议广播出错",error:e})}},t}(BleComboLLSync_1.BleComboLLSyncDeviceAdapterBase);exports.BleComboDualModeDeviceAdapterBase=BleComboDualModeDeviceAdapterBase,exports.BleComboDualModeDeviceAdapter=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4Mp(BleComboDualModeDeviceAdapterBase),exports.BleComboDualModeDeviceAdapter4H5=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4H5(BleComboDualModeDeviceAdapterBase);
//# sourceMappingURL=BleComboDualModeDeviceAdapter.js.map
import { Reporter } from 'qcloud-iotexplorer-appdev-sdk';
import { DeviceFilterFunction } from 'qcloud-iotexplorer-bluetooth-adapter';
import { LLSyncDeviceAdapterBase } from 'qcloud-iotexplorer-bluetooth-adapter-llsync';
import { LLSyncDeviceAdapterBase, LLSyncDeviceAdapterOptions } from 'qcloud-iotexplorer-bluetooth-adapter-llsync';
export declare const LLSyncComboConfig: {

@@ -12,11 +12,8 @@ waitGetDeviceInfoTime: number;

};
export interface LLSyncComboDeviceAdapterOptions {
reporter: Reporter;
}
export declare class BleComboLLSyncDeviceAdapterBase extends LLSyncDeviceAdapterBase {
static options: LLSyncComboDeviceAdapterOptions;
static options: LLSyncDeviceAdapterOptions;
static serviceId16: string;
static serviceId: string;
static deviceFilter: DeviceFilterFunction;
static injectOptions(options: LLSyncComboDeviceAdapterOptions): void;
static injectOptions(options: LLSyncDeviceAdapterOptions): void;
bleVersion: any;

@@ -76,4 +73,5 @@ reporter: Reporter;

characteristicsMap: {};
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter/lib/base/types").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_bluetoothApi: any;
communicationMode: import("qcloud-iotexplorer-bluetooth-adapter").CommunicationMode;
_getNotifyId({ serviceId }?: {

@@ -147,2 +145,4 @@ serviceId?: string;

destroy(): void;
advertFilter(advert: any): any;
onScanAdvert(params: any): void;
_cleanupMap: {};

@@ -170,4 +170,5 @@ _normalizeError(error: any): any;

characteristicsMap: {};
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter/lib/base/types").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_actions: Pick<import("qcloud-iotexplorer-bluetooth-adapter").BlueToothActions, "registerDevice" | "bindDevice" | "reportDeviceData">;
_bluetoothApi: any;
communicationMode: import("qcloud-iotexplorer-bluetooth-adapter").CommunicationMode;
_getNotifyId({ serviceId }?: {

@@ -237,2 +238,4 @@ serviceId?: string;

destroy(): void;
advertFilter(advert: any): any;
onScanAdvert(params: any): void;
_cleanupMap: {};

@@ -239,0 +242,0 @@ _normalizeError(error: any): any;

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboLLSyncDeviceAdapter4H5=exports.BleComboLLSyncDeviceAdapter=exports.BleComboLLSyncDeviceAdapterBase=exports.LLSyncComboConfig=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),qcloud_iotexplorer_bluetooth_adapter_1=require("qcloud-iotexplorer-bluetooth-adapter"),qcloud_iotexplorer_bluetooth_adapter_llsync_1=require("qcloud-iotexplorer-bluetooth-adapter-llsync"),hex2str=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.hex2str,U16ToHexString=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.U16ToHexString,U8ToHexString=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.U8ToHexString,arrayBufferToHexStringArray=qcloud_iotexplorer_bluetooth_adapter_1.blueToothHelper.arrayBufferToHexStringArray,byteUtil=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.byteUtil;exports.LLSyncComboConfig={waitGetDeviceInfoTime:1e4,waitSetWiFiModeTime:1e4,waitSetWiFiInfoTime:1e4,waitSetWiFiConnectTime:2e4,waitSetWiFiTokenTime:1e4,waitDevLogInfoTime:1e4};var BleComboLLSyncDeviceAdapterBase=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.reporter={info:function(e,o){void 0===e&&(e=""),void 0===o&&(o={});var r=o.message,_=void 0===r?"":r,n=tslib_1.__rest(o,["message"]),l=t,i=l.explorerDeviceId,s=l.deviceId,a=l.isConnected;exports.BleComboLLSyncDeviceAdapter.options.reporter.info(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,message:_||(e&&qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ACTION_DESC[e]?e+"("+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ACTION_DESC[e]+")":e),timeCost:n.timeCost||0,action:e,data:tslib_1.__assign({deviceId:i,bleDeviceId:s,isConnected:a},n)})},error:function(e,o){void 0===e&&(e=""),void 0===o&&(o={});var r=o.error,_=tslib_1.__rest(o,["error"]),n=t,l=n.explorerDeviceId,i=n.deviceId,s=n.isConnected;r.code&&qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[r.code]&&(r.msg=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[r.code]),exports.BleComboLLSyncDeviceAdapter.options.reporter.error(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:e&&qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[e]&&e+"("+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[e]+":"+(r&&(r.message||r.errMsg||r.msg||r.code))+")",timeCost:_.timeCost||0,action:e,error:r,data:tslib_1.__assign(tslib_1.__assign({deviceId:l,bleDeviceId:i,isConnected:s},_),r)})}},t}return tslib_1.__extends(t,e),t.injectOptions=function(e){exports.BleComboLLSyncDeviceAdapter.options=e},t.prototype.notifyMessage=function(e){var t=void 0===e?{}:e,o=t.type,r=t.data;if("unknown"!==o)return console.log("check this in notifyMessage",this,{type:o,data:r}),this.emit(o,{type:o,data:r})},t.prototype.connectDevice=function(t){return tslib_1.__awaiter(this,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,e.prototype.connectDevice.call(this,t)];case 1:return o.sent(),[4,this.afterConnectDevice()];case 2:return o.sent(),[2]}}))}))},t.prototype.afterConnectDevice=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,t,o,r,_;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:return[4,this.getDeviceInfo()];case 1:if(e=n.sent(),t=e.version,o=e.mtu,r=e.needSetMtu,_=e.deviceName,this.deviceName=_,this.bleVersion=t,this.mtu=o,this.reporter.info("CONNECT_DEVICE",{data:{version:t,mtu:o,needSetMtu:r,deviceName:_}}),!r)return[3,5];n.label=2;case 2:return n.trys.push([2,4,,5]),[4,this.setMtu(this.mtu)];case 3:return n.sent(),this.writeMtuResult("success"),[3,5];case 4:return n.sent(),this.writeMtuResult("fail"),[3,5];case 5:return[2,_]}}))}))},t.prototype.getDeviceInfo=function(){return this.writeAndWait4Response(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEVICE_INFO],qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_INVALID};var t=parseInt(e.slice(2,3).join(""),16),o=parseInt(e.slice(3,5).join(""),16),r=!!(o>>15),_=8191&o,n=parseInt(e[5],16),l=hex2str(e.slice(6).join(""));if(n!==l.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_INVALID};return{version:t,mtu:_,needSetMtu:r,deviceName:l}}),{timeout:exports.LLSyncComboConfig.waitGetDeviceInfoTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.WAIT_GET_DEVICE_INFO_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.setWiFiMode=function(e){void 0===e&&(e=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.STA_WIFI_MODE);var t=""+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE]+U8ToHexString(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.WIFI_MODE_MAP[e]);return this.writeAndWait4Response(t,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE_RESULT_INVALID};return!parseInt(e.slice(2,3).join(""),16)}),{timeout:exports.LLSyncComboConfig.waitSetWiFiModeTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.setWiFiInfo=function(e){var t=e.ssid,o=e.password,r=byteUtil.hexString2hexArray(byteUtil.byteArrayToHex(byteUtil.getBytesByString(t)))||[],_=byteUtil.hexString2hexArray(byteUtil.byteArrayToHex(byteUtil.getBytesByString(o)))||[];console.log("----data----",{ssid:t,password:o,ssidHexArray:r,passwordHexArray:_});var n=this.sliceData(tslib_1.__spread([qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO],U16ToHexString(r.length+_.length),U8ToHexString(r.length)],r,[U8ToHexString(_.length)],_),[tslib_1.__spread([U8ToHexString(r.length)],r),tslib_1.__spread([U8ToHexString(_.length)],_)],qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO);return this.writeAndWait4Response(n,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO_RESULT_INVALID};return!parseInt(e.slice(2,3).join(""),16)}),{timeout:exports.LLSyncComboConfig.waitSetWiFiInfoTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.sendConnectWiFiAndGetWiFiConnectState=function(){var e=""+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT];return this.writeAndWait4Response(e,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT_RESULT_INVALID};var t=parseInt(e.slice(3,4).join(""),16),o=parseInt(e.slice(5,6).join(""),16),r="";return o&&(r=hex2str(e.slice(6,6+o))),{connected:!t,ssid:r}}),{timeout:exports.LLSyncComboConfig.waitSetWiFiConnectTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.sendToken=function(e){var t=e.token,o=byteUtil.hexString2hexArray(byteUtil.byteArrayToHex(byteUtil.getBytesByString(t)));console.log("----data----",{token:t,tokenHexArray:o});var r=this.sliceData(tslib_1.__spread([qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN],U16ToHexString(o.length)],o),[o],qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN);return this.writeAndWait4Response(r,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN_RESULT_INVALID};return!parseInt(e.slice(2,3).join(""),16)}),{timeout:exports.LLSyncComboConfig.waitSetWiFiTokenTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.getModuleLog=function(){var e=""+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG];return this.writeAndWait4Response(e,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG_INFO,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG_INFO_INVALID};var t=parseInt(e.slice(1,3).join(""),16);return{logStr:hex2str(e.slice(4,4+t))}}),{timeout:exports.LLSyncComboConfig.waitDevLogInfoTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG_INFO_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.options={reporter:console},t.serviceId16="0000FFF0-0000-1000-8000-00805F9B34FB",t.serviceId="0000FFF0-65D0-4E20-B56A-E493541BA4E2",t.deviceFilter=function(e){if(!e.advertisServiceUUIDs||!e.advertisServiceUUIDs.find((function(e){return e===exports.BleComboLLSyncDeviceAdapter.serviceId16}))||!e.advertisData)return null;try{var t=Math.floor(10*Math.random())%10==1||!0,o=arrayBufferToHexStringArray(e.advertisData);t&&exports.BleComboLLSyncDeviceAdapter.options.reporter.info(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:"收到广播",serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,hexArr:o.join(",")});var r,_=parseInt(o[2],16)>>4,n=o.slice(3,9);return e.name&&-1===e.name.indexOf("_")&&(e.name=e.name+"_"+n.slice(0,2).join("")),r=hex2str(o.slice(9)),t&&exports.BleComboLLSyncDeviceAdapter.options.reporter.info(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:"解析广播",serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,data:{deviceProductId:r||"x"}}),tslib_1.__assign(tslib_1.__assign({},e),{standardBleCombo:!0,serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,deviceName:"",productId:r,extendInfo:{moduleVersion:_}})}catch(e){exports.BleComboLLSyncDeviceAdapter.options.reporter.error(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:"协议广播出错",error:e})}},t}(qcloud_iotexplorer_bluetooth_adapter_llsync_1.LLSyncDeviceAdapterBase);exports.BleComboLLSyncDeviceAdapterBase=BleComboLLSyncDeviceAdapterBase,exports.BleComboLLSyncDeviceAdapter=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4Mp(BleComboLLSyncDeviceAdapterBase),exports.BleComboLLSyncDeviceAdapter4H5=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4H5(BleComboLLSyncDeviceAdapterBase);
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.BleComboLLSyncDeviceAdapter4H5=exports.BleComboLLSyncDeviceAdapter=exports.BleComboLLSyncDeviceAdapterBase=exports.LLSyncComboConfig=void 0;var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),qcloud_iotexplorer_bluetooth_adapter_1=require("qcloud-iotexplorer-bluetooth-adapter"),qcloud_iotexplorer_bluetooth_adapter_llsync_1=require("qcloud-iotexplorer-bluetooth-adapter-llsync"),hex2str=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.hex2str,U16ToHexString=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.U16ToHexString,U8ToHexString=qcloud_iotexplorer_bluetooth_adapter_llsync_1.utils.U8ToHexString,arrayBufferToHexStringArray=qcloud_iotexplorer_bluetooth_adapter_1.blueToothHelper.arrayBufferToHexStringArray,byteUtil=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.byteUtil;exports.LLSyncComboConfig={waitGetDeviceInfoTime:1e4,waitSetWiFiModeTime:1e4,waitSetWiFiInfoTime:1e4,waitSetWiFiConnectTime:2e4,waitSetWiFiTokenTime:1e4,waitDevLogInfoTime:1e4};var BleComboLLSyncDeviceAdapterBase=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.reporter={info:function(e,o){var r;void 0===e&&(e=""),void 0===o&&(o={});var _=o.message,n=void 0===_?"":_,l=tslib_1.__rest(o,["message"]),i=t,s=i.explorerDeviceId,a=i.deviceId,c=i.isConnected;null===(r=exports.BleComboLLSyncDeviceAdapter.options)||void 0===r||r.appDevSdk.reporter.info(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,message:n||(e&&qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ACTION_DESC[e]?e+"("+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ACTION_DESC[e]+")":e),timeCost:l.timeCost||0,action:e,data:tslib_1.__assign({deviceId:s,bleDeviceId:a,isConnected:c},l)})},error:function(e,o){var r;void 0===e&&(e=""),void 0===o&&(o={});var _=o.error,n=tslib_1.__rest(o,["error"]),l=t,i=l.explorerDeviceId,s=l.deviceId,a=l.isConnected;_.code&&qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[_.code]&&(_.msg=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[_.code]),null===(r=exports.BleComboLLSyncDeviceAdapter.options)||void 0===r||r.appDevSdk.reporter.error(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:e&&qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[e]&&e+"("+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.ERROR_MESSAGES[e]+":"+(_&&(_.message||_.errMsg||_.msg||_.code))+")",timeCost:n.timeCost||0,action:e,error:_,data:tslib_1.__assign(tslib_1.__assign({deviceId:i,bleDeviceId:s,isConnected:a},n),_)})}},t}return tslib_1.__extends(t,e),t.injectOptions=function(e){exports.BleComboLLSyncDeviceAdapter.options=e},t.prototype.notifyMessage=function(e){var t=void 0===e?{}:e,o=t.type,r=t.data;if("unknown"!==o)return console.log("check this in notifyMessage",this,{type:o,data:r}),this.emit(o,{type:o,data:r})},t.prototype.connectDevice=function(t){return tslib_1.__awaiter(this,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,e.prototype.connectDevice.call(this,t)];case 1:return o.sent(),[4,this.afterConnectDevice()];case 2:return o.sent(),[2]}}))}))},t.prototype.afterConnectDevice=function(){return tslib_1.__awaiter(this,void 0,void 0,(function(){var e,t,o,r,_;return tslib_1.__generator(this,(function(n){switch(n.label){case 0:return[4,this.getDeviceInfo()];case 1:if(e=n.sent(),t=e.version,o=e.mtu,r=e.needSetMtu,_=e.deviceName,this.deviceName=_,this.bleVersion=t,this.mtu=o,this.reporter.info("CONNECT_DEVICE",{data:{version:t,mtu:o,needSetMtu:r,deviceName:_}}),!r)return[3,5];n.label=2;case 2:return n.trys.push([2,4,,5]),[4,this.setMtu(this.mtu)];case 3:return n.sent(),this.writeMtuResult("success"),[3,5];case 4:return n.sent(),this.writeMtuResult("fail"),[3,5];case 5:return[2,_]}}))}))},t.prototype.getDeviceInfo=function(){return this.writeAndWait4Response(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEVICE_INFO],qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_INVALID};var t=parseInt(e.slice(2,3).join(""),16),o=parseInt(e.slice(3,5).join(""),16),r=!!(o>>15),_=8191&o,n=parseInt(e[5],16),l=hex2str(e.slice(6).join(""));if(n!==l.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_INVALID};return{version:t,mtu:_,needSetMtu:r,deviceName:l}}),{timeout:exports.LLSyncComboConfig.waitGetDeviceInfoTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.WAIT_GET_DEVICE_INFO_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.setWiFiMode=function(e){void 0===e&&(e=qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.STA_WIFI_MODE);var t=""+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE]+U8ToHexString(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.WIFI_MODE_MAP[e]);return this.writeAndWait4Response(t,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE_RESULT_INVALID};return!parseInt(e.slice(2,3).join(""),16)}),{timeout:exports.LLSyncComboConfig.waitSetWiFiModeTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_MODE_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.setWiFiInfo=function(e){var t=e.ssid,o=e.password,r=byteUtil.hexString2hexArray(byteUtil.byteArrayToHex(byteUtil.getBytesByString(t)))||[],_=byteUtil.hexString2hexArray(byteUtil.byteArrayToHex(byteUtil.getBytesByString(o)))||[];console.log("----data----",{ssid:t,password:o,ssidHexArray:r,passwordHexArray:_});var n=this.sliceData(tslib_1.__spread([qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO],U16ToHexString(r.length+_.length),U8ToHexString(r.length)],r,[U8ToHexString(_.length)],_),[tslib_1.__spread([U8ToHexString(r.length)],r),tslib_1.__spread([U8ToHexString(_.length)],_)],qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO);return this.writeAndWait4Response(n,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO_RESULT_INVALID};return!parseInt(e.slice(2,3).join(""),16)}),{timeout:exports.LLSyncComboConfig.waitSetWiFiInfoTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_INFO_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.sendConnectWiFiAndGetWiFiConnectState=function(){var e=""+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT];return this.writeAndWait4Response(e,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT_RESULT_INVALID};var t=parseInt(e.slice(3,4).join(""),16),o=parseInt(e.slice(5,6).join(""),16),r="";return o&&(r=hex2str(e.slice(6,6+o))),{connected:!t,ssid:r}}),{timeout:exports.LLSyncComboConfig.waitSetWiFiConnectTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_CONNECT_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.sendToken=function(e){var t=e.token,o=byteUtil.hexString2hexArray(byteUtil.byteArrayToHex(byteUtil.getBytesByString(t)));console.log("----data----",{token:t,tokenHexArray:o});var r=this.sliceData(tslib_1.__spread([qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN],U16ToHexString(o.length)],o),[o],qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN);return this.writeAndWait4Response(r,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN_RESULT,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN_RESULT_INVALID};return!parseInt(e.slice(2,3).join(""),16)}),{timeout:exports.LLSyncComboConfig.waitSetWiFiTokenTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.SET_WIFI_TOKEN_RESULT_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.prototype.getModuleLog=function(){var e=""+qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_PREFIX[qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG];return this.writeAndWait4Response(e,qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG_INFO,(function(e){if(!e.length)throw{code:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG_INFO_INVALID};var t=parseInt(e.slice(1,3).join(""),16);return{logStr:hex2str(e.slice(4,4+t))}}),{timeout:exports.LLSyncComboConfig.waitDevLogInfoTime,timeoutCode:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.GET_DEV_LOG_INFO_TIMEOUT,writeId:qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.DEVICE_INFO_WRITE_ID})},t.options=null,t.serviceId16="0000FFF0-0000-1000-8000-00805F9B34FB",t.serviceId="0000FFF0-65D0-4E20-B56A-E493541BA4E2",t.deviceFilter=function(e){var t,o,r;if(!e.advertisServiceUUIDs||!e.advertisServiceUUIDs.find((function(e){return e===exports.BleComboLLSyncDeviceAdapter.serviceId16}))||!e.advertisData)return null;try{var _=Math.floor(10*Math.random())%10==1||!0,n=arrayBufferToHexStringArray(e.advertisData);_&&(null===(t=exports.BleComboLLSyncDeviceAdapter.options)||void 0===t||t.appDevSdk.reporter.info(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:"收到广播",serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,hexArr:n.join(",")}));var l,i=parseInt(n[2],16)>>4,s=n.slice(3,9);return e.name&&-1===e.name.indexOf("_")&&(e.name=e.name+"_"+s.slice(0,2).join("")),l=hex2str(n.slice(9)),_&&(null===(o=exports.BleComboLLSyncDeviceAdapter.options)||void 0===o||o.appDevSdk.reporter.info(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:"解析广播",serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,data:{deviceProductId:l||"x"}})),tslib_1.__assign(tslib_1.__assign({},e),{standardBleCombo:!0,serviceId:exports.BleComboLLSyncDeviceAdapter.serviceId,deviceName:"",productId:l,extendInfo:{moduleVersion:i}})}catch(e){null===(r=exports.BleComboLLSyncDeviceAdapter.options)||void 0===r||r.appDevSdk.reporter.error(qcloud_iotexplorer_bluetooth_adapter_llsync_1.constants.REPORT_EVENT_TYPE,{message:"协议广播出错",error:e})}},t}(qcloud_iotexplorer_bluetooth_adapter_llsync_1.LLSyncDeviceAdapterBase);exports.BleComboLLSyncDeviceAdapterBase=BleComboLLSyncDeviceAdapterBase,exports.BleComboLLSyncDeviceAdapter=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4Mp(BleComboLLSyncDeviceAdapterBase),exports.BleComboLLSyncDeviceAdapter4H5=qcloud_iotexplorer_bluetooth_adapter_1.AdapterDeviceAdapter4H5(BleComboLLSyncDeviceAdapterBase);
//# sourceMappingURL=BleComboLLSyncDeviceAdapter.js.map
{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-blecombo",
"version": "1.2.27",
"version": "1.2.28",
"description": "",

@@ -19,7 +19,7 @@ "main": "lib/index.js",

"dependencies": {
"iotexplorer-ui-dev-config": "^1.0.26",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.36",
"qcloud-iotexplorer-appdev-sdk": "^1.1.15",
"qcloud-iotexplorer-bluetooth-adapter": "^0.3.14",
"qcloud-iotexplorer-bluetooth-adapter-llsync": "^1.3.17",
"iotexplorer-ui-dev-config": "^1.0.34",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.37",
"qcloud-iotexplorer-appdev-sdk": "^1.1.22",
"qcloud-iotexplorer-bluetooth-adapter": "^0.3.22",
"qcloud-iotexplorer-bluetooth-adapter-llsync": "^1.3.25",
"spark-md5": "^3.0.1",

@@ -33,3 +33,3 @@ "tslib": "^2.0.1"

},
"gitHead": "216ef060b7f68d089ab07d2a5e1ae982c0997d43"
"gitHead": "878fc4bfed5e8f694e0f9db751d9d586768f11ef"
}

@@ -44,2 +44,6 @@ # qcloud-iotexplorer-appdev-plugin-wificonf-blecombo

import { BlueToothAdapter } from 'qcloud-iotexplorer-bluetooth-adapter';
BleComboLLSyncDeviceAdapter.injectOptions({
appDevSdk, // appDevSdk是 qcloud-iotexplorer-appdev-sdk 的实例
})
export const bluetoothAdapter = new BlueToothAdapter({

@@ -46,0 +50,0 @@ deviceAdapters: [

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