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.7 to 1.2.9

ble.jpeg

6

lib/index.d.ts

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

import { BleComboLLSyncTaskOptions, BleComboEspTaskOptions } from './protocols';
import { WifiConfType } from 'iotexplorer-ui-dev-config';
import { AppDevPlugin, AppDevSdk } from 'qcloud-iotexplorer-appdev-sdk';
import { WifiConfType } from 'iotexplorer-ui-dev-config';
import { BleComboEspTaskOptions, BleComboLLSyncTaskOptions } from './protocols';
export declare type BLEWifiConfOption = BleComboLLSyncTaskOptions | BleComboEspTaskOptions;

@@ -13,5 +13,5 @@ export declare type WifiConfTypeBleCombo = WifiConfType.BLEComboEsp | WifiConfType.BLEComboLLSync;

}
export { BleComboEspDeviceAdapter, BleComboLLSyncDeviceAdapter, BleComboDualModeDeviceAdapter, BleComboDualModeDeviceAdapter4H5, } from './protocols';
export { BleComboDualModeDeviceAdapter, BleComboDualModeDeviceAdapter4H5, BleComboEspDeviceAdapter, BleComboLLSyncDeviceAdapter } from './protocols';
export default class BleComboPlugin implements AppDevPlugin {
static install(sdk: AppDevSdk): void;
}

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

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),protocols_1=require("./protocols"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),iotexplorer_ui_dev_config_1=require("iotexplorer-ui-dev-config"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,protocols_2=require("./protocols");Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboLLSyncDeviceAdapter}}),Object.defineProperty(exports,"BleComboDualModeDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter}}),Object.defineProperty(exports,"BleComboDualModeDeviceAdapter4H5",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter4H5}});var getBleComboProtoHandler=function(e){switch(e.wifiConfType){case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboEsp:return new protocols_1.BleComboEspTask(e);case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboLLSync:case iotexplorer_ui_dev_config_1.WifiConfType.DualMode:return new protocols_1.BleComboLLSyncTask(e);default:console.warn("没有找到 wifiConfType 对应的 bleComboHandler:",e.wifiConfType)}},BleComboPlugin=function(){function e(){}return e.install=function(e){e.plugins.wifiConfBleCombo={start:function(o){return tslib_1.__awaiter(this,void 0,void 0,(function(){var t,r,i,n,s,c,d,a,l,_,p,u,f,C,b,S,v=this;return tslib_1.__generator(this,(function(m){switch(m.label){case 0:t=o.onError,r=o.onProgress,i=o.onComplete,n=o.wifiConfToken,s=o.familyId,c=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(v,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,delay(e)];case 1:return o.sent(),[2]}}))}))},r({code:WifiConfStepCode.PROTOCOL_START}),m.label=1;case 1:m.trys.push([1,22,,23]),d=Date.now(),a=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},o),{reporter:{info:function(e,o){void 0===o&&(o={}),r({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+e+")",data:o}})},error:function(e){t({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),m.label=2;case 2:return m.trys.push([2,4,,5]),[4,a.start()];case 3:return m.sent(),[3,5];case 4:throw l=m.sent(),console.error(l),tslib_1.__assign({code:"PROTOCOL_FAIL"},l);case 5:return r({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-d}}),[4,c()];case 6:m.sent(),r({code:WifiConfStepCode.BUSINESS_START}),r({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:n}}}),_=Date.now(),p=void 0,m.label=7;case 7:return m.trys.push([7,9,,10]),[4,a.sendToken()];case 8:return p=m.sent(),[3,10];case 9:throw u=m.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},u);case 10:return[4,r({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-_,response:p}})];case 11:if(m.sent(),f=p.productId,C=p.deviceName,o.wifiConfType!==iotexplorer_ui_dev_config_1.WifiConfType.DualMode)return[3,17];m.label=12;case 12:return m.trys.push([12,15,,16]),[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:f,deviceName:C,familyId:s,roomId:"",onProgress:r,sdk:e,skipBind:!0})];case 13:return m.sent(),[4,o.deviceAdapter.bindDevice({familyId:s,roomId:""})];case 14:return m.sent(),[3,16];case 15:throw b=m.sent(),tslib_1.__assign({code:"BLE_BIND_DEVICE_ERROR"},b);case 16:return[3,19];case 17:return[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:f,deviceName:C,familyId:s,roomId:"",onProgress:r,sdk:e})];case 18:m.sent(),m.label=19;case 19:return[4,r({code:WifiConfStepCode.BUSINESS_QUERY_TOKEN_STATE_SUCCESS,detail:{timeCost:Date.now()-_,response:p}})];case 20:return m.sent(),[4,c()];case 21:return m.sent(),i({productId:f,deviceName:C}),a.interrupt(),r({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-d}}),[3,23];case 22:return S=m.sent(),t({code:"",detail:{error:S}}),[3,23];case 23:return[2]}}))}))}}},e}();exports.default=BleComboPlugin;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var tslib_1=require("tslib"),iotexplorer_ui_dev_config_1=require("iotexplorer-ui-dev-config"),qcloud_iotexplorer_appdev_plugin_wificonf_core_1=require("qcloud-iotexplorer-appdev-plugin-wificonf-core"),qcloud_iotexplorer_appdev_sdk_1=require("qcloud-iotexplorer-appdev-sdk"),protocols_1=require("./protocols"),delay=qcloud_iotexplorer_appdev_sdk_1.AppDevSdk.utils.delay,WifiConfStepCode=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepCode,WifiConfStepDesp=qcloud_iotexplorer_appdev_plugin_wificonf_core_1.constants.WifiConfStepDesp,protocols_2=require("./protocols");Object.defineProperty(exports,"BleComboDualModeDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter}}),Object.defineProperty(exports,"BleComboDualModeDeviceAdapter4H5",{enumerable:!0,get:function(){return protocols_2.BleComboDualModeDeviceAdapter4H5}}),Object.defineProperty(exports,"BleComboEspDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboEspDeviceAdapter}}),Object.defineProperty(exports,"BleComboLLSyncDeviceAdapter",{enumerable:!0,get:function(){return protocols_2.BleComboLLSyncDeviceAdapter}});var getBleComboProtoHandler=function(e){switch(e.wifiConfType){case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboEsp:return new protocols_1.BleComboEspTask(e);case iotexplorer_ui_dev_config_1.WifiConfType.BLEComboLLSync:case iotexplorer_ui_dev_config_1.WifiConfType.DualMode:return new protocols_1.BleComboLLSyncTask(e);default:console.warn("没有找到 wifiConfType 对应的 bleComboHandler:",e.wifiConfType)}},BleComboPlugin=function(){function e(){}return e.install=function(e){e.plugins.wifiConfBleCombo={start:function(o){return tslib_1.__awaiter(this,void 0,void 0,(function(){var t,r,i,n,s,c,d,a,l,_,p,u,f,C,b,S,v=this;return tslib_1.__generator(this,(function(T){switch(T.label){case 0:t=o.onError,r=o.onProgress,i=o.onComplete,n=o.wifiConfToken,s=o.familyId,c=function(e){return void 0===e&&(e=1e3),tslib_1.__awaiter(v,void 0,void 0,(function(){return tslib_1.__generator(this,(function(o){switch(o.label){case 0:return[4,delay(e)];case 1:return o.sent(),[2]}}))}))},r({code:WifiConfStepCode.PROTOCOL_START,reportEvents:["配网","发送wifi"]}),T.label=1;case 1:T.trys.push([1,22,,23]),d=Date.now(),a=getBleComboProtoHandler(tslib_1.__assign(tslib_1.__assign({},o),{reporter:{info:function(e,o){void 0===o&&(o={}),r({code:WifiConfStepCode.PROTOCOL_DETAIL,detail:{message:WifiConfStepCode.PROTOCOL_DETAIL+"("+WifiConfStepDesp[WifiConfStepCode.PROTOCOL_DETAIL]+": "+e+")",data:o}})},error:function(e){t({code:"PROTOCOL_FAIL",detail:{error:e}})}}})),T.label=2;case 2:return T.trys.push([2,4,,5]),[4,a.start()];case 3:return T.sent(),[3,5];case 4:throw l=T.sent(),console.error(l),tslib_1.__assign({code:"PROTOCOL_FAIL"},l);case 5:return r({code:WifiConfStepCode.PROTOCOL_SUCCESS,detail:{timeCost:Date.now()-d},reportEvents:["发送wifi"]}),[4,c()];case 6:T.sent(),r({code:WifiConfStepCode.BUSINESS_START}),r({code:"BLE_SEND_TOKEN_START",detail:{data:{wifiConfToken:n}},reportEvents:["bleSendToken"]}),_=Date.now(),p=void 0,T.label=7;case 7:return T.trys.push([7,9,,10]),[4,a.sendToken()];case 8:return p=T.sent(),[3,10];case 9:throw u=T.sent(),tslib_1.__assign({code:"BLE_SEND_TOKEN_ERROR"},u);case 10:return[4,r({code:"BLE_SEND_TOKEN_SUCCESS",detail:{timeCost:Date.now()-_,response:p},reportEvents:["bleSendToken"]})];case 11:if(T.sent(),f=p.productId,C=p.deviceName,o.wifiConfType!==iotexplorer_ui_dev_config_1.WifiConfType.DualMode)return[3,17];T.label=12;case 12:return T.trys.push([12,15,,16]),[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:f,deviceName:C,familyId:s,roomId:"",onProgress:r,sdk:e,skipBind:!0})];case 13:return T.sent(),[4,o.deviceAdapter.bindDevice({familyId:s,roomId:""})];case 14:return T.sent(),[3,16];case 15:throw b=T.sent(),tslib_1.__assign({code:"BLE_BIND_DEVICE_ERROR"},b);case 16:return[3,19];case 17:return[4,qcloud_iotexplorer_appdev_plugin_wificonf_core_1.queryTokenStateAndBind({token:o.wifiConfToken,productId:f,deviceName:C,familyId:s,roomId:"",onProgress:r,sdk:e})];case 18:T.sent(),T.label=19;case 19:return[4,r({code:WifiConfStepCode.BUSINESS_QUERY_TOKEN_STATE_SUCCESS,detail:{timeCost:Date.now()-_,response:p}})];case 20:return T.sent(),[4,c()];case 21:return T.sent(),i({productId:f,deviceName:C}),a.interrupt(),r({code:WifiConfStepCode.WIFI_CONF_SUCCESS,detail:{timeCost:Date.now()-d},reportEvents:["配网"]}),[3,23];case 22:return S=T.sent(),t({code:"",detail:{error:S}}),[3,23];case 23:return[2]}}))}))}}},e}();exports.default=BleComboPlugin;
//# sourceMappingURL=index.js.map

@@ -80,3 +80,3 @@ import { BleComboLLSyncDeviceAdapterBase, LLSyncComboDeviceAdapterOptions } from '../BleComboLLSync';

}): Promise<void>;
disconnectDevice(): void;
disconnectDevice(): Promise<void>;
connectDevice({ autoNotify, }?: {

@@ -173,3 +173,3 @@ autoNotify?: boolean;

}): Promise<void>;
disconnectDevice(): void;
disconnectDevice(): Promise<void>;
connectDevice({ autoNotify, }?: {

@@ -176,0 +176,0 @@ autoNotify?: boolean;

@@ -116,3 +116,3 @@ import { Reporter } from 'qcloud-iotexplorer-appdev-sdk';

}): Promise<void>;
disconnectDevice(): void;
disconnectDevice(): Promise<void>;
connectDevice({ autoNotify, }?: {

@@ -209,3 +209,3 @@ autoNotify?: boolean;

}): Promise<void>;
disconnectDevice(): void;
disconnectDevice(): Promise<void>;
connectDevice({ autoNotify, }?: {

@@ -212,0 +212,0 @@ autoNotify?: boolean;

{
"name": "qcloud-iotexplorer-appdev-plugin-wificonf-blecombo",
"version": "1.2.7",
"version": "1.2.9",
"description": "",

@@ -20,3 +20,3 @@ "main": "lib/index.js",

"iotexplorer-ui-dev-config": "^1.0.26",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.18",
"qcloud-iotexplorer-appdev-plugin-wificonf-core": "^1.1.21",
"qcloud-iotexplorer-appdev-sdk": "^1.1.15",

@@ -33,3 +33,3 @@ "qcloud-iotexplorer-bluetooth-adapter": "^0.3.6",

},
"gitHead": "10163258c2ec4eacfbe72611ec7205e18498be6a"
"gitHead": "4eb4fb39081ef28403d9f349d212cb698cf67615"
}
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